PluginProbe
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI / 5.8.5
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI v5.8.5
6.0.3 6.0.2 6.0.1 6.0.0 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.7.9.2 5.7.9.1 5.7.8 5.7.9 5.7.6 5.7.7 5.7.5 5.7.4 5.7.3 5.7.2 5.7.1 trunk 5.6.0 5.6.1 All 34 releases
automatorwp / integrations / wishlist-member / includes / functions.php

functions.php in AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI 5.8.5, at integrations/wishlist-member/includes/functions.php

49 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Functions
4 *
5 * @package AutomatorWP\Integrations\WishList_Member\Functions
6 * @author AutomatorWP <[email protected]>, Ruben Garcia <[email protected]>
7 * @since 1.0.0
8 */
9 // Exit if accessed directly
10 if( !defined( 'ABSPATH' ) ) exit;
11
12 /**
13 * Options callback for levels options
14 *
15 * @since 1.0.0
16 *
17 * @param stdClass $field
18 *
19 * @return array
20 */
21 function automatorwp_wishlist_member_levels_options_cb( $field ) {
22
23 $options = array(
24 'any' => __( 'any level', 'automatorwp' ),
25 );
26
27 if( function_exists( 'wlmapi_get_levels' ) ) {
28
29 // Get all registered levels
30 $levels = wlmapi_get_levels();
31
32 // Check that levels are correctly setup
33 if ( is_array( $levels )
34 && isset( $levels['levels'] )
35 && isset( $levels['levels']['level'] )
36 && ! empty( $levels['levels']['level'] ) ) {
37
38 // Loop levels to add them as options
39 foreach ( $levels['levels']['level'] as $level ) {
40 $options[$level['id']] = $level['name'];
41 }
42
43 }
44
45 }
46
47 return $options;
48
49 }