This file contains hidden or 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 | |
add_filter('rocket_htaccess_marker', '__return_false'); |
This file contains hidden or 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 | |
add_filter( 'wp', '__deactivate_rocket_lazyload_if_admin' ); | |
function __deactivate_rocket_lazyload_if_admin() | |
{ | |
if( is_admin() ) { | |
add_filter( 'do_rocket_lazyload', '__return_false' ); | |
} | |
} |
This file contains hidden or 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 | |
function clear_remote_wp( $ID, $post ) { | |
wp_remote_get('http://defimedia.info/custom-clear.php?id='.$ID); | |
} | |
add_action( 'publish_post', 'clear_remote_wp', 10, 2 ); |
This file contains hidden or 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 | |
require ('wp-load.php'); | |
$id_post = esc_html($_GET['id_post']); | |
rocket_clean_post($id_post); |
This file contains hidden or 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 | |
add_action( 'wp_rocket_loaded', 'no_purge' ); | |
function no_purge() { | |
remove_action( 'user_register' , 'rocket_clean_domain', 10 ); | |
remove_action( 'profile_update' , 'rocket_clean_domain' ); | |
etc... | |
} |
This file contains hidden or 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
Exercice #1 | |
- Create 3 books associated arrays which sould contains : the name of the book, the author, and a rating (1,2,3,4 or 5) | |
- Create a $books array wich contains your 3 books | |
- Display the name of all the books |
This file contains hidden or 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 | |
/** | |
* Proper way to enqueue scripts and styles | |
*/ | |
function __rocket_theme_scripts_to_enqueue() { | |
wp_enqueue_script( 'pkgd', get_stylesheet_directory_uri() . '/js/masonry.pkgd.min.js', array(), '1.0.0', false ); | |
wp_enqueue_script( 'flexslider', get_stylesheet_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'), '1.0.0', false ); | |
wp_enqueue_script( 'main', get_stylesheet_directory_uri() . '/js/main.js', array(), '1.0.0', false ); | |
This file contains hidden or 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
import serial, httplib, uuid | |
arduino = serial.Serial('/dev/ttyACM0', 9600) | |
while True: | |
data = arduino.readline() | |
print data | |
#conn = httplib.HTTPConnection("ronan-chardonneau.fr") | |
print "/piwik/piwik.php?idsite=1&rec=1&action_name=Entree-magasin&uid="+str(uuid.uuid4())+"&e_c=entree-magasin&e_a=passage&e_n=taille&e_v="+str(data) | |
#conn.request("HEAD","/piwik/piwik.php?idsite=1&rec=1&action_name=Entree-magasin&uid="+str(uuid.uuid4())+"&e_c=entree-magasin&e_a=passage&e_n=taille&e_v="+str(data)) | |
#print conn.request |
This file contains hidden or 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 | |
if (isset( $_COOKIE[ 'WAEST_SSO_HASH'] ) ){ | |
define ('DONOTCACHEPAGE', true); | |
} |
This file contains hidden or 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 | |
if isset( $_COOKIE[ 'wordpress_logged_in_'] ){ | |
define ('WAEST_SSO_HASH', true); | |
} |