Admin Panel Footer – Menu

add_filter( ‘admin_footer_text’, function ( $footer_text ) { // Edit the line below to customize the footer text. $footer_text = ‘Check Scorecard | Get Kallados | Check GT Speed | Check Goog Speed | Update CSP | Login CDN‘; return $footer_text;…Continue reading

Admin Bar – Updates

function add_updates_admin_bar_menu() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘id’ => ‘updates’, ‘title’ => ‘Updates’, ‘href’ => admin_url( ‘update-core.php’ ), ‘parent’ => ‘top-secondary’, ) ); } add_action( ‘wp_before_admin_bar_render’, ‘add_updates_admin_bar_menu’ );Continue reading

Setting default template for post type

/** * Setting default template for post type as a pattern php file * */ function awesome_register_podcast_template() { $post_type_object = get_post_type_object( ‘podcast’ ); $post_type_object->template = array( array( ‘core/pattern’, array( ‘slug’ => ‘vivek/podcast-audio’, ) ), ); } add_action( ‘init’, ‘awesome_register_podcast_template’ );Continue reading

Loading ACF Blocks from theme

/** * Load Blocks */ function load_blocks() { $theme = wp_get_theme(); $blocks = get_blocks(); foreach( $blocks as $block ) { if ( file_exists( get_template_directory() . ‘/blocks/’ . $block . ‘/block.json’ ) ) { register_block_type( get_template_directory() . ‘/blocks/’ . $block .…Continue reading

Load all Customizer “Additional CSS” in Block Editor

// Load the Frontend customizer “Additonal CSS” in the block editor. add_action( ‘enqueue_block_editor_assets’, ‘wp_custom_css_cb’ ); // Uncomment below if you need to manually manipulate the CSS for the block editor. // add_action( ‘enqueue_block_editor_assets’, function() { // ob_start(); // wp_custom_css_cb(); //…Continue reading

Order WPCode snippets by title in the admin

add_filter( ‘wpcode_code_snippets_table_prepare_items_args’, function( $args ) { if ( ! isset( $_GET[‘orderby’] ) ) { $args[‘orderby’] = ‘title’; } if ( ! isset( $_GET[‘order’] ) ) { $args[‘order’] = ‘ASC’; } return $args; });Continue reading

Remove admin left menu items

function ideapro_remove_wpadmin_menus() { global $current_user; $users = array(3,4,5); $role = $current_user->roles[0]; if($current_user->ID == 1) { } elseif($role == “editor” || $role == “subscriber” || $role == “author”) { remove_menu_page(‘themes.php’); remove_menu_page(‘plugins.php’); remove_menu_page(‘edit.php?post_type=page’); remove_menu_page(‘edit.php?post_type=popup’); remove_menu_page(‘edit.php?post_type=project’); remove_menu_page(‘index.php’); remove_menu_page(‘users.php’); remove_menu_page(‘tools.php’); remove_menu_page(‘upload.php’); remove_menu_page(‘edit.php’); remove_menu_page(‘edit-comments.php’); remove_menu_page(‘options-general.php’);…Continue reading