Plugin Directory

Changeset 2578297


Ignore:
Timestamp:
08/04/2021 06:16:13 PM (4 years ago)
Author:
wpizard
Message:

Upload v1.0.1

Location:
acfist/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • acfist/trunk/acfist.php

    r2578247 r2578297  
    33 * Plugin Name: ACFist
    44 * Description: Empower ACF with more features.
    5  * Version: 1.0.0
     5 * Version: 1.0.1
    66 * Author: WPizard
    7  * Author Uri: https://wpizard.com/acfist
    87 * Text Domain: acfist
    98 */
     
    2120        private static $plugin_name;
    2221
     22        private static $plugin_slug;
     23
    2324        private static $plugin_dir;
    2425
     
    3536            self::$plugin_basename = plugin_basename( __FILE__ );
    3637            self::$plugin_name = array_shift( $plugin_data );
     38            self::$plugin_slug = strtolower( self::$plugin_name );
    3739            self::$version = array_shift( $plugin_data );
    3840            self::$plugin_dir = trailingslashit( plugin_dir_path( __FILE__ ) );
     
    4547
    4648        public function init() {
    47             if ( ! class_exists( 'ACF' ) ) {
     49            if ( ! $this->is_acf_active() ) {
     50                add_action( "after_plugin_row_{$this->plugin_basename()}", [ $this, 'add_plugin_notice' ] );
     51
    4852                return;
    4953            }
     
    6266        }
    6367
     68        public function add_plugin_notice() {
     69            ?>
     70            <style>
     71                .plugins tr[data-slug="<?php echo $this->plugin_slug(); ?>"] th,
     72                .plugins tr[data-slug="<?php echo $this->plugin_slug(); ?>"] td {
     73                    box-shadow: none;
     74                    padding-bottom: 5px;
     75                }
     76            </style>
     77            <tr class="plugin-update-tr active" data-slug="<?php echo self::$plugin_slug; ?>" data-plugin="<?php echo self::$plugin_basename; ?>">
     78                <td colspan="4" class="plugin-update colspanchange">
     79                    <div class="update-message notice inline notice-error notice-alt">
     80                        <p>ACFist requires <a href="https://wordpress.org/plugins/advanced-custom-fields/" target="_blank">Advanced Custom Fields</a> v5.9.0+</p>
     81                    </div>
     82                </td>
     83            </tr>
     84            <?php
     85        }
     86
     87        public function is_acf_active() {
     88            if ( empty( defined( 'ACF_VERSION' ) ) || version_compare( ACF_VERSION, '5.9.0', '<' ) ) {
     89                return false;
     90            }
     91
     92            return true;
     93        }
     94
    6495        public function version() {
    6596            return self::$version;
     
    6899        public function plugin_basename() {
    69100            return self::$plugin_basename;
     101        }
     102
     103        public function plugin_slug() {
     104            return self::$plugin_slug;
    70105        }
    71106
  • acfist/trunk/readme.txt

    r2578247 r2578297  
    44Requires at least: 4.7
    55Tested up to: 5.8
    6 Stable tag: 1.0.0
     6Stable tag: 1.0.1
    77Requires PHP: 5.6
    88License: GPLv2 or later
     
    1313== Description ==
    1414
    15 Empower ACF with more features.
     15[Advanced Custom Fields](https://wordpress.org/plugins/advanced-custom-fields/) plugin is a useful and extendable plugin. ACFist is going to extend it with some handy features.
     16
     17= Admin Columns =
     18Add any fields in post type lists effortlessly. It allows you to set custom column label and format the column value. Following is list of available formats.
     19- **Image** returns an image for Image field.
     20- **Selected** returns the selected option for Select, Checkbox, Radio Button, Button Group and True / False fields.
     21- **Truncate** returns the truncated value for Text, Text Area, Email, Url, Password, Wysiwyg Editor fields.
     22- **Word Count** returns the number of words for Text, Text Area, Wysiwyg Editor fields
    1623
    1724== Changelog ==
    1825
    19 = 1.0.0 =
    20 * initial release.
     26= 1.0.1 = 2021-08-04
     27* Add plugin notice when ACF plugin is inactive.
     28
     29= 1.0.0 = 2021-08-04
     30* Initial release.
Note: See TracChangeset for help on using the changeset viewer.