function title_button_edit_page($title) { global $page_options, $developerMode; // Get the current page info $alias = $_GET['page']; $current = isset($page_options[$alias]) ? $page_options[$alias] : ''; $template = get_template(); // The parent theme // If this is a child theme and $page_options[$alias] exists... // - Only when still working on child thme, could later test against a "developer mode" variable. if ($template == 'runway-framework' && $current) { // Append the button ot the title $title .= ' <a href="' . admin_url('admin.php?page=options-builder&navigation=edit-page&page_id=' . $current['id']) . '" title="' . __('Edit this page', 'framework') . '" class="add-new-h2">' . __('Edit Page', 'framework') . '</a>'; } if (IS_CHILD && $developerMode && $current) { // Reset defaults $title .= ' <a href="' . esc_url(admin_url('admin.php?page=options-builder&navigation=reset-fields-page&page_id=' . $current['id'])) . '" onclick="return confirm(\'' . __('This will delete all saved settings on this page.\\nAre you sure you want to to continue?', 'framework') . '\')" title="' . __('Reset all fields to defaults values.', 'framework') . '" class="add-new-h2">' . __('Reset Defaults', 'framework') . '</a>'; // Toggle Developer Info $title .= ' <a href="#" title="' . __('Show or hide the developer information.', 'framework') . '" class="add-new-h2" id="ToggleDevMode">' . __('Toggle Developer Info', 'framework') . '</a>'; // Add a pointer describing the function of the developer toggle WP_Pointers::add_pointer('all', '#ToggleDevMode', array('title' => __('Developer Functions', 'framework'), 'body' => '<p>' . __('Show PHP references used to output options in theme files', 'framework') . '.</p>'), 'edge: "top", align: "left"'); } return $title; }
if (get_template() == 'runway-framework') { add_submenu_page('current-theme', 'Add Options Page', '+ Add Options Page', 'administrator', 'admin.php?page=options-builder&navigation=new-page'); } } add_action('admin_menu', 'add_child_theme_submenu', 11); // lower priority, 11, forces item to end of sub-menu function clear_submenu() { global $submenu; unset($submenu['framework-options'][0]); unset($submenu['downloads'][0]); unset($submenu['current-theme'][0]); } add_action('admin_menu', 'clear_submenu', 100); //----------------------------------------------------------------- // WP-Pointers (temporary location) //----------------------------------------------------------------- // Dashboard "Getting Started" if (is_admin() && isset($_GET['page']) && $_GET['page'] !== 'dashboard' && !isset($_GET['activate-default'])) { WP_Pointers::add_pointer('all', 'a.wp-first-item[href=\'admin.php?page=dashboard\']', array('title' => 'Start Here', 'body' => '<p>Visit the dashboard and learn how Runway works to start making awesome themes today.</p>'), 'edge: "left", align: "center"'); } } else { // This is no good. The PHP version needs to be higher. :( // ---------------------------------------------------------------- add_action('admin_notices', 'php_version_warning_message'); function php_version_warning_message() { global $current_screen; echo '<div id="message" class="error">', '<h3><strong>You must have PHP v5.3.1 or later to use this theme.</strong></h3>', '<p>You can try adding the following to the top of to your .htaccess file in the WordPress root directory:</p>', '<p><code style="font-size: 14px; font-weight: 800;">AddType application/x-httpd-php53 .php</code></p>', '<p>If that does not work, contact your host and ask them to update your PHP version. The theme will not be functional until this issue is corrected.</p>', '</div>'; } }