acf-extended
Last commit date
assets
7 years ago
includes
7 years ago
acf-extended.php
7 years ago
init.php
7 years ago
readme.txt
7 years ago
init.php
55 lines
| 1 | <?php |
| 2 | |
| 3 | if(!defined('ABSPATH')) |
| 4 | exit; |
| 5 | |
| 6 | /** |
| 7 | * ACFE: Is ACF Pro Active |
| 8 | */ |
| 9 | function acfe_is_acf_pro(){ |
| 10 | |
| 11 | return class_exists('ACF') && defined('ACF_PRO') && defined('ACF_VERSION') && version_compare(ACF_VERSION, '5.7.10', '>='); |
| 12 | |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * ACFE: ACF Pro Check |
| 17 | */ |
| 18 | add_action('after_plugin_row_' . ACFE_BASENAME, 'acfe_plugin_row', 5, 3); |
| 19 | function acfe_plugin_row($plugin_file, $plugin_data, $status){ |
| 20 | |
| 21 | if(acfe_is_acf_pro()) |
| 22 | return; |
| 23 | |
| 24 | ?> |
| 25 | |
| 26 | <style> |
| 27 | .plugins tr[data-plugin='<?php echo ACFE_BASENAME; ?>'] th, |
| 28 | .plugins tr[data-plugin='<?php echo ACFE_BASENAME; ?>'] td{ |
| 29 | box-shadow:none; |
| 30 | } |
| 31 | |
| 32 | <?php if(isset($plugin_data['update']) && !empty($plugin_data['update'])){ ?> |
| 33 | |
| 34 | .plugins tr.acfe-plugin-tr td{ |
| 35 | box-shadow:none !important; |
| 36 | } |
| 37 | |
| 38 | .plugins tr.acfe-plugin-tr .update-message{ |
| 39 | margin-bottom:0; |
| 40 | } |
| 41 | |
| 42 | <?php } ?> |
| 43 | </style> |
| 44 | |
| 45 | <tr class="plugin-update-tr active acfe-plugin-tr"> |
| 46 | <td colspan="3" class="plugin-update colspanchange"> |
| 47 | <div class="update-message notice inline notice-error notice-alt"> |
| 48 | <p><?php _e('ACF Extended requires Advanced Custom Fields PRO (minimum: 5.7.10).', 'acfe'); ?></p> |
| 49 | </div> |
| 50 | </td> |
| 51 | </tr> |
| 52 | |
| 53 | <?php |
| 54 | |
| 55 | } |