• I’ve been trying to translate or change the “select a category” text for the add link function.

    I found a translation string for it, and it looks the option text is rendered in line 282 of render-link-library-addlink-sc.php, but it’s not using the textdomain.

    Maybe there’s an input string somewhere in the settings, but I haven’t found it. Such a setting would be most flexible.

    While I’m at it, having such an option tag atop the link category dropdown list direct access would be great, as now the first category is selected by default. If user wants to show that category, they would first need to change the select, then change back.

    Ultimately having the option to put custom text and html in the categories to be displayed or categorylistoverride would be great. Example categorylistoverride=”Mytext”,1,2,”<optgroup label=’Mylabel’>”,3,4,”</optgroup>”,5,6

    Thanks!

    • This topic was modified 7 years, 7 months ago by yezzz.
Viewing 1 replies (of 1 total)
  • Thread Starter yezzz

    (@yezzz)

    While I was thinking about how a select with options without value would work I remembered I had some issues with multiple/mixed ajaxified libraries on a single page.

    So I placed 2 -cats shortcodes for (ajax single-cat) dropdown lists on a page to find it doesn’t work. While at the time I had little, if any, javascript knowledge, this time I know that 2 selects on a page (for single-cat ajax results) don’t work, because this will cause document.catselect to be an array of objects, while showcategory() expects a single element object.

    This could be solved for instance by adding settings set number to the form name and passing it: showcategory(formname). Then inside do var catidvar=document[formname].catdropdown.value.

    Without changing name attributes can be also be done. See the fiddle which works for dropdowns with and without direct access, and also takes care of options without value attribute: https://jsfiddle.net/1h6Lt13t/

    Feel free to use or adjust to your needs.

    • This reply was modified 7 years, 7 months ago by yezzz.
    • This reply was modified 7 years, 7 months ago by yezzz.
Viewing 1 replies (of 1 total)
  • The topic ‘user add link select category text’ is closed to new replies.