abstracts
3 months ago
admin
3 months ago
ads
3 months ago
compatibility
3 months ago
crons
3 months ago
frontend
3 months ago
groups
3 months ago
importers
2 months ago
installation
1 year ago
interfaces
4 months ago
license
3 months ago
placements
3 months ago
rest
1 year ago
traits
4 months ago
utilities
3 months ago
array_ad_conditions.php
1 year ago
cap_map.php
3 years ago
class-assets-registry.php
3 months ago
class-autoloader.php
1 year ago
class-constants.php
1 year ago
class-entities.php
3 months ago
class-modal.php
1 year ago
class-modules.php
1 year ago
class-options.php
1 year ago
class-plugin.php
3 months ago
class-post-data.php
10 months ago
class-shortcodes.php
4 months ago
class-upgrades.php
1 year ago
class-widget.php
11 months ago
default-hooks.php
4 months ago
functions-ad.php
1 year ago
functions-components.php
3 months ago
functions-conditional.php
1 year ago
functions-core.php
1 year ago
functions-group.php
1 year ago
functions-placement.php
1 year ago
functions.php
3 months ago
index.php
2 years ago
load_modules.php
2 years ago
functions-components.php
46 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Functions for UI Toolkit components. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.48.0 |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Render modal. |
| 12 | * |
| 13 | * @param array $args The passed view arguments, overwriting the default values. |
| 14 | * |
| 15 | * @return void |
| 16 | */ |
| 17 | function advads_modal( $args ): void { |
| 18 | $args = wp_parse_args( |
| 19 | $args, |
| 20 | [ |
| 21 | 'id' => '', |
| 22 | 'title' => '', |
| 23 | 'content' => '', |
| 24 | 'file_path' => '', |
| 25 | 'show_footer' => true, |
| 26 | 'wrap_class' => '', |
| 27 | 'close_label' => __( 'Close', 'advanced-ads' ), |
| 28 | 'save_label' => __( 'Save', 'advanced-ads' ), |
| 29 | ] |
| 30 | ); |
| 31 | |
| 32 | if ( is_callable( $args['content'] ) ) { |
| 33 | ob_start(); |
| 34 | call_user_func( $args['content'] ); |
| 35 | $args['content'] = ob_get_clean(); |
| 36 | } |
| 37 | |
| 38 | if ( $args['file_path'] ) { |
| 39 | ob_start(); |
| 40 | require $args['file_path']; |
| 41 | $args['content'] = ob_get_clean(); |
| 42 | } |
| 43 | |
| 44 | require ADVADS_ABSPATH . 'views/components/modal.php'; |
| 45 | } |
| 46 |