403 error when publishing a post in wordpress. Error => Publishing failed. The response is not a valid JSON response
403 error when publishing a post in wordpress. Error => Publishing failed. The response is not a valid JSON response
403 error when publishing a post in wordpress. Error => Publishing failed. The response is not a valid JSON response
First, there’s the debug query arg: ?dev=1, which you can simply append to the URl. AFAIK, the plugin relies on get_posts(), so you should be save to use &offset=10. _Disclaimer: Not tested, as I ain’t got a setup with the plugin in use.`
Use this function form http://www.php.net/manual/en/function.json-encode.php#80339 function json_format($json) { $tab = ” “; $new_json = “”; $indent_level = 0; $in_string = false; $json_obj = json_decode($json); if($json_obj === false) return false; $json = json_encode($json_obj); $len = strlen($json); for($c = 0; $c < $len; $c++) { $char = $json[$c]; switch($char) { case ‘{‘: case ‘[‘: if(!$in_string) { $new_json … Read more
You should be urlencodeing your content. Whitespace is not a valid character in URLs. If you have access to WordPress functions on the sending side you can use esc_url. I suspect that has a lot to do with your problem. Be aware that there is a character limit on $_GET strings. If you are going … Read more
How to do remote requests in WordPress: Use the appropriate API First, there’s the WP HTTP API, which should be used for such tasks. And second, one should never ever use the @ operator, as this one suppresses error messages or notices and will successfully lock you out from troubleshooting your bugs. Just because you … Read more
I’ve found a possible solution. Not sure if it is safe though jQuery(function(jQuery) { // Uploading files var file_frame; var wp_media_post_id = wp.media.model.settings.post.id; // Store the old id var set_to_post_id = 5; // Set this formfield = jQuery(this).siblings(‘.custom_upload_image’); preview = jQuery(this).siblings(‘.custom_preview_image’); // Create the media frame. file_frame = wp.media.frames.file_frame = wp.media({ multiple: false // Set … Read more
Got this working: Added html += ”; html += ‘<li>’; html += ‘<a href=”‘ + entry.link + ‘”>’; html += ‘<div class=”entry”>’ + entry.title + ‘</div>’ ; html += ‘<div class=”entry”>’ + entry.author + ‘</div>’ ; html += ‘<div class=”entry”>’ + entry.publishedDate + ‘</div>’; html += ‘<div class=”entry”>’ + entry.contentSnippet + ‘</div>’; html += ‘</a>’; … Read more
Don’t use SQL to retrieve values from the option table, use the options API. In addition to avoiding using wrong table names (as was pointed out in the comments) you will most likely get better performance.
Try something like this: $posts = $query->get_posts(); foreach($posts as $p){ $thumb_id = get_post_thumbnail_id($p->ID); $src = wp_get_attachment_image_src($thumb_id, ‘image_size’); $url = $src ? $src[0] : false; $p->image_url = $url; } $json = json_encode($posts); Now you can echo out $json into your JS var. You will find the image url string in the key image_url of your json … Read more
It is possible and there are a number of ways to go about doing this, all of them requiring that you can write code or find someone willing to write it for you. One option would be to send your content via ajax to admin-ajax.php along with any wanted authentication tokens … and then listen … Read more