//interdire l'accès aux non admins
add_action( 'current_screen', 'redirect_non_authorized_user' );
function redirect_non_authorized_user() {
// Si t'es pas admin, tu vires
if ( is_user_logged_in() && ! current_user_can( 'manage_options' ) ) {
wp_redirect( home_url() ); // on les redirige vers la home
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
| function popunder(url, width, height, name) { | |
| // On désactive le popunder sur les sites mobiles | |
| if (typeof window.DetectMobileLong == 'function' && typeof window.DetectTierTablet == 'function') { | |
| if(DetectMobileLong() || DetectTierTablet() || document.location.href.match(/test_mobile/)) | |
| return false; | |
| } | |
| // On effectue un traitement différent pour Chrome | |
| if(navigator.userAgent.match('Chrome')) { | |
| // Ouverture de la nouvelle page (Simulation d'un Shift+Clic) |
Permet de pouvoir la traduire dans le BO
Dans functions.php faire pour chaque chaine
Il faut tester l'existance de la functions ! Otherwise your site will badly break with a fatal error at next Polylang update (as WordPress deletes the plugin when updtating it).
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 | |
| $posts = get_posts(array( | |
| 'post_type' => 'page', | |
| 'post_status' => 'publish', | |
| 'orderby' => 'menu_order', | |
| 'numberposts' => 999999 | |
| )); | |
| foreach ( $posts as $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
| var userId = 1282926470; | |
| var clientId = 'b2c4628sdsdda9900914746bb80f0c4523ef7fa6'; | |
| var myurl = "https://api.instagram.com/v1/users/"+userId+"/media/recent/?client_id="+clientId; | |
| $.ajax({ | |
| dataType: "jsonp", // Pour eviter de prbs avec le cross domaine on met jsonp | |
| url: myurl , | |
| }).done(function ( data ) { |
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 ( is_user_logged_in() && ! current_user_can( 'manage_options' ) ) { | |
| add_filter('show_admin_bar','__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 | |
| global $woocommerce; | |
| $args = array( | |
| 'post_type' => 'shop_order', | |
| 'post_status' => 'publish', | |
| 'posts_per_page' => -1, | |
| 'tax_query' => array( | |
| array( | |
| 'taxonomy' => 'shop_order_status', |
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
| zip -r mes-logs.zip other_vhosts_access.log* | |
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 | |
| promo_product(get_field('gift-Product-ID','option'),2,18); | |
| ?> |