Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created February 28, 2014 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/9280268 to your computer and use it in GitHub Desktop.
Save billerickson/9280268 to your computer and use it in GitHub Desktop.
<?php
/**
* ACF Table Shortcode
*
*/
function be_acf_table_shortcode( $value, $post_id, $field ) {
if( 'shortcode' !== $field['_name'] )
return $value;
$number = str_replace( array( 'be_table_', '_shortcode' ), array( '', '' ), $field['name'] );
$value = '[pss_table id="' . $number . '"]';
return $value;
}
add_filter( 'acf/load_value', 'be_acf_table_shortcode', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment