/** * Conditionally enqueue the scripts used in the admin. * * Includes Thickbox, theme preview and a Genesis script (actually enqueued in genesis_load_admin_js()). * * @since 0.2.3 * * @param string $hook_suffix Admin page identifier. */ function genesis_load_admin_scripts($hook_suffix) { // Only add thickbox/preview if there is an update to Genesis available. if (genesis_update_check()) { add_thickbox(); wp_enqueue_script('theme-preview'); genesis_load_admin_js(); } // If we're on a Genesis admin screen. if (genesis_is_menu_page('genesis') || genesis_is_menu_page('seo-settings') || genesis_is_menu_page('design-settings')) { genesis_load_admin_js(); } // If we're viewing an edit post page, make sure we need Genesis SEO JS. if (in_array($hook_suffix, array('post-new.php', 'post.php'))) { if (!genesis_seo_disabled() && post_type_supports(get_post_type(), 'genesis-seo')) { genesis_load_admin_js(); } } }
/** * Conditionally enqueues the scripts used in the admin. * * Includes Thickbox, theme preview and a Genesis script (actually enqueued * in genesis_load_admin_js()). * * @since 0.2.3 * * @uses genesis_load_admin_js() * @uses genesis_is_menu_page() * @uses genesis_update_check() * @uses genesis_seo_disabled() * * @global stdClass $post Post object * * @param string $hook_suffix Admin page identifier. */ function genesis_load_admin_scripts($hook_suffix) { /** Only add thickbox/preview if there is an update to Genesis available */ if (genesis_update_check()) { add_thickbox(); wp_enqueue_script('theme-preview'); genesis_load_admin_js(); } /** If we're on a Genesis admin screen */ if (genesis_is_menu_page('genesis') || genesis_is_menu_page('seo-settings') || genesis_is_menu_page('design-settings')) { genesis_load_admin_js(); } global $post; /** If we're viewing an edit post page, make sure we need Genesis SEO JS */ if ('post-new.php' == $hook_suffix || 'post.php' == $hook_suffix) { if (!genesis_seo_disabled() && post_type_supports($post->post_type, 'genesis-seo')) { genesis_load_admin_js(); } } }
/** * Integrate the Genesis update check into the WordPress update checks. * * This function filters the value that is returned when WordPress tries to pull theme update transient data. * * It uses `genesis_update_check()` to check to see if we need to do an update, and if so, adds the proper array to the * `$value->response` object. WordPress handles the rest. * * @since 1.1.0 * * @uses genesis_update_check() Ping http://api.genesistheme.com/ asking if a new version of this theme is available. * * @param object $value * * @return object */ function genesis_update_push($value) { if (defined('DISALLOW_FILE_MODS') && true == DISALLOW_FILE_MODS) { return $value; } if (isset($value->response['genesis'])) { unset($value->response['genesis']); } $genesis_update = genesis_update_check(); if ($genesis_update) { $value->response['genesis'] = $genesis_update; } return $value; }
/** * Integrate the Genesis update check into the WordPress update checks. * * This function filters the value that is returned when WordPress tries to pull * theme update transient data. * * It uses genesis_update_check() to check to see if we need to do an update, * and if so, adds the proper array to the $value->response object. WordPress * handles the rest. * * @since 1.1.0 * * @uses genesis_update_check() * * @param object $value * @return object */ function genesis_update_push($value) { $genesis_update = genesis_update_check(); if ($genesis_update) { $value->response['genesis'] = $genesis_update; } return $value; }