Unanswered Questions
2,027 questions with no upvoted or accepted answers
3
votes
0
answers
55
views
WordPress Rest API only returns content when posttype has editor capability
I am trying to request my post via the WordPress V2 Rest API in the backend. For whatever reason the post content is only returned when my custom post type has the editor support enabled. Is there a ...
3
votes
0
answers
386
views
WordPress Customizer Control with React
I am just doing a demo on the WordPress customizer API to edit the header with custom controls.
I have designed a custom control by extending WP_Customize_Control and Jquery to refresh/postMessage ...
3
votes
0
answers
118
views
How can I filter block registration based on post-type? (Block alignment settings)
I want to disable the .alignwide and .alignfull block alignment options (remove them from the editor UI) on the 'post' post-type only.
I have tried using this block registration filter to modify the '...
3
votes
0
answers
246
views
How to save a ToggleControl value in a meta field?
I registered a boolean meta field called _meta_restrict in a custom post type:
PHP:
function register_meta_fields() {
register_post_meta( 'custom_post_type', '_meta_restrict', array(
'...
3
votes
0
answers
397
views
When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
I am trying to extend the core/image block to add an option for a deferred image. I want to replace the src attribute of the image with an empty string and add the url as a data attribute to be loaded ...
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
1
answer
503
views
How do i define the location of a git push to WP Engine
Ive been using Gits version control system for local theme development on a Wordpress site. I decided to take advantage of WPEngine's git capabilities which has caused more frustration than not.
I ...
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
2
answers
1k
views
Cache Busting using htaccess Rewrite rule?
I am trying to follow this tutorial that says i can make a server to send a file like style.css if the requested file is style.15458888.css with a rewrite rule to be put inside the htaccess file.
...
3
votes
0
answers
2k
views
Add a theme via symlink
I want to keep my theme files separate from my WordPress install.
I’ve done that by symlinking the theme directory to the WordPress wp-content/themes directory.
Unfortunately, the theme won’t show up ...
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
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
2
answers
2k
views
What is better way to use Bootstrap inside admin panel?
I need to use Bootstrap CSS for better UI in wp-admin but if I enqueue the bootstrap.css, it's affecting the admin default UI by changing background colors, etc.
How can I use bootstrap.css inside wp-...
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 ...