Add Last Modified Column

add_filter( ‘manage_posts_columns’, function ( $columns ) { $columns[‘last_modified’] = __( ‘Last Modified’ ); return $columns; } ); add_action( ‘manage_posts_custom_column’, function ( $column, $post_id ) { if ( ‘last_modified’ === $column ) { $modified_time = get_the_modified_time( ‘Y/m/d g:i:s a’, $post_id );…Continue reading

Custom drag and drop (copy) (copy)

function enqueue_admin_reorder_scripts() { global $pagenow; // Ensure the script is not loaded on the plugins page if ($pagenow !== ‘plugins.php’) { wp_enqueue_script(‘jquery-ui-sortable’); wp_add_inline_script(‘jquery-ui-sortable’, ‘ jQuery(document).ready(function($) { var $sortableList = $(“#the-list”); var postType = $(“body”).attr(“class”).match(/post-type-([^s]+)/)[1]; $sortableList.sortable({ update: function(event, ui) { var…Continue reading

Custom drag and drop (copy)

function enqueue_admin_reorder_scripts() { global $pagenow; // Ensure the script is not loaded on the plugins page if ($pagenow !== ‘plugins.php’) { wp_enqueue_script(‘jquery-ui-sortable’); wp_add_inline_script(‘jquery-ui-sortable’, ‘ jQuery(document).ready(function($) { var $sortableList = $(“#the-list”); var postType = $(“body”).attr(“class”).match(/post-type-([^s]+)/)[1]; $sortableList.sortable({ update: function(event, ui) { var…Continue reading

Duplicate Post/Page Link (copy)

// 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

Transform Page Admin To Sales Pages Admin

################################# # Page Edit View ################################# function add_page_meta_boxes() { add_meta_box( ‘page_type_meta_box’, __(‘Page Settings’), ‘render_page_meta_boxes’, ‘page’, ‘side’, ‘high’ // Ensures the meta box appears first ); } add_action(‘add_meta_boxes’, ‘add_page_meta_boxes’); // Render the Meta Box function render_page_meta_boxes($post) { // Get existing values…Continue reading

Remove Author Column from Pages Admin

function remove_author_column_from_pages($columns) { if (isset($columns[‘author’])) { unset($columns[‘author’]); // Remove the “Author” column } return $columns; } add_filter(‘manage_page_posts_columns’, ‘remove_author_column_from_pages’);Continue reading

Unregister widgets damore

//To get rid of the selected widgets function unregister_default_wp_widgets() { unregister_widget( ‘WP_Widget_Calendar’ ); unregister_widget( ‘WP_Widget_Archives’ ); unregister_widget( ‘WP_Widget_Categories’ ); unregister_widget( ‘WP_Widget_Recent_Posts’ ); unregister_widget( ‘WP_Widget_Recent_Comments’ ); unregister_widget( ‘WP_Widget_Tag_Cloud’ ); unregister_widget( ‘WP_Widget_Meta’ ); unregister_widget( ‘WP_Widget_Links’ ); unregister_widget( ‘WP_Widget_Pages’ ); unregister_widget( ‘WP_Widget_RSS’ );…Continue reading

0240 > Populate Booth ID Array

add_filter(‘acf/load_field/name=booth_id’, ‘populate_booth_id_array’, 20, 1); function populate_booth_id_array($field) { global $post; if (!$post instanceof WP_Post || !is_admin()) return $field; $s_id = null; if (get_post_type($post->ID) == ‘show’) { $s_id = $post->ID; } elseif (get_post_type($post->ID) == ‘application’) { $s_id = get_field(‘show_relationship’, $post->ID)[0]; } else…Continue reading

MFP > Populate Booth ID Array

add_filter(‘acf/load_field/name=booth_id’, ‘populate_booth_id_array’, 20, 1); function populate_booth_id_array($field) { global $post; if (!$post instanceof WP_Post || !is_admin()) return $field; $s_id = null; if (get_post_type($post->ID) == ‘show’) { $s_id = $post->ID; } elseif (get_post_type($post->ID) == ‘application’) { $s_id = get_field(‘show_relationship’, $post->ID)[0]; } else…Continue reading