Viewing 3 reply threads
  • Author
    Posts
    • #2807
      ajayphp
      Member

      Hi,

      I want to give ref of field id attribute to jquery instance,
      ‘but i saw there is some auto mechanism to create id,

      i tried with id as attribute array but in that also some auto prepend

      Before: id=”_post_post_title_0″

      After below code : (when i did mention ID in attribute)
      id=”_post_meta_gtw_api_geo_prefix_0″

      ,'attributes' => array(
            'class' => 'regular-text'
            ,'id' => 'gtw_api_geo_prefix'
            
          )

      could you please advice , how it works,
      so i can have fixed id to reference with jquery etc.

      Regards,

    • #2819
      Steve
      Keymaster

      @ajayphp– You can’t control the ID, but you can use custom classes, and jQuery can target classes. Or use data-attributes.

    • #2820
      ajayphp
      Member

      Hi,

      normally we use class for css

      and id for jquery function call or modification

      and data-attribute still doubt of compatible with all browser

      and you should take this in notice to make something on this in future

      Regards,

    • #2823
      Steve
      Keymaster

      It’s on our list of todo’s. Closing ticket…

Viewing 3 reply threads
  • The topic ‘custom id for field attribute’ is closed to new replies.