Coder Social home page Coder Social logo

Add connector for Settings API about stream HOT 4 CLOSED

fjarrett avatar fjarrett commented on May 18, 2024
Add connector for Settings API

from stream.

Comments (4)

shadyvb avatar shadyvb commented on May 18, 2024

@fjarrett Unfortunately there is no way of keeping track of either option name nor the option group labels, those values ( names ) are stored without being associated to labels. So nothing can be done to fix this since the display of those fields is managed separately, and mostly hard-coded. And it kinda messes up the view.

What i'm thinking now is to have a hard-coded list of WP default options, and do a translation of the option name of others ( registered by plugins/themes ) which would probably not work most of the times.

from stream.

fjarrett avatar fjarrett commented on May 18, 2024

@shadyvb OK yeah good idea. For now, let's just hard-code a list of all default values.

from stream.

westonruter avatar westonruter commented on May 18, 2024

Yeah, so in the general case, the label would be stored in $wp_settings_fields[$page][$section][]['title']. It could be linked to an input by looking at $wp_settings_fields[$page][$section][]['args']['label_for']… but, there's no guarantee that the label_for is supplied, such as when the field is some radio buttons. Even if it was supplied, some messy HTML parsing would be needed to try to find the underlying input which has the id corresponding with the label_for and then matching up the name with the incoming POST data to identify the option name. Yeah. Not going to work.

There should be an API to register the stream label for any option saved. Connectors would come with a suite of such API calls.

from stream.

fjarrett avatar fjarrett commented on May 18, 2024

/cc @powelski

from stream.

Related Issues (20)

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.