PHP code example of publishpress / wordpress-version-notices

1. Go to this page and download the library: Download publishpress/wordpress-version-notices library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

publishpress / wordpress-version-notices example snippets


add_filter(\PublishPress\WordpressVersionNotices\Module\TopNotice\Module::SETTINGS_FILTER, function ($settings) {
    $settings['dumb-plugin-one'] = [
        'message' => 'You\'re using Dumb Plugin One Free. Please, %supgrade to pro%s.',
        'link'    => 'http://example.com/upgrade',
        'screens' => [
            [
                'base'      => 'edit',
                'id'        => 'edit-post',
                'post_type' => 'post',
            ],
        ]
    ];

    return $settings;
});

add_filter(\PublishPress\WordpressVersionNotices\Module\MenuLink\Module::SETTINGS_FILTER, function ($settings) {
    $settings['dumb-plugin-one'] = [
        'label' => 'Upgrade',
        'link'    => 'http://example.com/upgrade',
        'parent' => 'parent-menu-alias'
    ];

    return $settings;
});

add_filter(\PublishPress\WordpressVersionNotices\Module\MenuLink\Module::SETTINGS_FILTER, function ($settings) {
    $settings['dumb-plugin-one'] = [
        'label' => 'Upgrade',
        'link'    => 'http://example.com/upgrade',
        'parent' => [
            'parent-menu-alias-1',
            'parent-menu-alias-2',
            'parent-menu-alias-3',
        ]
    ];

    return $settings;
});