Unanswered Questions
2,538 questions with no upvoted or accepted answers
3
votes
1
answer
2k
views
How to Use JSON With AJAX?
I've defined a PHP callback function to handle the communication between server-side and client-side:
function json_render_modal_body() {
check_ajax_referer( THEME_PREFIX . '-modals', 'nonce' );
...
3
votes
0
answers
2k
views
Updating users_can_register option?
I have a custom setting page, where i have a radio to Enable or Disable Registration then try to update the wpoption (users_can_register).
Screenshot:
I've tried both true/false & 1/0 but it ...
3
votes
1
answer
2k
views
Shortcodes not working in an AJAX call
I am using AJAX to load next set of posts on homepage. The posts load fine but the shortcodes are not rendered. I am trying to use the do_shortcode function on the content the ajax call fetches (...
3
votes
2
answers
406
views
Calling shortcode in wp_localize_script strips result
I am working on adding some functionality on a Wordpress plugin which after a certain click needs to call on some shortcode through ajax.
What I first attempted was to call the shortcode inside of ...
3
votes
0
answers
39
views
Date/time limitation of posts where function must be executed
I have this piece of function in my functions.php file:
function user_content_replace($content) {
$sentences_per_paragraph = 3; // settings
$pattern = '~(?<=[.?!…])\s+~'; // some punctuation and ...
3
votes
1
answer
180
views
Function to Download External Images to My Site
I display images on my site from other sites. The URL is saved in a custom field named couv.
I would like to download these pictures on to my site and create a new custom field with the new value ...
3
votes
0
answers
5k
views
Force update all posts in custom post type, no content changes
I have imported data from a custom post type that has location data for a map plugin (Progress Map). I have about 500+ posts each with different location data. For some reason the location data isn't ...
3
votes
0
answers
182
views
WP REST API route request explain
Maybe can someone explain or show additional info about "WP REST API route request" from beginning to the end.
Main questions, how handle this request in most earlier stage. For example for ajax ...
3
votes
0
answers
1k
views
Setting TinyMCE Content in wp_editor
I am currently coding on front-end editing in wordpress. The outcome should be evernote-like editing using wordpress posts.
The Wordpress database stores markup without paragraphs and adds them on ...
3
votes
0
answers
325
views
Cannot update my options using wp_ajax
I have implemented wp_ajax in on my options page but the value of my options are not getting saved or updated. Here is my form:
public function email_settings_form(){
// Set class property
$...
3
votes
1
answer
1k
views
How to disable drag-and-drop upload function in Media Library?
Does any one knows a valid/standard way to disable drag and upload when accessing the media library in the admin area? In order to make this sense to you, I'm building a multisite and user of sub-site ...
3
votes
0
answers
701
views
Making a follow button, Ajax not talking to php
I'm trying to make a user follow button using AJAX, but for some reason my AJAX isn't talking to my jk_user_follow function and setting the wp_set_object_terms.
PHP
function register_user_taxonomy(){...
3
votes
2
answers
5k
views
add a function to submit options.php
I have a form which does
<form method="post" action="options.php">
.........
<input type="submit" class="button-primary" value="<?php _e( 'Save changes', 'bsp_style_settings' ); ?>" /&...
3
votes
0
answers
1k
views
CPU usage: AJAX and Heartbeat API on admin pages
My (shared) web host recently sent me this:
"Our server monitoring systems keep indicating high server load persistently maintained by your website (...). Most of the hits are to the /www/www/wp-...
3
votes
1
answer
2k
views
Custom wp_trim_words() function not trimming right
I have this custom wp_trim_words() function set to give me excerpts of only 20 words, and for the most part, it works fine. Except for some reason, on posts that contain lists, it outputs way more ...