maheshwaghmare
  • Member for 7 years, 6 months
  • Last seen this week
2 answers
1 votes
906 views
Still Another update is currently in progress by updating WordPress 5.3
0 votes

In WordPress there are two update locks: core_updater auto_updater So, you can fix this issue by deleting the update locks. Use below code to delete the lock's: delete_option( 'core_updater.lock' )...

View answer
7 answers
96 votes
66k views
Get rid of Another update is currently in progress
0 votes

In WordPress there are two update locks: core_updater auto_updater So, you can fix this by deleting the update locks. Use below code to delete the lock's: delete_option( 'core_updater.lock' ); ...

View answer
2 answers
0 votes
185 views
WP CLI allowed fields?
0 votes

Right, I think you have not see example section or the example section is available now. If you want to display only one field then you can use --field parameter. E.g wp post list --field=ID And ...

View answer
3 answers
1 votes
2k views
WP API: Get posts excluding those with a tag or category name
0 votes

This is an old question but I think for now the solution exists. We can use the tags_exclude=<tag-id> to execlude specifix tags.

View answer
2 answers
0 votes
189 views
How To Post WordPress Custom Post Types to Twitter via IFTTT
0 votes

This is the off topic question. But the answer is yes it is possible. In IFTTT we can use the Feed applet like "Feed to Tweet". So, Just create the the Feed applet with your custom post type feed ...

View answer
5 answers
22 votes
1k views
How-to: push a GitHub repo to the wordpress plugin servers
1 votes

The question was old but now the solution is now available with GitHub actions. Recently GitHub added Github Actions the automated workflow for the GitHub repository. And the well known company 10up ...

View answer
1 answers
-1 votes
1k views
Astra Site is not importing
0 votes

This is not a right place to ask the theme related questions. I'm developer of Astra. So, I recommend you to ask all your questions at https://wpastra.com/support/

View answer
1 answers
0 votes
344 views
How to set meta_query if get_post_meta returns nested array for that key?
0 votes

You have miss the last parameter from get_post_meta(). Try below code: $literature = get_post_meta(get_the_ID(), 'popis_literature', true); It gives you array of IDs. E.g. array (size=2) 0 => ...

View answer
3 answers
17 votes
28k views
How to do a meta query using REST-API in WordPress 4.7+?
20 votes

Use filter rest_{CUSTOM_POST_TYPE}_query to add the post meta support in WP Rest API for any post type. Check the Gist search post by post meta with rest API. How to use? http://example.org/wp-json/...

View answer
1 answers
2 votes
1k views
Create plugin that works in background
5 votes

You need to use WP Background Processing which fire off non-blocking asynchronous requests. WooCommerce also use this for background processing. Check the file /includes/libraries/wp-background-...

View answer
2 answers
3 votes
6k views
wordpress wp-json prefix issue
2 votes

You need to set the permalink structure of your website. Goto Settings > Permalink. Remove index.php from the Custom Structure. Click on Save Changes. It re-generate your permalink structure. And ...

View answer
3 answers
5 votes
30k views
Hook 'wp_enqueue_scripts' priority has no effect
5 votes

I know it's too late. But, Now, It works as expected. add_action has 3'rd arguments which are the priority. Below, I have enqueued the scripts with priorities 10, 12 and 14. So, It enqueues the ...

View answer
1 answers
0 votes
329 views
How to add an image below the header on homepage
0 votes

You can use the hook astra_content_before to add the image to the content before. Eg. add_action( 'astra_content_before', 'astra_child_theme_image_before_content' ); function ...

View answer
6 answers
12 votes
31k views
Check if Post Title exists, Insert post if doesn't, Add Incremental # to Meta if does
2 votes

@Tim Hallman nice answer. Use the function post_exists() to check post exist or not. More details visit https://developer.wordpress.org/reference/

View answer
3 answers
2 votes
823 views
How do I get slug of all active plugins programmatically?
Accepted answer
1 votes

Use option active_plugins to get all plugin init files. e.g. $current = get_option( 'active_plugins', array() ); // print_r( $current ); Here, htmlpress is the plugin slug.

View answer
4 answers
58 votes
34k views
Difference Between Filter and Action Hooks?
6 votes

