Skip to content

Instantly share code, notes, and snippets.

View remyperona's full-sized avatar

Rémy Perona remyperona

View GitHub Profile
@remyperona
remyperona / gist:d81457723533c5ebcbce
Created April 14, 2015 14:52
WordPress customizer_register TinyMCE control
function register_theme_customizer() {
$wp_customize->add_section( 'editor', array(
'title' => 'Editeur',
'description' => 'Editeur TinyMCE',
'priority' => 300
) );
$wp_customize->add_setting( 'theme[editor_content]', array(
'default' => '',
'transport' => 'postMessage',
@remyperona
remyperona / gist:8fd06872d1b9f0971296
Created April 14, 2015 14:48
WordPress customizer custom tinymce control javascript
( function( $ ) {
wp.customizerCtrlEditor = {
init: function() {
$(window).load(function(){
$('textarea.wp-editor-area').each(function(){
var tArea = $(this),
id = tArea.attr('id'),
@remyperona
remyperona / gist:13348dbcd2bbb0d9406f
Created April 14, 2015 14:32
WordPress customizer custom tinymce control
class Text_Editor_Custom_Control extends WP_Customize_Control
{
public $type = 'textarea';
/**
** Render the content on the theme customizer page
*/
public function render_content() { ?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<?php
@remyperona
remyperona / microdata-markup-google-sitelink-searchbox
Last active July 22, 2018 00:30
ADD microdata markup for Google sitelinks search box in WP search form
@remyperona
remyperona / google-sitelinks-search-box-json-ld
Last active August 29, 2015 14:06
Add JSON+LD markup for Google sitelinks search box
@remyperona
remyperona / gist:85628f1e90880c04f3fb
Last active August 29, 2015 14:05
Get a taxonomy's terms in posts with another taxonomy's term
<?php
$base_taxonomy = 'pays';
$term_id = '1';
$required_taxonomy = 'villes';
$required_terms = array();
$required_terms_id = array();
$objects_in_tax = get_objects_in_term( $term_id, $taxonomy );
<?php
if ( have_rows( 'repeater_field', $order_id ) ) :
while ( have_rows( 'repeater_field', $order_id ) ) : the_row();
$type = get_sub_field( 'type', $order_id );
if( $type === 'tekst' ): ?>
<div id="customerMessageTxt">
<?php the_sub_field($type, $order_id); ?>
</div>