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

How to display warning on post editor when trying to add new term to custom taxonomy?

Whilst this doesn’t show a warning as you are asking for, you could always hide the “add new” link using the admin_head action: function yourprefix_admin_head() { echo ‘<style> #language-add-toggle { display: none; } </style>’; } add_action(‘admin_head’, ‘yourprefix_admin_head’); The element ID is the taxonomy name followed by -add-toggle. This is enough for most cases, unless you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)