Coder Social home page Coder Social logo

custom_wp_adminbar's Introduction

Anpassbare Adminbar für Wordpress (Wordpress-Plugin)

Dieses Plugin ermöglicht es, die Admin-Leiste von WordPress zu personalisieren, indem sich benutzerdefinierte Menüpunkte hinzufügen oder entfernen lassen.

Beispiel für die Verwendung

function example_custom_adminbar_setup() {
    global $customized_wordpress_adminbar;
    
    $adminbar = $customized_wordpress_adminbar;

    // Hauptmenüpunkt hinzufügen
    $parent_id = $adminbar->add(null, 'Benutzerdefiniertes Menü', '#', 'dashicons-menu');

    // Untermenüpunkte hinzufügen
    $adminbar->add($parent_id, 'Dashboard', admin_url(), 'dashicons-dashboard');
    $adminbar->add($parent_id, 'Profil', admin_url('profile.php'), 'dashicons-admin-users');

    // Modal-Fenster hinzufügen
    $adminbar->addModal($parent_id, 'Hilfe', 'help-modal', 'dashicons-editor-help');
    $adminbar->addModalContent('help-modal', '<h2>Hilfe-Inhalt</h2><p>Hier können Sie Ihren Hilfe-Text einfügen.</p>');

    $adminbar->addModal($parent_id, 'Externe Seite', 'external-modal', 'dashicons-admin-site');
    $adminbar->addModalContent('external-modal', 'https://example.com', 'wide', true);

    // Beitrags- oder seitenspezifische Menüpunkte
    if (is_single() || is_page()) {
        $adminbar->add($parent_id, 'Bearbeiten', get_edit_post_link(), 'dashicons-edit');
        $adminbar->add($parent_id, 'Ansehen', get_permalink(), 'dashicons-visibility');
    }
}

add_action('wp', 'example_custom_adminbar_setup');

custom_wp_adminbar's People

Contributors

johappel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.