Snippets Collections
<?php
 /*
 Plugin Name: Disable Smart Quotes
 Plugin URI:
 Description: Disable curly smart quotes in post content, comment and title.
 Version: 1.0
 Author: WebNots
 Author URI: https://www.webnots.com
 */
 remove_filter('the_content', 'wptexturize');
 remove_filter('comment_text', 'wptexturize');
 remove_filter('the_title', 'wptexturize');
 ?>
<?php

/**
 * Add required plugins to WDS_Required_Plugins.
 *
 * @param  array $required Array of required plugins in `plugin_dir/plugin_file.php` form.
 *
 * @return array           Modified array of required plugins.
 */
function wds_required_plugins_add( $required ) {

	$required = array_merge( $required, array(
		'jetpack/jetpack.php',
		'sample-plugin/sample-plugin.php',
	) );

	return $required;
}
add_filter( 'wds_required_plugins', 'wds_required_plugins_add' );

// for network activated plugins
// add_filter( 'wds_network_required_plugins', 'wds_required_plugins_add' );


/**
 * Modify the required-plugin label.
 *
 * @param  string  $label Label markup.
 *
 * @return string         (modified) label markup.
 */
function change_wds_required_plugins_text( $label ) {

	$label_text = __( 'Required Plugin for ACME', 'acme-prefix' );
	$label = sprintf( '<span style="color: #888">%s</span>', $label_text );

	return $label;
}
add_filter( 'wds_required_plugins_text', 'change_wds_required_plugins_text' );

// To hide required plugins
// add_filter( 'wds_required_plugins_remove_from_list', '__return_true' );

star

Thu Feb 17 2022 09:54:30 GMT+0000 (UTC) https://www.webnots.com/4-ways-to-disable-smart-or-curly-quotes-in-wordpress/

#wordpress #plugin
star

Mon Oct 25 2021 03:40:24 GMT+0000 (UTC) https://github.com/WebDevStudios/WDS-Required-Plugins

#wordpress #php #plugin

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension