File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111/**
1212 * Determine if Beaver Builder is enabled within the current loop.
1313 *
14- * @since 0.1 .0
14+ * @since 2.0 .0
1515 * @access public
1616 * @return bool True if Beaver Builder is enabled.
1717 */
@@ -25,10 +25,30 @@ function carelib_is_beaver_enabled() {
2525 return $ enabled ;
2626}
2727
28+ /**
29+ * Determine if Elementor is enabled for a given post.
30+ *
31+ * @since 2.2.0
32+ * @access public
33+ * @param bool $post_id The ID of the post to check.
34+ * @return bool True if Elementor is enabled.
35+ */
36+ function carelib_is_built_with_elementor ( $ post_id = false ) {
37+ if ( ! defined ( 'ELEMENTOR_VERSION ' ) ) {
38+ return false ;
39+ }
40+
41+ if ( ! $ post_id ) {
42+ $ post_id = get_the_ID ();
43+ }
44+
45+ return (bool ) get_post_meta ( $ post_id , '_elementor_edit_mode ' , true );
46+ }
47+
2848/**
2949 * Determine if WooCommerce is installed and activated.
3050 *
31- * @since 0.1 .0
51+ * @since 2.0 .0
3252 * @access public
3353 * @return bool True if WooCommerce is active.
3454 */
You can’t perform that action at this time.
0 commit comments