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
| /* Get the external link for each post, crate a new connection for custom post template */ | |
| add_action( 'fl_page_data_add_properties', function() { | |
| FLPageData::add_post_property( 'canonical_url', array( | |
| 'label' => 'Post external link', | |
| 'group' => 'posts', | |
| 'type' => 'html', | |
| 'getter' => 'dgs_get_canonical_url', | |
| ) ); |
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
| /* Get the external link for each post, crate a new connection for custom post template */ | |
| add_action( 'fl_page_data_add_properties', function() { | |
| FLPageData::add_post_property( 'canonical_url', array( | |
| 'label' => 'Post external link', | |
| 'group' => 'posts', | |
| 'type' => 'html', | |
| 'getter' => 'dgs_register_canonical_url_connector', | |
| ) ); |
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
| add_filter( 'script_loader_tag', 'wsds_defer_scripts', 10, 3 ); | |
| function wsds_defer_scripts( $tag, $handle, $src ) { | |
| $id = get_the_ID(); | |
| // The handles of the enqueued scripts we want to defer | |
| $defer_scripts = array( | |
| 'jquery-waypoints', | |
| "fl-builder-layout-$id", | |
| 'devicepx', | |
| 'tmls_ba_throttle_debounce', | |
| 'tmls_mousewheel', |
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
| //The -- indicates that everything that follows should be sent to wp-cli. | |
| terminus wp innov8in.dev -- plugin deactivate profile-builder-pro |
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
| /** | |
| * Programmatically logs a user in | |
| * | |
| * @param string $username | |
| * @return bool True if the login was successful; false if it wasn't | |
| */ | |
| function programmatic_login( $username ) { | |
| if ( is_user_logged_in() ) { | |
| wp_logout(); | |
| } |
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
| // Add Beaver Builder Templates to main product loop | |
| add_action( 'fl_content_close', 'dg_add_bb_templates' ); | |
| function dg_add_bb_templates() { | |
| if ( is_woocommerce() ) { | |
| // Replace numbers with your own template IDs | |
| $templates = array( 1344, 1345, 1346 ); | |
| foreach ($templates as $template) { | |
| FLBuilder::render_query( array( |
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 | |
| /** | |
| * The template for displaying Archive pages. | |
| * | |
| * Learn more: http://codex.wordpress.org/Template_Hierarchy | |
| * | |
| * @package some_like_it_neat | |
| */ | |
| get_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
| add_filter( 'pods_meta_default_box_title', 'slug_pods_metabox_title' ); | |
| function slug_pods_metabox_title( $title ) { | |
| if ( get_post_type() == 'services' ) : { | |
| $title = __( 'Service Details', 'pods' ); | |
| return $title; | |
| } elseif ( get_post_type() == 'project' ) : { | |
| $title = __( 'Project Details', 'pods' ); | |
| return $title; | |
| } else : { |
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
| add_action( 'pre_get_posts', 'some_like_it_neat_filter_expired_posts' ); | |
| function some_like_it_neat_filter_expired_posts( $query ) { | |
| // doesn't affect admin screens | |
| if ( is_admin() ) | |
| return; | |
| // check for main query | |
| $key = 'some_like_it_neat_expire_post'; | |
| $expire_date = get_post_meta( get_the_id(), $key, true ); |