Skip to content

Instantly share code, notes, and snippets.

View groupewibi's full-sized avatar

Wibi groupewibi

  • Groupe Wibi
  • France
View GitHub Profile
@groupewibi
groupewibi / functions.php
Created April 21, 2018 12:39 — forked from yratof/functions.php
ACF OEmbed with thumbnails
<?php
/* Pull apart OEmbed video link to get thumbnails out*/
function get_video_thumbnail_uri( $video_uri ) {
$thumbnail_uri = '';
// determine the type of video and the video id
$video = parse_video_uri( $video_uri );
// get youtube thumbnail
/* in ...application/modules/quotes/views/modal_create_quote.php : replace --------*/
<select name="client_id" id="create_quote_client_id" class="client-id-select form-control"
autofocus="autofocus">
<?php if (!empty($client)) : ?>
<option value="<?php echo $client->client_id; ?>"><?php _htmlsc(format_client($client)); ?></option>
<?php endif; ?>
</select>
/* ----- BY --------*/
@groupewibi
groupewibi / gist:8024275c2bd1958d0107944d87337d70
Created January 10, 2018 18:17
Acf Form : Changing the Label and Instruction of the Wysiwig Post_content field using prepare/field
function my_acf_prepare_field( $field ) {
$field['label'] = "My new title";
$field['instructions'] = "My new instruction";
if ( $field ) { return $field; } else { exit; }
}
add_filter('acf/prepare_field/name=_post_content', 'my_acf_prepare_field');
add_filter( 'acf/get_valid_field', 'change_post_content_type');
function change_post_content_type( $field ) {
if($field['type'] == 'wysiwyg') {
$field['tabs'] = 'visual'; $field['toolbar'] = 'basic'; $field['media_upload'] = 0;
}
return $field; }
@groupewibi
groupewibi / ACF Form : Change Title Name and Instructions
Last active May 25, 2019 18:01
Changing the title and the label of the Title Post using ACF Form
function my_acf_prepare_field( $field ) {
if ( is_page('page-name') ) {
$field['label'] = "My new title";
$field['instructions'] = "My new instruction";
}
if ( $field ) { return $field; } else { exit; }