Skip to main content

Unanswered Questions

2,559 questions with no upvoted or accepted answers
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
259 views

Gutenberg - What is the best way to save/update post meta?

What would be the best way in Gutenberg to save/update post meta (not from a block). I can't find an API for it. I was thinking of doing some ajax in componentDidMount using wp.ajax.post Any advice ...
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
3 answers
3k views

Relative path instead of absolute for wp_enqueue_script

When you enqueue scripts or styles with the following: function themeslug_enqueue_style() { wp_enqueue_style( 'core', '/style.css', false ); } add_action( 'wp_enqueue_scripts', '...
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
1k views

preserve url parameters from affliliate sites

Please help, I am using a wp site as medium between e.g. a news site lets call it A and the actual site that e.g. sells a particular product lets call it B. A ---- medium site --- B news site ---- ...
3 votes
2 answers
3k views

Customizer Show/Hide Logo and Site Title

I've setup checkbox controls in my theme Customizer to show/hide the Logo and Site Title when they are checked/unchecked. By default, I want the Logo to display and the Site Title to be hidden. ...
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
0 answers
47 views

Script won't execute in the media manager

I'm trying to execute a jquery script on the click of a button in a custom tab of the media manager, but it does not seem to work. I have been told this might be due to the button not being loaded ...
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
629 views

Making a custom widget that includes a tinymce and works in Site Origin Page Builder

For a client I'm using Site Origins Page Builder plugin. It enables the client to make rich layouts for each page by dragging and dropping widgets. Site Origin widgets that require a WYSIWYG-editor ...
3 votes
0 answers
191 views

How to create a repeatable / reusable divs in the metabox?

I have a meta box: <?php function custom_meta_box_markup() { global $post; $meta_box_text = get_post_meta( $post->ID, 'meta-box-text', true ); $meta_box_text_day = get_post_meta( $...
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 ...

15 30 50 per page