This file contains hidden or 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 | |
$form_id = 1; | |
$field_id = 1; | |
add_filter( "gform_field_content_{$form_id}_{$field_id}", 'gfield_render_the_content', 10, 5 ); | |
function gfield_render_the_content( $content, $field, $value, $lead_id, $form_id ) { | |
$content = apply_filters( 'the_content', get_the_content() ); | |
return $content; | |
} |
This file contains hidden or 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 | |
/** | |
* Change name `Portfolio` with `Retreats` | |
* | |
* @param array $args Post type arguments. | |
* @param string $post_type Post type slug. | |
* @return array Filtered arguments. | |
*/ | |
if( ! function_exists( 'astra_portfolio_change_portfolio_arguments' ) ) : | |
function astra_portfolio_change_portfolio_arguments( $args = array(), $post_type = '' ) { |
This file contains hidden or 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 | |
/** | |
* Generates the post type labels | |
* | |
* @param string $single Singular name of the post type. | |
* @param string $plural Plural name of the post type. | |
* @param array $overrides Override any generated labels. | |
* @return array The post type labels | |
*/ | |
function cameronjonesweb_generate_post_type_labels( $single, $plural, $overrides = [] ) { |
This file contains hidden or 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 | |
/** | |
* Use ACF image field as avatar | |
* @author Mike Hemberger | |
* @link http://thestizmedia.com/acf-pro-simple-local-avatars/ | |
* @uses ACF Pro image field (tested return value set as Array ) | |
*/ | |
add_filter('get_avatar', 'acf_profile_avatar', 10, 5); | |
function acf_profile_avatar( $avatar, $id_or_email, $size, $default, $alt ) { | |
if ( is_numeric( $id_or_email ) ) { |
This file contains hidden or 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
/** | |
* Delete the options | |
* | |
* @todo Change the `prefix_` and with your own unique prefix. | |
* | |
* @since 1.0.0 | |
*/ | |
if( ! function_exists( 'prefix_astra_portfolio_delete_options' ) ) : | |
function prefix_astra_portfolio_delete_options() { | |
delete_option( 'astra-portfolio-batch-process' ); |
This file contains hidden or 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 | |
add_filter('wp_terms_checklist_args', function ($args){ | |
$args['checked_ontop'] = false; | |
return $args; | |
}); |
This file contains hidden or 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
/** | |
* If missing or empty image alt attribute, get the current post's title to set it | |
* In order to be unique, use the following naming convention : 'Image n : post title' | |
* | |
* @param string $content | |
* | |
* @author Maxime CULEA | |
* | |
* @return string | |
*/ |
This file contains hidden or 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 class Post_Column { | |
function __construct() { | |
add_filter( 'manage_posts_columns', [ $this, 'columns_head' ] ); | |
add_action( 'manage_posts_custom_column', [ $this, 'columns_content' ], 10, 2 ); | |
add_action( 'admin_footer', [ $this, 'jquery_event' ] ); | |
add_action( 'wp_ajax_newsletter_send_save_meta', [ $this, 'process_ajax' ] ); | |
} | |
/** | |
* Add column header |
This file contains hidden or 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 | |
// https://wordpress.stackexchange.com/a/293403/11761 | |
// Make sure to change MY_POST_TYPE, MY_CUSTOM_COLUMN and MY_META_KEY to the actual values. | |
// Add your custom column. Unset the date and set it again to keep it in the last column. You can skip this step. | |
function my_manage_MY_POST_TYPE_columns( $columns ) | |
{ | |
// save date to the variable |