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 | |
// ....genre.... | |
function get_unsub_page_url_in_current_language() { | |
$unsub_page_id = get_option( 'my_prefix_unsub_page_id', false ); | |
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 | |
class Get_Words { | |
public static $transient_name = 'awesome_words_compiled'; | |
public static $option_name = 'awesome_words_compiled'; | |
public static $repeater_name_left = 'awesome_words_repeater_left'; | |
public static $repeater_name_right = 'awesome_words_repeater_right'; | |
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 | |
$post_id = get_the_ID(); // ou whatever fonction pour avoir ton post ID | |
/* | |
* Les arrays sont très pratiques pour traverser des clés aussi | |
* | |
* Trouve les termes qui sont pareils dans les deux cas, | |
* on va concatener post_ ou live_ plus tard |
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 | |
$query_args = array( | |
'meta_query' => array( | |
// relation between time query and online query | |
'relation' => 'OR', | |
// time query | |
array( |
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
// no conflict-safe mode (passing $ as an alias into our inner closure) | |
( function ( $ ) { | |
function acfFieldToGroupBg() { | |
// cache all our instances of the grab-this element which will be what we work with | |
var $jsGrabThis = $( '.js-grab-this' ); | |
// none of them? why keep going. ABORT! |
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 | |
$query_object = new Wp_Query( array( | |
'showposts' => 5, | |
'post_type' => array( 'post' ), | |
'category_name' => 'videos', | |
'orderby' => 1, | |
) ); | |
// The Loop | |
if ( $query_object->have_posts() ) { |
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 | |
global $wpdb; | |
$postmeta_to_compile = 'some_field'; | |
$unique_values = $wpdb->get_col( | |
$wpdb->prepare( | |
"SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key=%s", | |
$postmeta_to_compile | |
) | |
); |
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 () { | |
// back-end instantiating | |
if ( window.acf ) { | |
// https://www.advancedcustomfields.com/resources/javascript-api/#functions-addaction | |
window.acf.addAction( 'render_block_preview/type=full-width-slider', function ( field ) { | |
const $sliderContainers = $( field ).find( '.block.full-width-slider' ); |
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
// for now, written old-school pre-es6/webpack | |
(function ( $ ) { | |
var AcfOptionsLinks = { | |
init : function () { | |
this.$body = $( '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
/* | |
* Stick me in your console and run | |
*/ | |
(function ( $ ) { | |
var fields = '', | |
php = '', | |
letAcfFormatTheValues = true, |