Pods – pods_universel

function shortcode_pods_universel($atts) { // 1. Définition des arguments $args = shortcode_atts(array( ‘name’ => ”, // Nom de votre page d’options Pods ‘template’ => ”, // Nom du template de mise en page ‘futur’ => ”, // Nom du champ date…Continue reading

Activer automatiquement WooCommerce et les paiements (copy) (copy)

add_action(‘init’, function () { $extensions = [ ‘woocommerce/woocommerce.php’, ‘woo-payments/woocommerce-payments.php’, ‘woocommerce-paypal-payments/woocommerce-paypal-payments.php’, ‘woocommerce-tax/woocommerce-tax.php’, ‘google-listings-and-ads/google-listings-and-ads.php’, // si installé ‘kliken-marketing/kliken-marketing.php’, // marketing Woo ]; foreach ($extensions as $extension) { if (!is_plugin_active($extension) && file_exists(WP_PLUGIN_DIR . ‘/’ . $extension)) { activate_plugin($extension); } } });Continue reading

Activer automatiquement WooCommerce et les paiements (copy)

add_action(‘init’, function () { $extensions = [ ‘woocommerce/woocommerce.php’, ‘woo-payments/woocommerce-payments.php’, ‘woocommerce-paypal-payments/woocommerce-paypal-payments.php’, ‘woocommerce-tax/woocommerce-tax.php’, ‘google-listings-and-ads/google-listings-and-ads.php’, // si installé ‘kliken-marketing/kliken-marketing.php’, // marketing Woo ]; foreach ($extensions as $extension) { if (!is_plugin_active($extension) && file_exists(WP_PLUGIN_DIR . ‘/’ . $extension)) { activate_plugin($extension); } } });Continue reading

Set a Minimum Word Count for Posts (copy)

/** * Prevent publishing posts under a minimum number of words. * * @param int $post_id The id of the post. * @param WP_Post $post The post object. * * @return void */ function wpcode_snippet_publish_min_words( $post_id, $post ) { //…Continue reading

WP · Disable Author Pages

if ( ! function_exists(‘mx_custom_disable_author_page’)) { function mx_custom_disable_author_page() { global $wp_query; if (is_author()) { wp_redirect(get_option(‘home’), 302); exit; } } add_action(‘template_redirect’, ‘mx_custom_disable_author_page’); }Continue reading

dynamic temp directory

add_filter(‘dynamic_ooo_mpdf_args’, function($args) { // Set your custom path here $args[‘tempDir’] = WP_CONTENT_DIR . ‘/var/www/vhosts-ebs/tmp’; return $args; });Continue reading

Completely Disable Comments (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading