This file contains 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 | |
function myFluentCrmTagIdBySlug($slug) { | |
$tag = \FluentCrm\App\Models\Tag::where('slug', $slug)->first(); | |
if($tag) { | |
$tagId = $tag->id; | |
} | |
This file contains 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 | |
/** | |
* A Hack to generate mock WP Post objects from any arbitrary array | |
* A possible use case is to render a list of taxonomy terms using Oxygen Builder's repeater element, | |
* as the repeater allows only WP_Query as a source of data | |
* | |
* @author: Gagan S Goraya | |
* @link: https://gagangoraya.com | |
* |
This file contains 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('fluentform_before_insert_submission', function ($insertData, $data, $form) { | |
if($form->id != 8) { // 23 is your form id. Change the 23 with your own login for ID | |
return; | |
} | |
$redirectUrl = home_url(); // You can change the redirect url after successful login | |
if (get_current_user_id()) { // user already registered | |
wp_send_json_success([ | |
'result' => [ |
This file contains 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
/* I'll put here different examples of dynamic query for Oxygen repeater : | |
* - Use one of the following repeater_dynamic_query definitions | |
* in code block just BEFORE the repeater | |
* - Set the repeater custom query settings : post type, number of posts, order... | |
* - Add the remove_action in a code block AFTER the repeater | |
*/ | |
/**************************************************************************************************** | |
* Display related posts for any CPT with taxonomy: |
This file contains 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
/** | |
* Oxy-Dummy activation (thank you Sridhar Katakam) | |
* Paste this code snippet in your Oxygen's customization plugin | |
* or copy the file to /wp-content/plugins/customization-plugin/ | |
*/ | |
remove_filter( 'template', 'ct_oxygen_template_name' ); | |
remove_filter( 'template_directory', 'ct_disable_theme_load', 1, 1 ); | |
remove_filter( 'stylesheet_directory', 'ct_disable_theme_load', 1, 1 ); |
This file contains 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 | |
/** | |
* Example programmatic registration of Advanced Custom Fields fields | |
* | |
* @see http://www.advancedcustomfields.com/resources/register-fields-via-php/ | |
*/ | |
function register_custom_acf_fields() { | |
if ( function_exists( 'acf_add_local_field_group' ) ) { |
This file contains 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 | |
// Method 1: simple foreach loop | |
$favorites = get_user_favorites(); | |
if ( isset($favorites) && !empty($favorites) ) : | |
foreach ( $favorites as $favorite ) : | |
// You'll have access to the post ID in this foreach loop, so you can use WP functions like get_the_title($favorite); | |
endforeach; | |
endif; |