Override WP Class Private Function

As @jacob suggest, you can add subscriber role into that array using add_filter . add below code in active theme’s functions.php file. add_filter( ‘wf_user_permission_roles’, ‘wf_user_permission_roles_callback’ ) ; function wf_user_permission_roles_callback( $roles ) { $roles[] = ‘subscriber’; return $roles; }

What is Stable Tag in WordPress plugin readme file

WordPress.org’s Plugin Directory works based on the information found in the field Stable Tag in the readme. When WordPress.org parses the readme.txt, the very first thing it does is to look at the readme.txt in the /trunk directory, where it reads the “Stable Tag” line. If the Stable Tag is missing, or is set to … Read more

Getting RGBA colour from gutenberg colourpicker

If you mean wp.components.ColorPicker which is based on react-color, then the tint object also contains a rgb property with an object of the RGBA value like {r: 51, g: 51, b: 51, a: 1}. So in your code, you can use: style={{ backgroundColor: `rgba(${tint.rgb.r}, ${tint.rgb.g}, ${tint.rgb.b}, ${tint.rgb.a})` }} And an easy trick to know all … Read more

Need Old Version of plugins

If you are looking for old versions of a plugin in the WordPress repository (like WooCommerce), you can go to the plugin’s page on WordPress.org/plugins, then look in the right column under the plugin’s Tags for the link to “Advanced View”. Click on that, then scroll all the way down and select from the dropdown … Read more

Randomize attachment IDs

For attachment posts, the following should do it, i.e. use the wp_insert_attachment_data hook along with get_post(): function my_random_post_id( $data, $postarr ) { // Runs if the post is being created and not updated. if ( empty( $postarr[‘ID’] ) ) { // Locate a yet-unused ID in the (wp_)posts table. do { // Based on the … Read more

WP_Query ordering numbers as letters

To evaluate a meta value as a number, use meta_value_num. Try: $args = array( “fields” => “ids”, “meta_key” => “jogador_oficial”, “meta_value” => true, “meta_query” => array( “relation” => “AND”, “query_one” => array( “key” => “quantidade_corretas” “orderby” => “meta_value_num”, “order” => “DESC” ), “query_two” => array( “key” => “tempo_total” “orderby” => “meta_value_num”, “order” => “ASC” ), … Read more

How to make a custom field as an editor in wordpress?

Naren, The actual set-up for the classic/TinyMCE editor is relatively straightforward, I have updated your wordpress_register_fields() function with the necessary lines. For wp_editor() to work you need to get the content if there’s any saved, id the field and then provide settings arguments. (https://developer.wordpress.org/reference/functions/wp_editor/) function wordpress_register_fields() { global $post; // Nonce field to validate form … Read more

Keep custom fix in a plugin

As @kero noted, your best option is to contact the developer and ask if they are open to including an appropriate hook – what you need is a filter to allow customization for the value of $allowed. However, barring that, one potential (albeit not perfect) solution is to ignore updates for the plugin. You can … Read more