Giter Site home page Giter Site logo

be-sidebar-selector's People

Contributors

billerickson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

be-sidebar-selector's Issues

Dynamically create sidebar id

Right now I have a simple text field for the id (see here). I don't want users editing this field, as changing it will cause you to lose the widgets in that widget area.

My goal is to

  1. use 'attributes' => array( 'disabled' => true ) to make it non-editable
  2. use a custom sanitization function (or any other means) to set it when first created (ie: when empty) to sanitize_title( $name )
  3. Move sanitization function to the plugin's class if possible.
  4. Make sure the current widget area slug doesn't exist. If it does, add a number to the end

I have the first two in place right now but it's commented out. From the sanitization function I could access all the field data using $field->group->value, but I couldn't tell which group of fields the current field belonged to. I thought $field->index would provide that but it was 0 for all sidebars.

When not commented out, the current code creates all of the widget area ids based on the first widget area's name.

Here is what $field looks like: https://gist.github.com/billerickson/25535a9e82b32ce0219cbbf944477501

screenshot

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.