iframe not showing in post (with “allow php in posts” plugin activated)

I would say that’s a quirk with the plugin. In this case, it’s better to make a shortcode. Add this code to your functions.php file: function wpse_77036_embed_video( $atts ) { extract( shortcode_atts( array( ‘homepage’ => “https://wordpress.stackexchange.com/”, ‘currentpage’ => $_SERVER[‘REQUEST_URI’], ‘width’ => 560, ‘height’ => 315, ‘code’ => ‘I8M_uCnxhwY’, ), $atts ) ); if ( $homepage … Read more

Adding inside wp-plugin jQuery script that receives JSON-formatted data, generated by php-function inside this plugin

Have a read of AJAX in Plugins, then see if you can adapt this code to what Highcharts is wanting: add_action(‘wp_ajax_wpse_77392_get_json’, ‘wpse_77392_get_json’); add_action(‘wp_ajax_nopriv_wpse_77392_get_json’, ‘wpse_77392_get_json’); function wpse_77392_get_json() { global $wpdb; $sql = ” SELECT `date`,`value` FROM {$wpdb->prefix}table_name WHERE `date` BETWEEN ‘2011’ AND ‘2012’ ORDER BY `date` ASC; “; $results = $wpdb->get_results($sql); $json = json_encode($results); header(‘Content-type: application/json’); … Read more

How to add options to the plugin page?

There are a lot of things which you have to understand about Settings API. Instead of duplicating information, I would strongly recommend you to read through bunch of articles called The Complete Guide To The WordPress Settings API, especially pay attention to the second part called Sections, Fields, and Settings. Don’t hesitate to implement examples … Read more

Ajax Plugin Not Echoing Response

This is the final code I am using. Thanks to webaware for pointing out that I was not using the correct datatype. jQuery(document).ready(function($) { $(‘.audience_intel_container .close’).click(function(){ $(‘.audience_intel_container’).fadeOut(‘fast’, function(){ }); }); $(‘.audience_intel_container button’).click(function(){ console.log(‘clicked’); var formdata = $(‘#audience_intel_form’).serialize(); $.ajax({ type : “post”, dataType : “html”, url : audience_intel_js.ajaxurl, data : ‘action=audience_intel&’+formdata, success: function(response) { alert(response); $(‘.audience_intel_container’).html(response); … Read more

Remove timthumb.php from my custom theme

Just delete your timthumb.php file. If your site thumbnails use timthumb then the code might look like this <img src=”https://wordpress.stackexchange.com/questions/80287/<?php bloginfo(“template_directory’); ?>/xxxxx/timthumb.php?src=<?php echo “original image url” ?>&h=150&w=150&zc=1″ /> Just replace those instances with code like this the_post_thumbnail(‘thumbnail’, array(‘class’ => ‘thubnail’));

How to change the wp_upload_dir() path in plugin

The upload directory and URL paths are stored in the options database. You can change them using update_option(): update_option( ‘upload_path’, ABSPATH . ‘/path/to/uploads’ ); update_option( ‘upload_path_url’, site_url( ‘/uploads/’ ) ); However, it’s best not to use this in a publiuc plugin, as it will cause numerous issues. We can instead hook into the filters that … Read more