Last active
October 26, 2018 09:20
-
-
Save timba64/5983a7f75141d6803d6cc3a1ed43ca34 to your computer and use it in GitHub Desktop.
some functions for Wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add styles only on one page of admin area Wordpress | |
add_action( 'admin_enqueue_scripts', 'add_css_help_page' ); | |
function add_css_help_page( $hook ){ | |
//wp_die($hook); | |
// output help.css only on help page in admin zone | |
if($hook != 'toplevel_page_help') { | |
return; | |
} | |
wp_enqueue_style( 'css-help-admin', get_template_directory_uri() .'/help.css' ); | |
} | |
// Register widget in console page of Wordpress | |
add_action('wp_dashboard_setup', 'abm_dashboard_widgets' ); | |
function abm_dashboard_widget_function( $post, $callback_args ) { | |
$url = admin_url('admin.php?page=help'); | |
echo "<p>Если вам нужно вспомнить как редактировать содержание сайта, используйте ссылку на страницу помощи.</p>"; | |
echo "<p><a href='" . $url ."'>Как редактировать содержимое сайта?</a></p>"; | |
} | |
function abm_dashboard_widgets() { | |
wp_add_dashboard_widget('abm_widget', 'Страница описания', 'abm_dashboard_widget_function'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment