Editing Source Code in WordPress

You don’t want to edit core WordPress code. You don’t need to edit core WordPress code to do what you need to implement. First, you need to study the WordPress templating (i.e. Theme) functionality. Then, you need to study Plugins and the WordPress Hooks API, including its Action Hooks and its Filter Hooks. To do … Read more

use WordPress theme / plugin editor in my plugin

To start with you could use the following code. For security you could also add some nonce check and even use the settings api. Here plugin-test is your plugin folder name. $file = stripslashes(‘plugin-test/style.css’); $plugin_files = get_plugin_files($file); $file = validate_file_to_edit($file, $plugin_files); $real_file = WP_PLUGIN_DIR . “https://wordpress.stackexchange.com/” . $file; if( isset($_POST[‘plugin_test_settings’][‘newcontent’]) ) { $newcontent = stripslashes($_POST[‘plugin_test_settings’][‘newcontent’]); … Read more

Has anyone managed to integrate the wp_editor inside a widget?

As said I think it’s quite hard to find a reliable solution because you have to take care of so many things. I go either for the way proposed by Danny van Kooten: http://dannyvankooten.com/450/tinymce-wysiwyg-editor-in-wordpress-plugin/ add and open the editor in a thickbox or another way I’ve used once, using the widget “accessibility mode” for “advanced” … Read more

post editor changes & to &

I dont know what you are doing with your shortcode but it is good practice to serialize and parse data so that it displays beautifully. Since you need to look for & and not for & just use $data = str_replace(“&”, “&”, $data). Also you could look in the php manual for urldecode() and urlencode(). … Read more

How to group meta boxes on the post edit page

Thanks for the hint Bainternet, indeed this is very easy to implement with jQuery. Example (the four meta boxes are closed for clarity) : Here’s what I did : var $j = jQuery.noConflict(); $j(document).ready(function() { $j(“#side-sortables”).append(‘<div id=”container_div” class=”postbox meta-box-sortables ui-sortable”><div class=”handlediv” title=”Click to toggle.”><br></div><h3 class=”hndle”><span>Container Meta Box</span></h3><div id=”container_inside” class=”inside”></div></div>’); $j(“#my_metabox_div”).appendTo(“#container_inside”); $j(“#my_other_metabox_div”).appendTo(“#container_inside”); etc… }); I added … Read more