Custom Fields – How can I remove the publish option for certain users

You can do something like this : function wpse_113057_hide_publish_buttons(){ $cpt=”your_post_type”;// can be post global $post; if($post->post_type == $cpt && current_user_can(‘members’) ){ echo ‘ <style type=”text/css”> .misc-pub-section, #delete-action { display:none; } </style> ‘; } } add_action(‘admin_head-post.php’, ‘wpse_113057_hide_publish_buttons’); add_action(‘admin_head-post-new.php’, ‘wpse_113057_hide_publish_buttons’); I did not find a hook to do this with some PHP. Hope this helps.

Can’t change excerpt length and more tag

excerpt_length filter does not work on manually added filter so you use wp_trim_excerpt function, you can develop code same as following to achieve it. <?php if( has_excerpt() ){ the_excerpt(); } else { wp_trim_excerpt(); } ?> excerpt_more does not work on WordPress version 2.8.x and Older for those versions you have to use following filter. <?php … Read more

Show title when inserting single images

I am assuming you are using the WordPress editor tools to insert your single images. If so, you can just write title=”your title” into the markup or go to the visual tab, click the image, hit edit (the photograph icon), and enter a title. I don’t see a way to auto-fill the title, though there … Read more

I want to split this into two functions

You can separate it into two functions by using following code : <?php add_action(‘tmpl_detail_page_custom_fields_collection’,’custom_fields_colletion’); /* Name : custom_fields_colletion Desc : Return the custom fields collection for detail/single page */ function custom_fields_colletion() { global $wpdb,$post,$detail_post_type; $detail_post_type = $post->post_type; if(isset($_REQUEST[‘pid’]) && $_REQUEST[‘pid’]) { $cus_post_type = get_post_type($_REQUEST[‘pid’]); $PostTypeObject = get_post_type_object($cus_post_type); $PostTypeLabelName = $PostTypeObject->labels->name; $single_pos_id = $_REQUEST[‘pid’]; } else … Read more