function add_backend_panel(){ add_menu_page(‘Name’, ‘Label, ‘edit_dashboard’, ‘attendees-list’, ‘ContentFunction’, ‘dashicons-list-view’); } add_action(‘admin_menu’, ‘add_backend_panel’); // function to display created page content function ContentFunction(){ echo ‘Content goes here.’; }
Category Archives: Wordpress
add_action( ‘manage_colourmedia_column’, ‘colourmedia_columns’, 10, 2 ); function manage_colourmedia_columns( $column, $post_id ) { global $post; $terms = get_post_meta( $post_id ); switch( $column ) { case ‘thumbnail’ : $url = get_the_post_thumbnail_url($post_id); printf( ‘<img src=”‘.$url.'” style=”width:100px”/>’ ); break; case ‘city’ : printf($terms[‘City’][0]); break; case ‘category’ : $cat_list = wp_get_post_terms($post->ID, ‘category’, array(“fields” => “names”)); foreach($cat_list as &$category){ echo ‘<a […]
function reg_cat() { register_taxonomy_for_object_type(‘category’,’scr’); } add_action(‘init’, ‘reg_cat’);
add_filter( ‘manage_edit-colourmedia_columns’, ‘colourmedia_columns’ ) ; // init function function colourmedia_columns( $columns ) { $columns = array( ‘cb’ => ‘<input type=”checkbox” />’, ‘thumbnail’ => __( ‘Thumbnail’ ), ‘category’ => __( ‘Category’ ), ‘title’ => __( ‘Name’ ), ‘city’ => __( ‘City’ ), ‘featured’ => __( ‘Featured’ ), ); return $columns; }
function colourmedia_post_type() { $args = array( ‘public’ => true, ‘label’ => __( ‘BackendName’, ‘textdomain’ ), ‘supports’ => array( ‘title’, ‘editor’, ‘author’, ‘thumbnail’, ‘excerpt’, ‘comments’, ‘custom-fields’ ), ‘menu_icon’ => ‘dashicons-megaphone’, ); register_post_type( ‘colourmedia’, $args ); } add_action( ‘init’, ‘colourmedia_post_type’ );
- 1
- 2