Articles of post editor

Add data to post edit page, when post is published

I need to customize the “post edit page”, for a custom post_type, but to keep things simple let’s say it’s on the post_type post for now. When the post status is published, I need to run a PHP script that fetches some data from my database, based on the post_id of the current post. Question: […]

Prevent WP from wrapping html in caption shortcode after 'image_send_editor' filter is applied

In my functions.php I have cooked up some functions to filter the attachment output code, when an attachment is sent to the editor. function filter_image_send_to_editor($html, $id, $caption, $title, $align, $url, $size, $alt) { $arr = get_attachments_and_widths_arr($id); return attachments_and_widths_to_html($arr, $id, $align, $caption, $alt); } add_filter(‘image_send_to_editor’, ‘filter_image_send_to_editor’, 10, 9); The return statement returns a string that contains […]

How to make shortcode which returns HTML?

I need to make a shortcode button to TinyMCE editor which, in the moment i click it fills up the content part with HTML. When i click on button i need something like: <div> … </div> And not: [div] … [/div] I made my shortcodes work but i need this too. Any help?

How do you render posts from outside wordpress?

I’m trying to display posts outside of the wordpress system (another system is pulling from the mysql database). However, the posts stored in the database seem to be void of <p> tags and different from what was entered in text mode (or visual mode). For example, entering this in the editor <h3>Subheadline</h3> <p>Sentence here with […]

Do one have to wait after pressing “update” on a post edit page?

Do one have to wait after pressing “update” on a post edit page (becuase if he won’t the post update process will be ruin) or does it make no difference what happens after one clicked the button?

How do I increase the upload size only when editing special pages?

I have the following code to increase the upload size only when editing certain, special pages: function my_edit_page_form( $post ) { if( my_is_special_page( $post ) ) { add_filter( ‘upload_size_limit’, ‘my_upload_size_limit’ ); } } add_action( ‘edit_page_form’, ‘my_edit_page_form’ ); function my_upload_size_limit( $size ) { return 1024 * 18000; } On one of those pages, I have a […]

Custom Columns for Custom Post Type Manager

Failing miserably at adding a custom column add_action(‘manage_edit-pricing_columns’, ‘manage_pricing_columns’); add_action(‘manage_pricing_posts_custom_column’, ‘manage_pricing_custom_columns’); function manage_pricing_columns($_columns) { $new_columns[‘cb’] = ‘<input type=”checkbox” />’; $new_columns[‘title’] = _x(‘Pricing Item’, ‘column name’); $new_columns[‘categories’] = _x(‘Type’, ‘column name’); $new_columns[‘date’] = _x(‘Created’, ‘column name’); return $new_columns; } function manage_pricing_custom_columns($column, $post_id){ global $post; switch($_columns) { case ‘categories’: $pt = get_the_terms( $post_id, ‘pricing_type’ ); echo $pt[0]->name; […]

How can I add a box to edit Order on a regular post?

I’m currently using the menu_order field in the DB to have some custom ordering of posts. I want to expose this field to the user via the admin section, like it is when editing a Page (in Page Attributes). Is there a simple way to do this?

How to change the post form from plugin?

I am starting making some wordpress plugin, so I am a beginer. I just wonder how can I change the post form of the pages. For example for adding some other input (of type file or text)? I am trying to use add_filter(‘comments_template’, ‘add_new_fields’); but nothings happens.

How can I increase the font sizes used by the WordPress visual and HTML post editors?

When I’m editing a post, the text looks too small. I want larger text while editing. Note that I’m not referring to increasing the text in the resulting post … I mean the text as it is displayed while I am editing, only. I’ve looked at Settings under “Writing” and I see I can change […]