本文整理汇总了PHP中add_media_page函数的典型用法代码示例。如果您正苦于以下问题:PHP add_media_page函数的具体用法?PHP add_media_page怎么用?PHP add_media_page使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_media_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_menu
public function admin_menu()
{
$this->user_created_pages = SerializeStringToArray(get_option($this->prefix('user_created_pages')));
if ($this->user_created_pages && count($this->user_created_pages) >= 1) {
foreach ($this->user_created_pages as $page) {
if (isset($page['page_slug']) && isset($page['page_title']) && isset($page['parent_menu'])) {
if ($page['parent_menu'] == 'new_menu') {
add_menu_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'dashboard') {
add_dashboard_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'posts') {
add_posts_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'media') {
add_media_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'pages') {
add_pages_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'comments') {
add_comments_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'theme') {
add_theme_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'plugins') {
add_plugins_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'users') {
add_users_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'management') {
add_management_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif ($page['parent_menu'] == 'options') {
add_options_page($page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
} elseif (array_key_exists($page['parent_menu'], $user_pages)) {
add_submenu_page($page['parent_menu'], $page['page_title'], $page['page_title'], 'manage_options', $page['page_slug'], array($this, 'user_created_menu_pages'));
}
}
}
}
}
示例2: admin_menu
function admin_menu()
{
if ($this->user_allowed()) {
add_media_page(__('Add From Server', 'add-from-server'), __('Add From Server', 'add-from-server'), 'read', 'add-from-server', array($this, 'menu_page'));
}
add_options_page(__('Add From Server', 'add-from-server'), __('Add From Server', 'add-from-server'), 'manage_options', 'add-from-server-settings', array($this, 'options_page'));
}
示例3: wr2x_admin_menu_dashboard
/**
*
* RETINA DASHBOARD
*
*/
function wr2x_admin_menu_dashboard()
{
$refresh = isset($_GET['refresh']) ? $_GET['refresh'] : 0;
$clearlogs = isset($_GET['clearlogs']) ? $_GET['clearlogs'] : 0;
$ignore = isset($_GET['ignore']) ? $_GET['ignore'] : false;
if ($ignore) {
if (!wr2x_is_pro()) {
echo "<div class='error' style='margin-top: 20px;'><p>";
_e("Ignore is a Pro feature.", 'wp-retina-2x');
echo "</p></div>";
} else {
wr2x_add_ignore($ignore);
}
}
if ($refresh) {
wr2x_calculate_issues();
}
if ($clearlogs) {
if (file_exists(plugin_dir_path(__FILE__) . '/wp-retina-2x.log')) {
unlink(plugin_dir_path(__FILE__) . '/wp-retina-2x.log');
}
}
$flagged = count(wr2x_get_issues());
$warning_title = __("Retina images", 'wp-retina-2x');
$menu_label = sprintf(__('Retina %s'), "<span class='update-plugins count-{$flagged}' title='{$warning_title}'><span class='update-count'>" . number_format_i18n($flagged) . "</span></span>");
add_media_page('Retina', $menu_label, 'manage_options', 'wp-retina-2x', 'wpr2x_wp_retina_2x');
}
示例4: s3admin_menu
function s3admin_menu()
{
//Add upload form Submenu
add_media_page('S3 Upload Form', 'S3 Upload Form', 'administrator', 's3_uploader', 's3form_content');
add_media_page(' S3 Bucket Contents', 'S3 Bucket Contents', 'administrator', 's3uploader', 's3bucket_content');
//Add settings submenu
add_options_page('Amazon S3 Video Upload Settings', 'S3 Upload Settings', 'manage_options', 'S3 Upload Form', 's3settings');
}
示例5: gdml_media_actions
function gdml_media_actions()
{
if (!is_admin()) {
wp_die("You are not authorized to view this page");
} else {
add_media_page("Google Drive Media Library", "Google Drive Media Library", 1, "google-drive-media-library-management", "gdml_media");
add_action('admin_enqueue_scripts', 'gdml_adminScript');
}
}
示例6: screen
/**
* Add Bulk option settings page
*/
function screen()
{
$admin_page_suffix = add_media_page('Bulk WP Smush.it', 'WP Smush.it', 'edit_others_posts', 'wp-smushit-bulk', array($this, 'ui'));
//Register Debug page only if WP_SMPRO_DEBUG is defined and true
if (defined('WP_SMUSHIT_DEBUG') && WP_SMUSHIT_DEBUG) {
add_media_page('WP Smush.it Error Log', 'Error Log', 'edit_others_posts', 'wp-smushit-errorlog', array($this, 'create_admin_error_log_page'));
}
// enqueue js only on this screen
add_action('admin_print_scripts-' . $admin_page_suffix, array($this, 'enqueue'));
}
示例7: admin_menu
function admin_menu()
{
if (!function_exists('submit_button')) {
return;
}
if ($this->user_allowed()) {
add_media_page(__('Add From Server', 'add-from-server'), __('Add From Server', 'add-from-server'), 'read', 'add-from-server', array(&$this, 'menu_page'));
}
add_options_page(__('Add From Server Settings', 'add-from-server'), __('Add From Server', 'add-from-server'), 'manage_options', 'add-from-server-settings', array(&$this, 'options_page'));
}
示例8: create_menus
function create_menus()
{
add_media_page(__('Galleries', 'foogallery'), __('Galleries', 'foogallery'), 'upload_files', 'edit.php?post_type=' . FOOGALLERY_CPT_GALLERY);
add_media_page(__('Add Gallery', 'foogallery'), __('Add Gallery', 'foogallery'), 'upload_files', 'post-new.php?post_type=' . FOOGALLERY_CPT_GALLERY);
$api = new FooGallery_Extensions_API();
if ($api->is_active('albums')) {
add_media_page(__('Albums', 'foogallery'), __('Albums', 'foogallery'), 'upload_files', 'edit.php?post_type=' . FOOGALLERY_CPT_ALBUM);
add_media_page(__('Add Album', 'foogallery'), __('Add Album', 'foogallery'), 'upload_files', 'post-new.php?post_type=' . FOOGALLERY_CPT_ALBUM);
}
}
示例9: bulk_resize_create_menu
/**
* Create the settings menu item in the WordPress admin navigation and
* link it to the plugin settings page
*/
function bulk_resize_create_menu()
{
if (BULK_RESIZE_SUPER_ADMIN_ONLY) {
if (is_super_admin()) {
add_media_page('Bulk Resize Images', 'Bulk Resize', 'add_users', 'bulk_resize_admin', 'bulk_resize_settings_page');
}
} else {
add_media_page('Bulk Resize Images', 'Bulk Resize', 'add_users', 'bulk_resize_admin', 'bulk_resize_settings_page');
}
}
示例10: oaf_create_submenu
function oaf_create_submenu()
{
add_dashboard_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
add_posts_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
add_media_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
add_pages_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
add_comments_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
add_theme_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
add_users_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
add_management_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
add_options_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
}
示例11: admin_menu
public function admin_menu()
{
// NEEDS: menu_page()
// NEEDS: options_page()
if (!function_exists('submit_button')) {
return;
}
if (current_user_can('upload_files')) {
add_media_page(__('Dropbox Sideload', 'dropbox-sideload'), __('Dropbox Sideload', 'dropbox-sideload'), 'read', 'dropbox-sideload', array(&$this, 'menu_page'));
}
if (current_user_can('manage_options')) {
add_options_page(__('Dropbox Sideload Options', 'dropbox-sideload'), __('Dropbox Sideload Options', 'dropbox-sideload'), 'read', 'dropbox-sideload', array(&$this, 'options_page'));
}
}
示例12: my_admin_menu
function my_admin_menu()
{
//create a main admin panel
//create a sub admin panel link above
add_menu_page('Bandi Summary', 'Bandi Summary', 'administrator', 9, array(&$this, 'overview'));
//These functions adds sub menu for different kinds of admin panel on back end
add_options_page('Mahesh Options', 'Mahesh Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_options'));
add_posts_page('Mahesh posts', 'Mahesh Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_posts'));
add_media_page('Mahesh media', 'Mahesh Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_media'));
add_pages_page('Mahesh pages', 'Mahesh Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_pages'));
add_users_page('Mahesh users', 'Mahesh Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_users'));
add_management_page('Bandi', 'Mahesh Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_tools'));
add_theme_page('Bandi', 'Mahesh Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_themes'));
}
示例13: wr2x_admin_menu_dashboard
/**
*
* RETINA DASHBOARD
*
*/
function wr2x_admin_menu_dashboard()
{
$refresh = isset($_GET['refresh']) ? $_GET['refresh'] : 0;
$ignore = isset($_GET['ignore']) ? $_GET['ignore'] : false;
if ($ignore) {
wr2x_add_ignore($ignore);
}
if ($refresh) {
wr2x_calculate_issues();
}
$flagged = count(wr2x_get_issues());
$warning_title = __("Retina images", 'wp-retina-2x');
$menu_label = sprintf(__('WP Retina 2x %s'), "<span class='update-plugins count-{$flagged}' title='{$warning_title}'><span class='update-count'>" . number_format_i18n($flagged) . "</span></span>");
add_media_page('WP Retina 2x', $menu_label, 'manage_options', 'wp-retina-2x', 'wpr2x_wp_retina_2x');
}
示例14: init
function init()
{
// set the title for
$this->menu_title = __('Galleri', 'sthlm_gallery');
// check if theme has thumbnail support else activate for sthlm_gallery post_type
if (!current_theme_supports('post-thumbnails')) {
add_theme_support('post-thumbnails', array('sthlm_gallery'));
}
$admin_page = add_media_page($this->title, $this->menu_title, $this->capability, $this->menu_slug, array(&$this, 'gallery_page'));
// javascript på andmin sidan och med variablen ovan använder scripet bara på den sidan
add_action('admin_print_scripts-' . $admin_page, array(&$this, 'js_admin'));
// admin css
add_action('admin_print_styles-' . $admin_page, array(&$this, 'css_admin'));
// js on all admin pages
//add_action('admin_print_scripts', array(&$this,'js_admin_edit'));
}
示例15: screen
/**
* Add Bulk option settings page
*/
function screen()
{
global $hook_suffix;
$admin_page_suffix = add_media_page('Bulk WP Smush', 'WP Smush', 'edit_others_posts', 'wp-smush-bulk', array($this, 'ui'));
// enqueue js only on this screen
add_action('admin_print_scripts-' . $admin_page_suffix, array($this, 'enqueue'));
// Enqueue js on media screen
add_action('admin_print_scripts-upload.php', array($this, 'enqueue'));
// Enqueue js on Post screen (Edit screen for media )
add_action('admin_print_scripts-post.php', array($this, 'enqueue'));
}