Giter VIP home page Giter VIP logo

ab-easy-option-page's Introduction

AB Easy Option Page

AB Easy Option Page is a dev oriented plugin to easily add an option page to a Wordpress website. I strive to make is as easy as possible to customize it via hooks. This plugin was created as a need for websites that didn't needed ACF but needed some sort of updatable option for the admins.



Usage

Register an option

Register the options you need in your functions.php.

Arg name Possible value
name The nice name of the option
slug The slugified name of the option. Only use letters and undescores.
type The type of field. Accepts: text, email, tel, date, textarea, wysiwyg, number, image, checkbox, select, color.
description The description show with the option in the admin panel. (Optional)
options If your Option is a Select, provide an associative array of the options (Optional)

Example:

    function abop_register_options(){
        abop_register_option([
            "name"=>"My nice option",
            "description" => "This option appear in the footer.",
            "slug"=>"nice_option",
            "type"=> "text"
        ]);
    }
    add_action('init','abop_register_options');
   

Retrieve an option

Arg name Possible value
option_slug string

Example:

    <p><?php echo esc_html(abop_get_option('nice_option')) ?></p>


DEBUG information

If your option won't register, debug messages can be printed to the debug log. To get the various message in the debug log, declare this constant in wp_config :

define('ABOP_DEBUG',true);
// Make sure that WP_DEBUG AND WP_DEBUG_LOG are defined in your wp-config.php

Mentions

Thanks to rudrastyh for creating a tutorial for self hosting updates. His work was used to make the update server possible.

ab-easy-option-page's People

Contributors

bernier154 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.