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 | |
/* | |
Plugin Name: Convert file_list to CMB2 repeatable field groups | |
Plugin URI: https://www.iweb.co.uk/ | |
Description: Go through post meta by a specified key. Convert file_list data to a CMB2 repeatable field group. | |
Version: 1.0.0 | |
Author: iWeb | |
Author URI: https://www.iweb.co.uk/ | |
*/ |
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
<style> | |
.case-studies {} | |
.case-studies__item {} | |
.case-studies__item--featured {} | |
.case-studies__link {} | |
.case-studies__image {} {} | |
</style> | |
<div class="case-studies"> | |
<div class="case-studies__item case-studies__item--featured"> |
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
<style> | |
.list {} | |
.list__item {} | |
.list__item—-red {} | |
</style> | |
<ul class="list"> | |
<li class="list__item">List item 1</li> | |
<li class="list__item list__item--red">List item 2</li> | |
<li class="list__item">List item 3</li> |
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 | |
/* | |
Plugin Name: Convert SMURF to CMB2 repeatable field groups | |
Plugin URI: http://www.iweb.co.uk/ | |
Description: Go through and zero index each SMURF array. | |
Version: 1.0.0 | |
Author: iWeb | |
Author URI: http://www.iweb.co.uk/ | |
*/ |
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 | |
/** | |
* CMB2 Field Type: Select2 asset path | |
* | |
* Filter the path to front end assets (JS/CSS). | |
*/ | |
function pw_cmb2_field_select2_asset_path() { | |
return get_stylesheet_directory_uri() . '/metaboxes/cmb-field-select2'; | |
} | |
add_filter( 'pw_cmb2_field_select2_asset_path', 'pw_cmb2_field_select2_asset_path' ); |
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 | |
// Example meta box field | |
$cmb->add_field( array( | |
'name' => 'Test Select', | |
'id' => 'test_select', | |
'type' => 'pw_multiselect', | |
'options_cb' => 'iweb_get_cmb2_term_options', | |
'get_terms_args' => array( | |
'taxonomy' => 'post_tag', | |
), |
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 | |
// Example meta box field | |
$cmb->add_field( array( | |
'name' => 'Test Select', | |
'id' => 'test_select', | |
'type' => 'pw_multiselect', | |
'options_cb' => 'iweb_get_cmb2_post_options', | |
'wp_query_args' => array( | |
'post_type' => 'page', | |
), |
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 | |
/* | |
Plugin Name: Convert pw_gallery to file_list | |
Plugin URI: https://github.com/mustardBees/cmb-field-gallery | |
Description: Rough, inefficient snippet for converting existing data from pw_gallery to file_list format. Hit example.com/?convert_pw_gallery_to_file_list. Use at your own risk. Backup first! | |
Version: 1.0.0 | |
Author: Phil Wylie | |
Author URI: https://www.philwylie.co.uk/ | |
License: GPL2 | |
*/ |
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 | |
/** | |
* Block persistent marketers | |
* | |
* @param $errors | |
* @param $posted_field | |
* @param $posted_value | |
* | |
* @return mixed | |
*/ |