How can I import a class privately into a plugin?

Use namespaces, but check the PHP version on the server side and deactivate the plugin with a useful error message if the requirements aren’t met. If you look at the official statistics, you can see how many installations are still running on outdated WordPress versions. But almost all new plugins require the latest WordPress version, … Read more

Disable Visible Edit Shortcuts in the Customizer

The simplest way to disable edit shortcuts without unwanted side effects is to no-op override the JS function that generates them in the first place. You can do this from PHP as follows: add_action( ‘wp_enqueue_scripts’, function () { $js=”wp.customize.selectiveRefresh.Partial.prototype.createEditShortcutForPlacement = function() {};”; wp_add_inline_script( ‘customize-selective-refresh’, $js ); } ); This will work for any theme.

Blocks: set a default value for a TextControl

Try setting the default value in your attributes instead of on the TextControl. registerBlockType( ‘cgb/a11ytable’, { title: ‘Accessible Table’, icon: ‘screenoptions’, category: ‘common’, attributes: { numCols: { type: ‘number’, default: 2 // Added default value } }, edit: (props) => { const { attributes: { numCols }, className, setAttributes } = props; return [ el( … Read more

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