GithubHelp home page GithubHelp logo

aminshoukat / wordpress-screen-options-framework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jazzsequence/wordpress-screen-options-framework

0.0 0.0 0.0 52 KB

Quick start, plug and play include for extending and creating Screen Options in the WordPress admin.

License: GNU General Public License v3.0

PHP 100.00%

wordpress-screen-options-framework's Introduction

WordPress Screen Options Framework

Quick start, plug and play include for extending and creating Screen Options in the WordPress admin.

How to use

As a plugin

I've built this as a WordPress plugin, so you can clone or download the repository, throw it into your wp-content/plugins folder and activate to see it working. This allows you to use this repository as a learning tool to understand how the Screen Options API works.

As a library

You can use this project as a boilerplate/framework to include in your projects. In this case, you'll want to download the screen-options.php file directly. There are a few things you'll need to change for your project, most notably the admin page (here, here and here), the method by which you loop through options (here and here) and, obviously all the names for things.

As a Sublime Text snippet

I've also built a robust snippet for Sublime Text. Download the sublime-snippet and save it to your ~/Library/Application Support/Sublime Text 3/Packages/User folder (on Mac, %AppData%\Sublime Text 3\Packages\ on Windows). Create a php document and type wp_screen_options to trigger the snippet. Then just tab through the options to add in your own values. It's recommended that you at least look at the source or try out the plugin before using the snippet so you know how it works.

What it does

Adds unique screen options to the given admin page, loops through an array of options provided and adds a checkbox to toggle that option.

The checkbox input method is arbitrary -- any input field and type of data could be saved to user meta via screen options and additional field types could be added for more robust support.

With the plugin, an admin page is added which displays the value of the test screen options added to that page.

More info coming soon...

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.