• thefalcon2k

    (@thefalcon2k)


    Since I came across this plugin, I have used it on all the WordPress sites I’ve created. It really makes things so much easier when I want to take the site offline for any reason. The plugin does deserve its 5 stars, but the only thing I have to say, though … I would love to have some kind of way to implement a text “status” into my website rather than the Admin Bar (i.e. Theme: Light | Maintenance Mode: Off | Membership: VIP | Log out).

Viewing 3 replies - 1 through 3 (of 3 total)
  • Manuel Rocha

    (@manuelrocha88)

    @thefalcon2k thanks for the feedback. Regarding Your suggestion, can you elaborate a little bit more?

    Thread Starter thefalcon2k

    (@thefalcon2k)

    @manuelrocha88 Well, one of the things I want to do is to remove the black “Admin Bar” on the top of my page entirely (which is possible through another plugin) and modify it with my own header. However, I still want to be able to print out the Maintenance Mode “status” on the custom header I had created rather than only seeing the status on the /wp-admin page.

    So, I’m essentially looking for the ability to program some kind of PHP output code that I can place in the site (if I choose to not use the Admin Bar).

    Manuel Rocha

    (@manuelrocha88)

    @thefalcon2k I don’t have an easy solution for that, but we do this for adding stuff to the admin bar

    public function mtnc_admin_bar()
    {
      add_action('admin_bar_menu', 'mtnc_add_toolbar_items', 100);
    }

    Then, the mtnc_add_toolbar_items function looks like this:

    function mtnc_add_toolbar_items()
    {
      global $wp_admin_bar, $wpdb;
      $mt_options = mtnc_get_plugin_options(true);
      $check      = '';
      if (!is_super_admin() || !is_admin_bar_showing()) {
        return;
      }
      $url_to = admin_url('admin.php?page=maintenance');
    
      if ($mt_options['state']) {
        $check = 'On';
      } else {
        $check = 'Off';
      }
      $wp_admin_bar->add_menu(
        array(
          'id'    => 'maintenance_options',
          'title' => __('Maintenance', 'maintenance') . __(' is ', 'maintenance') . $check,
          'href'  => $url_to,
          'meta'  => array(
            'title' => __(
              'Maintenance',
              'maintenance'
            ) . __(
              ' is ',
              'maintenance'
            ) . $check,
          ),
        )
      );
    }

    This last code is inside maintenance/includes/functions.php.

    Maybe importing this file into your function.php file of your theme and then invoking the $mt_options = mtnc_get_plugin_options(true); you get the state value from the plugin. Then You just need to create the custom interface to that. I can’t remember of a better solution for that. This is already out of the scope of our support. Sorry. But I think with this instructions You already can do what you want.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Very solid plugin!’ is closed to new replies.