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 | |
/** | |
* Populate ACF select field options with Gravity Forms forms | |
*/ | |
function acf_populate_gf_forms_ids( $field ) { | |
if ( class_exists( 'GFFormsModel' ) ) { | |
$choices = []; | |
foreach ( \GFFormsModel::get_forms() as $form ) { | |
$choices[ $form->id ] = $form->title; |
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: WooCommerce Enable Reviews - Bulk Edit | |
* Description: Allow enable reviews by bulk edit into WooCommerce | |
* Version: 1.0.0 | |
* Author: Mário Valney | |
* Author URI: http://mariovalney.com | |
* Text Domain: woo-enable-reviews-bulk-edit | |
* |
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 | |
function getId($page) { return $page->ID; } | |
$ancestors = get_post_ancestors( $post->ID ); | |
$parent = ($ancestors) ? $ancestors[0] : null; | |
if ($parent) : | |
$siblingIds = array_map( "getId", get_pages('child_of='. $parent .'&sort_column=menu_order&sort_order=asc') ); |