Dynamic URL to reference custom PHP files

I’m not positive I understand the question, but if you’re just trying to get the site URL, you can use the get_site_url() WP function. So, like this: $siteURL = get_site_url(); header(“=Location: $siteURL” . “/myoriginalformpage/?success=”, $success); And you can change the parameters of get_site_url() to specify the path and to display ‘https’ or ‘http’. But if … Read more

Render a different post/template from within the template_include action?

This was a bit tricky to solve your problem. the template_include filter executed after the main query processed the current request. If you can filter the current request (query_vars) and update it accordingly then WordPress will display any post/page you wanted to… Simply filter the query_vars with the request filter. Check the following snippet. But … Read more

$wpdb->insert is changing a value

Great advice Rarst! The output of $wpdb->queries was exactly what it should be: “INSERT INTO `wp_featured_releases` (`fr_band`,`fr_album`,`fr_album_description`,`fr_image_id`,`fr_shop_url`,`fr_modified`) VALUES (”,”,”,’504′,”,’2011-01-14 10:49:58pm’)” 504 is the correct id for the image, but the value in the table is still 127. My latest thought is that my mysql skills have failed me. Images with an ID below 127 work … Read more

How to un-attach rich text editor from named textarea elements

Currently you’re telling it to target all textareas on the page so you need to change $init[‘mode’] = ‘textareas’; to $init[‘mode’] = ‘specific_textareas’ or $init[‘mode’] = ‘exact’ and then name the textarea by id where you have $init[‘elements’] = ‘category_description,description’; defined. To read more about tinyMCE options go to http://tinymce.moxiecode.com/wiki.php/Configuration and the mode configuration description … Read more

What is the best way to output plugin result in certain url

There are two steps: function my_plugin_rewrite_rule() { global $wp; $wp->add_query_var( ‘show_hello_world’ ); add_rewrite_rule( ‘show-hello-world/?$’, ‘index.php?show_hello_world=1’, ‘top’ ); } add_action( ‘init’, ‘my_plugin_rewrite_rule’ ); That takes care of rewriting. Remember to flush the rewrite rules. Now, your plugin can check for get_query_var( ‘show_hello_world’ ); and load a certain file: function my_plugin_template( $path ) { if ( get_query_var( … Read more