Created
November 28, 2023 12:27
-
-
Save LaxusCroco/68d1acd899fc64bc038757cce15153aa to your computer and use it in GitHub Desktop.
Returns 1 if post is sticky
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_action( 'jet-engine/register-macros', function(){ | |
class Is_Sticky extends \Jet_Engine_Base_Macros { | |
public function macros_tag() { | |
return 'is_sticky'; | |
} | |
public function macros_name() { | |
return esc_html__( 'Is Sticky', 'jet-engine' ); | |
} | |
public function macros_args() { | |
return array(); | |
} | |
public function macros_callback( $args = array() ) { | |
$post_id = jet_engine()->listings->data->get_current_object_id(); | |
return is_sticky( $post_id ); | |
} | |
} | |
new Is_Sticky(); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment