Discuss your project

Topic

admin

18 articles Page 2

WordPress: Configure an options page in the admin

This example allows the addition of an options page for a WordPress theme. The file should be named theme-options.php and must be placed in the functions directory of your theme. This example is taken from the Pubicis-Verbe project. <?php add_action('admin_menu','verbe_menu_page'); function verbe_menu_page(){ add_theme_page('Verbe Theme Options', 'Theme Option', 'manage_options', 'verbe-theme-option', 'verbe_setting_page'); } add_action('admin_init', 'verbe_register_setting'); fu...

WordPress: Configure TinyMCE

Overriding the default TinyMCE configuration:To insert into the functions.php function myformatTinyMCE($in) { $in['remove_linebreaks']=false; $in['gecko_spellcheck']=false; $in['keep_styles']=true; $in['accessibility_focus']=true; $in['tabfocus_elements']='major-publishing-actions'; $in['media_strict']=false; $in['paste_remove_styles']=false; $in['paste_remove_spans']=false; $in['paste_strip_class_attributes']='none'; $in['paste_text_use_dialog']=true; $in['wpeditimage_disable_captions']=tru...

WordPress: Add a taxonomy manually

Example of manual addition of a taxonomy (without going through the configuration).To be placed in the functions.php file: /** * Manual add new Field to taxonomy or you can use plugin "taxonomy manager" * * BEGIN */ // A callback function to add a custom field to our "expertise" taxonomy function expertise_taxonomy_custom_fields($tag) { // Check for existing taxonomy meta for the term you're editing $t_id = $tag->term_id; // Get the ID of the term you're editing $term_meta = get_optio...

WordPress: Remove update notifications

Place in the functions.php file: $func = function ($a) { global $wp_version; return (object) array( 'last_checked' => time(), 'version_checked' => $wp_version, ); }; add_filter('pre_site_transient_update_core', $func); add_filter('pre_site_transient_update_plugins', $func); add_filter('pre_site_transient_update_themes', $func); Reproduce this customization today The principle of the hook remains useful, but the administration screens and WordPress APIs have evolved since the...

WordPress: Customize the admin footer

To be placed in the functions.php file: function modify_footer_admin () { echo 'Created by <a href="http://www.partitech.com">Partitech</a>.'; } if (is_admin()) { add_filter('admin_footer_text', 'modify_footer_admin'); } Reproduce this customization today The principle of the hook remains useful, but the administration screens and WordPress APIs have evolved since the publication. Test the code in a staging environment with the exact version of the site's core,...

WordPress: Remove default elements in the header

In some cases, we need to remove all the default meta tags from WordPress templates. To do this, simply add the following code to your functions.php file remove_action('wp_head', 'wp_print_styles', 8); remove_action('wp_head', 'wp_print_head_scripts', 9); remove_action('wp_head', 'feed_links_extra', 3); remove_action('wp_head', 'feed_links', 2); remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'index_rel_link'); remove_action('wp_he...