Custom Fields box in the post editor: Replace textareas with input elements
Custom Fields box in the post editor: Replace textareas with input elements
Custom Fields box in the post editor: Replace textareas with input elements
Add the description field on the attached media
Make sure that show_ui and show_in_menu are set to true when the post type is enabled. then all the usual post/pages features will be available. See http://codex.wordpress.org/Function_Reference/register_post_type Also make sure that those features are explicitly declared as by the CPT as supported.
wp-settings cookie screenshot its stored in the cookie wp-settings-USERID, replace USERID with the id of the logged in user. the two values are editor=tinymce or editor=html
I figured out a solution so I’m leaving the question up as it might be helpful to someone else. if ( ‘auto-draft’ == $post->post_status ) : $selected = false; else : $selected = $post->post_author; endif;
Place this code in your functions.php theme (or child theme) file. It uses jQuery to add a new box above the Category div (<div id=”categorydiv” class=”postbox ” >). add_action( ‘admin_footer-post.php’, ‘wpse_99252_add_categories_title_attribute’ ); add_action( ‘admin_footer-post-new.php’, ‘wpse_99252_add_categories_title_attribute’ ); /** * Add a title attribute to categories box in the Post Editor. */ function wpse_99252_add_categories_title_attribute() { ?> <script … Read more
Check the post status using get_post_status( $ID ) and then display the html code according to the status. ( i.e ) You could simply use if else condition in your php template file to display different content based on the post status. I think new posts have auto-draft status. get_post_status codex should be helpful.
Ok – lets try this again 🙂 I added the map_meta_cap parameter which is needed to have delete_others_posts work. Now I was able to get authors to edit and view all posts but only delete their own. $labels = array( ‘name’ => __( ‘Book’, ‘textdomain’ ), ‘singular_name’ => __( ‘Book’, ‘textdomain’ ), ‘menu_name’ => __( … Read more
The MathML tags are removed by the editor. TinyMCE (the editor) removes tags that are not in its “valid_elements” list. The MathML tags and tag-attributes must be added via the “extended_valid_elements” list (seen below). Place the below code in your functions.php file. function mce4_options($opt){ $opt[‘extended_valid_elements’] = ‘math[class|id|xmlns|altimg|alttext|display|overflow],semantics[encoding|definitionURL],annotation[encoding|definitionURL|cd|name|src],annotation-xml[cd|name|encoding|definitionURL|src],merror,mtext,mspace,mover[accent|align],munder,munderover,mstack,mrow[dir],msrow,mfenced[open|close|separators],menclose[notation],mphantom,msup,msub,msubsup,mmultiscripts,mi,mn,mo[fence],ms,mtable,mtr,mtd,mlabeledtr,mfrac[linethickness|bevelled|numalign|denomalign],mfraction,msline,msqrt,mroot,mscarries,mscarry’; return $opt; } add_filter(‘tiny_mce_before_init’,’mce4_options’,25); The above code is … Read more
Ah, this is silly, but it turns out there was a very obvious reason why media_sideload_image() wasn’t working. My wp-content folder had the wrong the permissions from when I transferred it to my local environment and I wasn’t able to upload anything. Changed the permissions and it’s working fine.