Skip to content
Snippets Groups Projects
Select Git revision
  • c222055795b8f73a0484459f4e43c8a105dd980b
  • master default protected
  • 1.1.0
  • 1.0
4 results

README.md

Blame
  • pipeline status coverage report Latest Stable Version Total Downloads Latest Unstable Version License

    WordPress Library for Decision whether to show something.

    Idea is that you have ShouldShowStrategy interface with one bool method. Thanks to this you can create a class that delegates decision whether to show something. Your class does not have to hardcode that decision.

    Requirements

    PHP 5.6 or later.

    Composer

    You can install the bindings via Composer. Run the following command:

    composer require --dev wpdesk/wp-show-decision

    To use the bindings, use Composer's autoload:

    require_once 'vendor/autoload.php';

    Usage

        new Beacon(
            '6057086f-4b25-4e12-8735-fbc556d2dc01',
            new PostTypeStrategy('automation'),
            $this->get_plugin_assets_url()
        if ( is_admin() ) {
            ( new RateNotices(
                [ new TwoWeeksNotice( $this->plugin_url . '/assets', new PostTypeStrategy([
                    [ 'page' => 'x', 'name' => 'stefan' ], // show when page = x and name = stefan
                    [ 'page' => 'y' ]  // OR when page = y
                ] ) ) ]
            ) )->hooks();
        }

    Project documentation

    PHPDoc: https://wpdesk.gitlab.io/wp-show-decision/index.html