本文整理汇总了PHP中admin_url函数的典型用法代码示例。如果您正苦于以下问题:PHP admin_url函数的具体用法?PHP admin_url怎么用?PHP admin_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了admin_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cimy_um_download_database
function cimy_um_download_database()
{
global $cum_upload_path;
if (!empty($_POST["cimy_um_filename"])) {
if (strpos($_SERVER['HTTP_REFERER'], admin_url('users.php?page=cimy_user_manager')) !== false) {
// not whom we are expecting? exit!
if (!check_admin_referer('cimy_um_download', 'cimy_um_downloadnonce')) {
return;
}
$cimy_um_filename = $_POST["cimy_um_filename"];
// sanitize the file name
$cimy_um_filename = sanitize_file_name($cimy_um_filename);
$cimy_um_fullpath_file = $cum_upload_path . $cimy_um_filename;
// does not exist? exit!
if (!is_file($cimy_um_fullpath_file)) {
return;
}
header("Pragma: ");
// Leave blank for issues with IE
header("Expires: 0");
header('Vary: User-Agent');
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: text/csv");
header("Content-Type: application/force-download");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=\"" . esc_html($cimy_um_filename) . "\";");
// cannot use esc_url any more because prepends 'http' (doh)
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($cimy_um_fullpath_file));
readfile($cimy_um_fullpath_file);
exit;
}
}
}
示例2: html
public function html($args = array())
{
global $thesis;
extract($args = is_array($args) ? $args : array());
echo str_repeat("\t", !empty($depth) ? $depth : 0), "<p><a href=\"", admin_url(), '">', sprintf(__('%s Admin', 'thesis'), $thesis->api->base['wp']), "</a></p>\n";
#wp
}
示例3: output
/**
* Output the settings
*/
public function output()
{
global $woocommerce, $woocommerce_settings, $current_section, $current_tab;
if (!current_user_can('manage_woocommerce')) {
wp_die(__('You do not have sufficient permissions to access this page.', MAILPOET_WOOCOMMERCE_TEXT_DOMAIN));
}
do_action('woocommerce_mailpoet_settings_start');
$mailpoet_settings = $this->get_settings();
// Get current section
$current_section = empty($_REQUEST['section']) ? 'general' : sanitize_text_field(urldecode($_REQUEST['section']));
$current = $current_section ? '' : ' class="current"';
// Creates each settings section.
$mailpoet_section = apply_filters('woocommerce_mailpoet_settings_sections', array('general' => __('General', MAILPOET_WOOCOMMERCE_TEXT_DOMAIN), 'lists' => __('Lists', MAILPOET_WOOCOMMERCE_TEXT_DOMAIN)));
foreach ($mailpoet_section as $section => $title) {
$title = ucwords($title);
$current = $section == $current_section ? ' class="current"' : '';
$links[] = '<a href="' . add_query_arg('section', $section, admin_url('admin.php?page=woocommerce_settings&tab=mailpoet')) . '"' . $current . '>' . esc_html($title) . '</a>';
}
echo '<ul class="subsubsub"><li>' . implode('| </li><li>', $links) . '</li></ul><br class="clear" />';
woocommerce_admin_fields($mailpoet_settings);
if ($current_section == 'lists') {
include_once MailPoet_WooCommerce_Add_on()->plugin_path() . '/includes/admin/settings/settings-newsletters.php';
$mailpoet_list = mailpoet_lists();
do_action('woocommerce_mailpoet_list_newsletters', $mailpoet_list);
}
}
示例4: enqueueJavascripts
public function enqueueJavascripts($pageHookname)
{
if ($pageHookname === $this->adminConsolePageHookname) {
$jsDir = $this->config->getPluginUrl() . '/js';
$version = $this->config->getVersion();
$knockoutSuffix = '';
$suffix = '.min';
if (defined('WP_DEBUG') && WP_DEBUG) {
$knockoutSuffix = '.debug';
$suffix = '';
}
wp_register_script('knockout', $jsDir . '/deps/knockout-3.1.0' . $knockoutSuffix . '.js', array(), $version, false);
wp_enqueue_script('knockout');
wp_register_script('knockoutValidation', $jsDir . '/deps/knockout.validation' . $suffix . '.js', array('knockout'), $version, false);
wp_enqueue_script('knockoutValidation');
wp_register_script('autosize', $jsDir . '/deps/jquery.autosize' . $suffix . '.js', array('jquery'), $version, false);
wp_enqueue_script('autosize');
wp_register_script('chamameAdmin', $jsDir . '/admin' . $suffix . '.js', array('jquery', 'knockout', 'knockoutValidation', 'autosize'), $version, false);
wp_enqueue_script('chamameAdmin');
$ajaxUrl = str_replace(array('https:', 'http:'), '', admin_url('admin-ajax.php'));
$token = wp_create_nonce('chamameLiveChat');
$textDomain = $this->config->getTextDomain();
wp_localize_script('chamameAdmin', 'chamameParams', array('ajaxUrl' => $ajaxUrl, 'loggedIn' => $this->session->isLoggedIn(), 'conversationId' => $this->session->getActiveConversationId(), 'token' => $token, 'text' => array('error' => __('Something went wrong. Please try again', $textDomain))));
}
}
示例5: import
public function import()
{
// It might not look like it, but it is actually compatible to
// uncompressed files.
$gzFileHandler = gzopen($this->file, 'r');
Model\DownloadIntent::delete_all();
Model\DownloadIntentClean::delete_all();
$batchSize = 1000;
$batch = array();
while (!gzeof($gzFileHandler)) {
$line = gzgets($gzFileHandler);
list($id, $user_agent_id, $media_file_id, $request_id, $accessed_at, $source, $context, $geo_area_id, $lat, $lng) = explode(",", $line);
$batch[] = array($user_agent_id, $media_file_id, $request_id, $accessed_at, $source, $context, $geo_area_id, $lat, $lng);
if (count($batch) >= $batchSize) {
self::save_batch_to_db($batch);
$batch = [];
}
}
gzclose($gzFileHandler);
// save last batch to db
self::save_batch_to_db($batch);
\Podlove\Analytics\DownloadIntentCleanup::cleanup_download_intents();
\Podlove\Cache\TemplateCache::get_instance()->setup_purge();
wp_redirect(admin_url('admin.php?page=podlove_imexport_migration_handle&status=success'));
exit;
}
示例6: admin_notices
public static function admin_notices()
{
//When editing
global $post, $EM_Event, $pagenow;
if ($pagenow == 'post.php' && ($post->post_type == EM_POST_TYPE_EVENT || $post->post_type == 'event-recurring')) {
if ($EM_Event->is_recurring()) {
$warning = "<p><strong>" . __('WARNING: This is a recurring event.', 'dbem') . "</strong></p>";
$warning .= "<p>" . __('Modifications to this event will cause all recurrences of this event to be deleted and recreated and previous bookings will be deleted! You can edit individual recurrences and disassociate them with this recurring event.', 'dbem');
?>
<div class="updated"><?php
echo $warning;
?>
</div><?php
} elseif ($EM_Event->is_recurrence()) {
$warning = "<p><strong>" . __('WARNING: This is a recurrence in a set of recurring events.', 'dbem') . "</strong></p>";
$warning .= "<p>" . sprintf(__('If you update this event data and save, it could get overwritten if you edit the recurring event template. To make it an independent, <a href="%s">detach it</a>.', 'dbem'), $EM_Event->get_detach_url()) . "</p>";
$warning .= "<p>" . sprintf(__('To manage the whole set, <a href="%s">edit the recurring event template</a>.', 'dbem'), admin_url('post.php?action=edit&post=' . $EM_Event->get_event_recurrence()->post_id)) . "</p>";
?>
<div class="updated"><?php
echo $warning;
?>
</div><?php
}
if (!empty($EM_Event->group_id) && function_exists('groups_get_group')) {
$group = groups_get_group(array('group_id' => $EM_Event->group_id));
$warning = sprintf(__('WARNING: This is a event belonging to the group "%s". Other group admins can also modify this event.', 'dbem'), $group->name);
?>
<div class="updated"><p><?php
echo $warning;
?>
</p></div><?php
}
}
}
示例7: add_pages
/**
* Add options page
*/
public function add_pages()
{
$admin_page = add_options_page(__('TYPO3 Importer Settings', 'typo3-importer'), __('TYPO3 Importer', 'typo3-importer'), 'manage_options', 't3i-options', array(&$this, 'display_page'));
add_action('admin_print_scripts-' . $admin_page, array(&$this, 'scripts'));
add_action('admin_print_styles-' . $admin_page, array(&$this, 'styles'));
add_screen_meta_link('typo3-importer-link', __('TYPO3 Importer', 'typo3-importer'), admin_url('tools.php?page=typo3-importer'), $admin_page, array('style' => 'font-weight: bold;'));
}
示例8: wpcf_fields_select_insert_form
/**
* Form data for group form.
*
* @return type
*/
function wpcf_fields_select_insert_form($form_data = array(), $parent_name = '')
{
$id = 'wpcf-fields-select-' . wpcf_unique_id(serialize($form_data));
$form['name'] = array('#type' => 'textfield', '#title' => __('Name of custom field', 'wpcf'), '#description' => __('Under this name field will be stored in DB (sanitized)', 'wpcf'), '#name' => 'name', '#attributes' => array('class' => 'wpcf-forms-set-legend'), '#validate' => array('required' => array('value' => true)));
$form['description'] = array('#type' => 'textarea', '#title' => __('Description', 'wpcf'), '#description' => __('Text that describes function to user', 'wpcf'), '#name' => 'description', '#attributes' => array('rows' => 5, 'cols' => 1));
$form['options-markup-open'] = array('#type' => 'markup', '#markup' => '<strong>' . __('Options', 'wpcf') . '</strong><br /><br />' . '<div class="wpcf-form-options-header-title">' . '<em>' . __('Display text', 'wpcf') . '</em>' . '</div><div class="wpcf-form-options-header-value">' . '<em>' . __('Custom field content', 'wpcf') . '</em></div>' . '<div id="' . $id . '-sortable"' . ' class="wpcf-fields-select-sortable wpcf-compare-unique-value-wrapper">');
$options = !empty($form_data['options']) ? $form_data['options'] : array();
$options = !empty($form_data['data']['options']) ? $form_data['data']['options'] : $options;
if (!empty($options)) {
foreach ($options as $option_key => $option) {
if ($option_key == 'default') {
continue;
}
$option['key'] = $option_key;
$option['default'] = isset($options['default']) ? $options['default'] : null;
$form = $form + wpcf_fields_select_get_option('', $option);
}
} else {
$form = $form + wpcf_fields_select_get_option();
}
if (!empty($options)) {
$count = count($options);
} else {
$count = 1;
}
$form['options-markup-close'] = array('#type' => 'markup', '#markup' => '</div><div id="' . $id . '-add-option"></div><br /><a href="' . admin_url('admin-ajax.php?action=wpcf_ajax&wpcf_action=add_select_option&_wpnonce=' . wp_create_nonce('add_select_option') . '&wpcf_ajax_update_add=' . $id . '-sortable&parent_name=' . urlencode($parent_name) . '&count=' . $count) . '" onclick="wpcfFieldsFormCountOptions(jQuery(this));"' . ' class="button-secondary wpcf-ajax-link">' . __('Add option', 'wpcf') . '</a>');
$form['options-close'] = array('#type' => 'markup', '#markup' => '<br /><br />');
return $form;
}
示例9: pop_admin_head
function pop_admin_head()
{
$url = admin_url();
?>
<script type='text/javascript'>
jQuery(document).ready(function($){
load_list_of_widgets();
});
var load_list_tries = 0;
function load_list_of_widgets(){
if(load_list_tries++>2)return;
jQuery(document).ready(function($){
$.post('<?php
echo $url;
?>
',{'wlb-get-dashboard-widgets':1},function(data){
if( $(data).find('#wlb-dashboard-widgets-holder').length > 0 ){
$('#list-of-dashboard-widgets').html( $(data).find('#wlb-dashboard-widgets-holder').show() );
}else{
$('#list-of-dashboard-widgets').html( '<input type="hidden" name="wlb_skip_dashboard_widgets" value="1" />' );
load_list_of_widgets();
}
},'html');
});
}
</script>
<?php
}
示例10: admin_init
/**
* Process redirection of all dashboard pages for password reset
*
* @since 1.8
*
* @return void
*/
public function admin_init() {
if ( isset( get_current_screen()->id ) && ( 'profile' === get_current_screen()->id || 'profile-network' === get_current_screen()->id ) ) {
if ( isset( $this->settings['expire'] ) && $this->settings['expire'] === true ) { //make sure we're enforcing a password change
$current_user = wp_get_current_user();
if ( isset( $current_user->ID ) && $current_user->ID !== 0 ) { //make sure we have a valid user
$required = get_user_meta( $current_user->ID, 'itsec_password_change_required', true );
if ( $required == true ) {
wp_safe_redirect( admin_url( 'profile.php?itsec_password_expired=true#pass1' ) );
exit();
}
}
}
}
}
示例11: route
public function route()
{
wp_enqueue_script('wpProQuiz_front_javascript', plugins_url('js/wpProQuiz_front' . (WPPROQUIZ_DEV ? '' : '.min') . '.js', WPPROQUIZ_FILE), array('jquery', 'jquery-ui-sortable'), WPPROQUIZ_VERSION);
wp_localize_script('wpProQuiz_front_javascript', 'WpProQuizGlobal', array('ajaxurl' => admin_url('admin-ajax.php'), 'loadData' => __('Loading', 'wp-pro-quiz'), 'questionNotSolved' => __('You must answer this question.', 'wp-pro-quiz'), 'questionsNotSolved' => __('You must answer all questions before you can completed the quiz.', 'wp-pro-quiz'), 'fieldsNotFilled' => __('All fields have to be filled.', 'wp-pro-quiz')));
wp_enqueue_style('wpProQuiz_front_style', plugins_url('css/wpProQuiz_front' . (WPPROQUIZ_DEV ? '' : '.min') . '.css', WPPROQUIZ_FILE), array(), WPPROQUIZ_VERSION);
$this->showAction($_GET['id']);
}
示例12: wp_rp_set_global_notice
function wp_rp_set_global_notice()
{
$wp_rp_meta = get_option('gp_meta');
$settings_url = admin_url('options-general.php?page=wordpress-related-posts&gp_global_notice=0#wp_rp_about_collapsible');
$wp_rp_meta['global_notice'] = array('title' => 'Thanks for using Related posts plugin. We like you.', 'message' => 'Did you notice you can <strong>now</strong> insert related articles while in <strong>text mode</strong>? <br>Read more about it in <a href="' . $settings_url . '">Settings</a> under About related posts section.');
update_option('gp_meta', $wp_rp_meta);
}
示例13: title_button_add
function title_button_add($title)
{
if ($_GET['page'] == 'options-builder') {
$title .= ' <a href="' . admin_url('admin.php?page=options-builder&navigation=new-page') . '" class="add-new-h2">' . __('New Admin Page', 'framework') . '</a>';
}
return $title;
}
示例14: wpcf_fields_skype_meta_box_form
/**
* Form data for post edit page.
*
* @param type $field
*/
function wpcf_fields_skype_meta_box_form($field)
{
add_thickbox();
if (isset($field['value'])) {
$field['value'] = maybe_unserialize($field['value']);
}
$form = array();
add_filter('wpcf_fields_shortcode_slug_' . $field['slug'], 'wpcf_fields_skype_shortcode_filter', 10, 2);
$rand = wpcf_unique_id(serialize($field));
$form['skypename'] = array('#type' => 'textfield', '#value' => isset($field['value']['skypename']) ? $field['value']['skypename'] : '', '#name' => 'wpcf[' . $field['slug'] . '][skypename]', '#id' => 'wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '-skypename', '#inline' => true, '#suffix' => ' ' . __('Skype name', 'wpcf'), '#description' => '', '#prefix' => !empty($field['description']) ? wpcf_translate('field ' . $field['id'] . ' description', $field['description']) . '<br /><br />' : '', '#attributes' => array('style' => 'width:60%;'), '#_validate_this' => true, '#before' => '<div class="wpcf-skype">');
$form['style'] = array('#type' => 'hidden', '#value' => isset($field['value']['style']) ? $field['value']['style'] : 'btn2', '#name' => 'wpcf[' . $field['slug'] . '][style]', '#id' => 'wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '-style');
$preview_skypename = !empty($field['value']['skypename']) ? $field['value']['skypename'] : '--not--';
$preview_style = !empty($field['value']['style']) ? $field['value']['style'] : 'btn2';
$preview = wpcf_fields_skype_get_button_image($preview_skypename, $preview_style);
// Set button
// TODO WPML move
if (isset($field['disable']) || wpcf_wpml_field_is_copied($field)) {
$edit_button = '';
} else {
$edit_button = '' . '<a href="' . admin_url('admin-ajax.php?action=wpcf_ajax&' . 'wpcf_action=insert_skype_button&_wpnonce=' . wp_create_nonce('insert_skype_button') . '&update=wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '&skypename=' . $preview_skypename . '&button_style=' . $preview_style . '&keepThis=true&TB_iframe=true&width=500&height=500') . '"' . ' class="thickbox wpcf-fields-skype button-secondary"' . ' title="' . __('Edit Skype button', 'wpcf') . '"' . '>' . __('Edit Skype button', 'wpcf') . '</a>';
}
$form['markup'] = array('#type' => 'markup', '#markup' => '<div class="wpcf-form-item">' . '<div id="wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '-preview">' . $preview . '</div>' . $edit_button . '</div>');
$form['markup-close'] = array('#type' => 'markup', '#markup' => '</div>');
return $form;
}
示例15: show_header_notice
static function show_header_notice()
{
?>
<div class="updated woocommerce-de-message warning">
<h4><?php
_e('Update Notifications for Xtreme One and Xtreme Child Themes', XF_TEXTDOMAIN);
?>
</h4>
<p>
<?php
echo sprintf(__('In order to receive update notifications for Xtreme One and its child themes it is recommend that you install the GitHub Updater plugin. Download the latest release of GitHub Updater from <a href="%s">https://github.com/afragen/github-updater</a>.', XF_TEXTDOMAIN), 'https://github.com/afragen/github-updater');
?>
</p>
<form action="<?php
admin_url('admin.php');
?>
" method="post">
<input type="submit" class="button" name="xtreme_github_updater_notice_off" value="<?php
_e('Dismiss this notice.');
?>
" />
</form>
</div>
<?php
}