New answers tagged

0

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 do that as follows: function filter_plugin_updates(...


2

No, you don't need to escape hardcoded values. As I understand it, if the URL doesn't have an input via admin, it should be okay. Not necessarily. There's many more potential sources of potentially malicious (or just accidentally broken) output that need to be accounted for, such as: Translations. Query strings ($_GET) Cookies. WordPress filters. So ...


1

If you are ok to use a plugin for this, I think WP CLient Reports is exactly what you are after. It can create periodical reports for you about plugin, theme or core updates, as well as post/pages updates, etc.


0

This might not be a direct answer to this question. However, I've seen multiple workarounds for dealing with this issue ( flush_rewrite_rules() being executed first ). A workaround was to set a flag ( using add_option() ) and then hook to the init, and flush the rewrite rules if the flag exists. A bit nasty. In case whatever you want to register can be ...


0

Yes, you need to search a bit for the build steps. You want Getting Started with Code Contribution: After installing Node, you can build Gutenberg by running the following from within the cloned repository: npm ci npm run build Note: The install scripts require Python to be installed and in the path of the local system. This might be installed by default ...


0

Use Array For Statice Method:- Example 1:- add_action('init', array('Say', 'Hello')); class Say{ public static function Hello(){ echo 34; } } Example 2:- add_action('init', Say::Hello());


0

That script looks like it is coming from some plugin. You'll need to dig into the plugin files to see how the script is added. If it is enqueued, then you can use wp_dequeue_script(). If it is added with an action (e.g. function that echoes the tag to wp_head), then use remove_action().


1

I am from the Tutor LMS team. Please use the Help button our website to reach us. It is located at the bottom right corner. We will need to check your website configuration to find out and resolve the problem :)


0

I have used User role Editor in the past to accomplish custom role permissions. It worked well for my use case allowing me to assign permissions to groups or individuals as need be. Compatibility may be an issue with certain plugins but I didn't experience any issues.


0

This is what worked as woocommerce_get_term_meta is deprecated. And thumbnail_id doesn't exist anymore: <?php $taxonomyName = "product_tag"; $terms = get_terms(array('taxonomy' => 'product_tag', 'hide_empty' => false)); ?> <?php foreach ( $terms as $term ) { ?> <div class="item" > <?php $...


2

Actually starting since WordPress 5.6, there is such an API. Check out this blog post from November 2020 talking about the REST API Batch Framework.


0

Have a look at the source code of these plugins. Look for code bloat - if it's a simple plugin it should be simple code. Look for included SDKs and libraries that may not be needed, look for the number of files it's enqueuing - and obviously the last and easiest one.... Run it on dev - check the load time differences with and without these plugins loaded.


1

This is something that a lot of membership plugins can do, e.g. MemberPress, Restrict Content Pro, or similar membership or user group plugins. Which is best for you depends on your particular setup. From what you're describing, you only need basic membership/group functionality (without features like payments), so I'd suggest going with a basic, free plugin ...


1

After discussing this with the WP plugin review team. The precommit hook that is being run on the server does not yet support PHP8. Removing any dependencies on the PHP80 polyfill code in vendor packages should fix this until they upgrade the precommit hooks to support PHP8. Just noting on the discussion above related to symfony/polyfill-mbstring the ...


0

It is possible to do just that by using blocks.registerBlockType filter. For a detailed explanation, refer to this article by Jim Schofield However, instead of calling default edit and save functions wrapped in custom code (like in the article), do not call them, just provide your own code.


0

Just adding in some additional api requests with params, due to the minimal documentation available. By tag "gdpr", 1 result per page, request page nr 1 and browse by popularity: https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[tag]=gdpr&request[per_page]=1&request[page]=1&request[broswe]=popular By search ...


1

WordPress 3.4+ Method: Just define this define( 'SHORTINIT', true ); before you call wp-load.php


1

First, you'll have to get shortcode parameter(s). Change function's declaration to: function display_user_roles( $atts ) { Your shortcode will be either [hw_display_users] or [hw_display_users role="roletopass"]. The first (no parameter) will use role specified in $args array. Second will replace $args->role with parameter passed. Add if ( !...


0

As far as I can see, you can run the action elsewhere on a different template or via a shortcode using do_action( 'admin_notices' ); however the only way to remove them from the default area (as far as I can see) is to hide them via CSS. Below is a helpful code to remove all admin notices for all other users except the administrator: if( ! is_super_admin() ) ...


0

I'm not sure this has already been answered as to what you are after? Please follow this link and read the provided answer. Hopefully that helps!


1

This is the snippet I got from Modula team to reinitialize the plugin: var modulaGalleries = jQuery('.modula.modula-gallery'); jQuery.each(modulaGalleries, function () { var modulaID = jQuery(this).attr('id'), modulaSettings = jQuery(this).data('config'); jQuery('#' + modulaID).modulaGallery(modulaSettings); }); ...


0

Here's the answer for you question about WordPress Multisite plugin issue, To install a plugin on a WordPress multisite, you need to visit My Sites » Network Admin » Plugins. enter link description here


1

Without looking into the plugin, it looks like you could first remove the default placement using: remove_filter('the_content', 'wpatt_content_filter'); and then call the list function somewhere in your template like this: echo wpatt_content_filter(''); (the remove_filter would be in functions.php or somewhere near the top of your template, ie before ...


1

This is not possible using the standard comment form. Comments in WordPress are built around post IDs, and are coded with this assumption down to the foundations. Even post statuses that can receive comments are hardcoded at multiple levels. The comment form itself knows where to go afterwards via the comment_post_ID input. You will not be able to repurpose ...


1

I can only comment on this on a general level as I'm not familiar with the plugin you're using. (This might also not be the best place to ask this kind of plugin related questions as 3rd party plugins are currently considered off-topic here on WPSE.) Majority of this kind of plugins I've encountered have some kind of javascript (or jQuery), which is executed ...


2

/* Add meta boxs for particular pages */ function meta_set_particular_page() { $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID']; $current_page_title = get_the_title($post_id); if ($current_page_title == 'home') { add_meta_box('Home_page', 'Home Name:', 'only_home', 'page', 'side', 'core'); } if($current_page_title == '...


0

Check out different plugins like "User Submitted Posts", "WP User Frontend", "ACF Frontend" or similar.


1

**check via post ID for a specific page or post** $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; if ($post_id == '84') { add_meta_box(); } **OR check via template page name just as below** $template_file = get_post_meta($post_id,'_wp_page_template',TRUE); if ($template_file == 'home.php') { add_meta_box(); }


0

So, it turns out I'm an idiot. For some reason, Aptana changed what permissions files got uploaded with. I fixed that, and logged into the server to update the permissions on the files already uploaded, and it worked fine.


0

I was migrating to Synology NAS. Permalinks need .httaccess but this file is not used in Nginx server backend. So be sure that you have Apache server as backend when you are setting up your virtual host in the Webstation. WpAdmin will return you a success when you save permalinks but in fact nothing happen. Change to Appache and you are fine.


0

WordPress Hooks Method If the form is created with a plugin (like Contact Form 7 or Gravity Forms) you can use the available hooks: CF7: wpcf7_before_send_mail GF: gform_after_submission This should cover the majority of WordPress Websites. On both hooks you can access the transmitted form fields and send them to your own script. jQuery Method If you simply ...


0

I'm using Duplicator PRO (ver 4.0.2) to migrate Oxygen builder (ver. 3.7.1) created websites. You have to switch to advanced mode in installer and in last step of migration "search and replace" old links to new links. In Wordpress dashboard Settings -> Permalinks, scrool down and click Save Changes Oxygen -> Settings -> Security click ...


1

REST or anything RESTful is a generally adhered to standard of getting things done via API. It also has the capability of documenting itself. Now I had expected to write an answer here about how it's not a great idea to allow endpoints to update or modify any of your codebase but I see it seems the good folks at Automattic have thought it ok and they know ...


1

Now I have learned that the way I change the database is not safe regarding SQL injection. So I wonder where/how did you learn that? And other than that you should check if those two POST variables are actually set, your toggle_status() code looks fine to me, and $wpdb->update() is an easy way to update a record in the database in WordPress, so you ...


Top 50 recent answers are included