In simple word's. Actions are those PHP functions which execute the output. Filters are those PHP functions which return the output. Updated: We can extend any plugin which use the actions ...

View answer
1 answers
0 votes
150 views
Customise standard lists within my shortcode
0 votes

IMO you need to create individual shortcodes for UL, OL and LI to make it sample. Shortcode for UL. function shortcode_ul( $atts , $content = null ) { return '<ul>' . do_shortcode( $...

View answer
3 answers
-1 votes
5k views
Using $variable in shortcode
-2 votes

You have missing shortcode_atts and passing arguments in a shortcode. E.g function shortcodevariable( $atts ){ $data = shortcode_atts( array( 'attribute-1' =&...

View answer
1 answers
-1 votes
456 views
Load Meta box value into div AJAX
Accepted answer
0 votes

Add data attribute data-post-id for the post id. Eg. HTML: <ul> <li><button class="play_next" data-meta-key="url-1" data-post-id="<?php the_ID(); ?>">Video 1</button&...

View answer
2 answers
1 votes
149 views
How to remove scripts/style added to customize_controls_enqueue_scripts hook by current active theme
Accepted answer
2 votes

You can use the global $wp_scripts and global $wp_styles; to get all registerd scripts and styles. Eg. All Scripts // All Scripts global $wp_scripts; $all_scripts = array(); foreach( $wp_scripts-&...

View answer
2 answers
0 votes
33 views
Why the css in twenteenfourteen-child theme take no effect?
Accepted answer
1 votes

You need to use CSS selector .hentry instead of article. Read more about CSS specificity.

View answer
1 answers
0 votes
482 views
How add custom text under comment form
0 votes

You can modify the comment form. WordPress provides various hooks. See comment_form(). Actions comment_form_comments_closed comment_form_before comment_form_must_log_in_after comment_form_top ...

View answer
2 answers
3 votes
1k views
how to add custom user capabilities using add_user_meta or something else?
0 votes

That's right the s:23 is serialized data. WordPress automatically store the data in serialized format. Also, To set the user capabilities use function add_cap() instead of updating the user meta. For ...

View answer
1 answers
2 votes
560 views
Is it possible to nest the JSON result of Wordpress REST API?
0 votes

Use below code snippet function video_get_post_meta($object, $field_name, $request) {    return array( 'video' => array( ‘length’ => get_post_meta($object['id'], ‘...

View answer
1 answers
0 votes
638 views
Soflyy WP All Import Custom File Download Issue
0 votes

Instead of custom curl HTTP request I'll recommend you to use the wp_remote_post() or wp_remote_get() which internally call the HTTP request and handle all possible errors. Also use download_url() ...

View answer
5 answers
3 votes
18k views
How to escape html code with html allowed
1 votes

1. Escaping Escaping Attribute <label for="<?php esc_attr( $tid ); ?>"> Escaping HTML <label ..><?php esc_html( 'Text' ); ?></label> 2. Translation and Escape Note: ...

View answer
2 answers
0 votes
2k views
I can't add CSS with functions.php
0 votes

Use wp_enqueue_style( 'theme-slug', get_stylesheet_uri() ); Building a WordPress theme always use unique theme prefix for everything including function, class, constants, option etc. Also, read ...

View answer
3 answers
1 votes
1k views
Undefined functions on the server
0 votes

You need to use Template: shapely instead of Template: Shapely E.g. /* Theme Name: Shapely Child Template: shapely Version: 1.1.7 Author: colorlib Author URI: LINK */ Template is the directory/...

View answer
1 answers
-1 votes
1k views
How to use esc_attr__() function properly to translate a variable that contains string?
Accepted answer
1 votes

If you have static text with dynamic content then you can use. printf( esc_attr___('static text goes here with %s', 'text-domain' ), $title ); If you have only $title then no need to translate it. ...

View answer
3 answers
0 votes
78 views
Beginner's question about shortcodes
Accepted answer
0 votes

It looks like theme issue. Switch to default WordPress theme and check it. I have tested it on WordPress Twenty Seventeen theme. For testing: 1) Add below code in theme functions.php // Sample ...

View answer