Skip to main content

Unanswered Questions

1,652 questions with no upvoted or accepted answers
8 votes
1 answer
666 views

static variable loop not working in Wordpress

I have a function in my wordpress theme that deletes the first embedded video in a video post. See code below. This is in the functions.php file. /* - function that hides first video in post content -...
6 votes
0 answers
248 views

Customize WordPress Media Manager - Media Window

Im trying to customize the wordpress media manager "add media" window to get it as simple as possible to use. So i want to disable/ hide the following fields/ functions because i dont need some or ...
4 votes
1 answer
5k views

AJAX handler throws 400 (Bad request) - why?

I am trying to apply a "Load more posts" function to a post loop, but I am dealing with a 400 Bad request, when admin-ajax.php is referred to. The reference I used is this - https://rudrastyh.com/...
4 votes
4 answers
334 views

What is the Difference between directly call a function and call a function using add_action?

What is the difference between following two codes? (Directly call a function and call a function using add_action) function pp_submit__link_form(){ if(isset( $_POST['action']) && $...
4 votes
0 answers
91 views

my function doesn't return my post from today

I'm using gravity form to create some custom post type - as events. Everything is working great, There is some date field to setup the event from x to y date. ALl of this working great. However, I ...
3 votes
3 answers
116 views

Is it possible to automatically set the publication time to 8am on new posts?

This might be kind of funky to pull off, but does anyone have any ideas on how I could automatically set the time to 8am on any newly created post drafts? In both the Classic Editor and the Block ...
3 votes
1 answer
104 views

Changing a function in function.php to a shortcode - for listing categories of only a certain post type

I'm trying to create a shortcode that can display a list of categories. However, it should: First, limit the results to a specific post type (based on shortcode usage) then check to see if category ...
3 votes
0 answers
388 views

Remove elementor header and display default theme header

I am using Elementor pro and I am using Tabor wordpress theme(Here theme link: https://themebeans.com/themes/tabor/). I create custom footer within elementor pro and I noticed that the default theme ...
3 votes
0 answers
1k views

Is it possible to intercept all ajax requests and get the parameters and the returns?

Is there any hook that always goes through it, where I can see all the requests, and also the returns after the "action" that is executed? I need to intercept all requests, including requests from ...
3 votes
0 answers
78 views

How to find out what blocks are added by a plugin

I am creating a plugin, which adds a number of blocks defined by JS/PHP as per Gutenberg documentation. I want to display these block names on an admin page. Is there a hook or function I can use ...
3 votes
0 answers
57 views

Get widget settings function?

I am using this to find if a new widget has been added or removed from my site: serialize(retrieve_widgets()); Works great for added or removed widgets. But it doesn't detect if a widget setting has ...
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
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 ...

15 30 50 per page
1
2 3 4 5
111