/* Add contact info box onto Dashboard */ add_action(‘wp_dashboard_setup’, ‘rd_support_widget’ ); function rd_support_widget() { wp_add_dashboard_widget(‘wp_dashboard_widget’, ‘Support Information’, ‘rd_support_info’); } function rd_support_info() { echo ” Website support For website support, maintenance and further developments contact Rubber Duckers at [email protected] “; }Continue reading
// Replace Hi Greeting AND Comma function replace_hi_greeting($wp_admin_bar) { $my_account=$wp_admin_bar->get_node(‘my-account’); $newtitle = str_replace(‘Hi,’, ”, $my_account->title ); $wp_admin_bar->add_node(array( ‘id’ => ‘my-account’, ‘title’ => $newtitle, ) ); } add_filter(‘admin_bar_menu’, ‘replace_hi_greeting’,12);Continue reading
/* Remove author column in pages */ function custom_remove_author_column( $columns ) { unset($columns[‘author’]); // Remove the author column return $columns; } add_filter( ‘manage_pages_columns’ , ‘custom_remove_author_column’ );Continue reading
// Custom links in Admin bar add_action(‘admin_bar_menu’, ‘add_toolbar_items’, 60); function add_toolbar_items($admin_bar){ $admin_bar->add_menu( array( ‘id’ => ‘Rubber Duckers’, ‘title’ => ‘Rubber Duckers’, ‘href’ => ‘#’, ‘meta’ => array( ‘title’ => __(‘Rubber Duckers’), ), )); $admin_bar->add_menu( array( ‘id’ => ‘Website’, ‘parent’ =>…Continue reading
$file = ‘/path/to/file.png’; $filename = basename($file); $upload_file = wp_upload_bits($filename, null, file_get_contents($file)); if (!$upload_file[‘error’]) { $wp_filetype = wp_check_filetype($filename, null ); $attachment = array( ‘post_mime_type’ => $wp_filetype[‘type’], ‘post_parent’ => $parent_post_id, ‘post_title’ => preg_replace(‘/\.[^.]+$/’, ”, $filename), ‘post_content’ => ”, ‘post_status’ => ‘inherit’ );…Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
// This code snippet is intended to run directly after ACF form data has been saved to the database // AND the post updated has a post type of ‘vendor’ // It is important that the code runs after ACF…Continue reading
add_action( ‘init’, ‘cp_change_post_object’ ); // Change dashboard Posts to Policies function cp_change_post_object() { $get_post_type = get_post_type_object(‘post’); $labels = $get_post_type->labels; $labels->name = ‘Policies’; $labels->singular_name = ‘Policy’; $labels->add_new = ‘Add Policy’; $labels->add_new_item = ‘Add Policy’; $labels->edit_item = ‘Edit Policy’; $labels->new_item = ‘Policies’;…Continue reading
add_filter( ‘x_enqueue_parent_stylesheet’, ‘__return_true’ ); /* Perfmatters Cornerstone fix */ if(strpos($_SERVER[‘REQUEST_URI’], ‘/cornerstone/’) || isset($_POST[‘cs_preview_state’])) { add_filter(‘perfmatters_allow_buffer’, ‘__return_false’); }Continue reading
add_action(‘admin_menu’, ‘content_search_add_admin_menu’); add_action(‘admin_head’, ‘content_search_custom_styles’); function content_search_add_admin_menu() { add_menu_page( ‘Content Search’, ‘Content Search’, ‘manage_options’, ‘content-search’, ‘content_search_page’, ‘dashicons-search’, 6 ); } function content_search_custom_styles() { ?> Content Search The Content Search feature enables you to find specific text within your WordPress site’s content.…Continue reading