This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Disable Gutenberg globally | |
*/ | |
add_filter( 'use_block_editor_for_post', '__return_false' ); | |
/* | |
* Disable Gutenberg for specific post types | |
*/ | |
function disable_block_editor_cpt( $use_block_editor, $post_type ){ | |
if( 'page' == $post_type || 'post' == $post_type){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'block_editor_settings', function ($settings){ | |
$settings['autosaveInterval'] = 60; | |
return $settings; | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Supprimer les scripts et css de la page d'accueil | |
function remove_scripts_home() { | |
if (is_home()){ | |
wp_dequeue_script( 'script_handle' ); | |
wp_deregister_script( 'script_handle' ); | |
} | |
} | |
add_action('wp_print_scripts', 'remove_scripts_home', 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// have to add that opening tag to get syntax highlighting... ¯\_(ツ)_/¯ | |
/** | |
* Prevent update notification for plugin | |
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/ | |
* Place in theme functions.php or at bottom of wp-config.php | |
*/ | |
function disable_plugin_updates( $value ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Generate excerpts from ACF field values if there is no post content | |
* @param string $post_excerpt The post excerpt. | |
* @param WP_Post $post Post object. | |
*/ | |
function custom_acf_excerpt( $post_excerpt, $post ){ | |
// Return the existing excerpt if it's not empty | |
if( !empty(trim($post_excerpt)) ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to parse Gutenberg content for headless WordPress | |
https://kinsta.com/blog/headless-wordpress-gutenberg/ | |
Adding wrapper to Gutenberg’s Table block | |
https://helloadmin.com/adding-wrapper-to-gutenbergs-table-block/ | |
Display specific Gutenberg blocks of a post outside of the post content in the theme | |
https://florianbrinkmann.com/en/display-specific-gutenberg-blocks-of-a-post-outside-of-the-post-content-in-the-theme-5620/ | |
Modifying the Markup of a Core Block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Blank Page Builder Template | |
*/ | |
/** Exit if accessed directly */ | |
if ( ! defined( 'ABSPATH' ) ) exit( 'Not Today' ); | |
add_filter( 'body_class', 'js_add_landing_body_class' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dirs = array_filter(glob('*'), 'is_dir'); | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>all links</title> | |
<style> | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLogoutUrl($redirectUrl = ''){ | |
if(!$redirectUrl) $redirectUrl = site_url(); | |
$return = str_replace("&", '&', wp_logout_url($redirectUrl)); | |
return $return; | |
} | |
/** | |
* Bypass logout confirmation on nonce verification failure | |
*/ | |
function logout_without_confirmation($action, $result){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Wordpress Ajax Login Form | |
// Source: http://www.sutanaryan.com/custom-user-login-signin-using-ajax-wordpress/ | |
//html | |
<div class="userLogin"> | |
<?php | |
// check if the user already login |