What happens when two plugins have the same 3rd party class included into them?

I went ahead and namespaced Stripe. Everything worked just great. And now I don’t have to worry about any one else’s Stripe library messing up my stuff. Original: namespace Stripe; New: namespace MyRadNamespace\Stripe; If anyone is interested in seeing how it’s done, feel free to browse my repo: https://github.com/Spokane-Wordpress-Development/Freezy-Stripe Cheers!

How to pass parameters (data) from plugin PHP to React

WordPress has a function, wp_localize_script() that can do this. You create an array of values that you want to access in your JavaScript file and then inject it as an object. You would modify your enqueue function like this: function include_react_files() { wp_enqueue_style( ‘prefix-style’, plugins_url(‘css/main.ae114d0c.css’, __FILE__) ); // add the JS file to the footer … Read more

How do I email a new page password to somebody every month?

First of all, you should wrap your cron into a method: function cronjob_once_every_month() { // Our custom cron interval: $schedules[‘every_month’] = array( ‘interval’ => 1 * MONTH_IN_SECONDS, ‘display’ => ‘Once every Month’ ); } a) set up an automated email Then you should schedule an action: if ( ! wp_next_scheduled( ‘cronjob_once_every_month’ ) ) { wp_schedule_event( … Read more

why plugins are loaded prior to pluggables

Directly from source for pluggable.php: <?php /** * These functions can be replaced via plugins. If plugins do not redefine these * functions, then these will be used instead. * * @package WordPress */ ?> So, there’s your answer, the functions in pluggable.php are intended to be overridden by Plugins. Re: load order: See this … Read more

Handling jQuery Component Collision

My suggestion would be to use a mix of code isolation in an anonymous function and checking if jquery is already present. Here’s an example: (function() { var jQuery; // your jquery variable // check if jquery is present and if it has the version you want if (window.jQuery === undefined || window.jQuery.fn.jquery !== ‘1.8.3’) … Read more

Searching users with WP_List_Table plugin

Brian is correct. By changing the form to use get instead of post and then using $_REQUEST to fetch it should work, and is for me. // Fetch, prepare, sort, and filter our data. if( isset( $_REQUEST [“s”] ) ){ // Form that displays the table and also contains the search_box() <form id=”table-class-filter” method=”get” class=”table-class-admin-form”>

Force Plugin to English Translation

What’s the plugin? Is it using custom translations in mo/po files? Is there an admin interface which allows you to set the plugin locale? There is a generic filter which you might be able to add to the plugin code to set the language which might look something like the following (obviously set the language … Read more

How to create extendable wordpress plugins

The following: Use hooks and filters to power things. Pass args into a filter before doing things with them, pass return values to filters before returning them, etc, hooks and filters everywhere namespace everything, tomjn_twittercount is a better function name than twittercount Practice good common sense generic programming, e.g. use dependency injection, use proper OOP … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)