What are Attributes used for in a WordPress Multisite?

When you edit a WordPress Multisite, there is this section of Attributes with multicheckboxes to select from, just curious what this actually does (if anything). I never needed to check "Public" checkbox in here for the site to be shown publicly. This is very strange to me and just wondering how WordPress uses this and if it’s used at all and how?


Woocommerce attributes

I have two attributes Size and colour. the variation in Size are Small, Medium, Large and Extra Large and when we select the variation of Size attribute certain colours appear. The issue I am facing is if I select small size rest of variation of size attribute disappear which I don’t want to ? any ways to show all the variation of "Size" attribute even after selection?

Changing attributes and EP

I’ve worked out a houserule, but is there any official ruling on what happens in BESM 3rd edition to your EP or HP total when your stats change? For example, if you drain someone’s Mind score and boost your own, your EP cap raises; does your current EP total rise to meet it? If you have your Mind score drained, your EP cap lowers; does your current EP total lower as well?

Can you sell off attributes while in alternate form?

So in BESM 3E, under alternate form, it states that you are allowed to ‘sell off’ attributes to get back character points. Are you allowed to sell back the alternate form attribute for a net of 19 points while in your alt form? A couple people in my playgroup have done it this way and to me it doesn’t feel that you should be allowed to sell off the alt form attribute.

Multi-Interval Discretization of Continuous-Valued Attributes for Classification Learning

I’m trying to figure out Fayyad and Irani (1993) MDLP discretization of continuous variables (here is link to the original paper). I understand how algorithm works, but I have some doubts about first step, sorting of variable and finding potential cut-points.

My doubt is what happens if we have multiple occurrence of same value of variable in the dateset and those occurrences have different target variable associated with them? This can happen quite often in practice, e.g. we have table of clients with some properties which is 0 for some large number of them and there are multiple different events associated with those clients, some of them belonging to one class and others belonging to different class.

Here is a dummy table with sorted Variable X and 2-class classification problem:

enter image description here

If we apply heuristic like it is suggested in the paper, value 0.6 will end up in multiple different potential bins since it contains both class 0 and 1. What’s even worst, it seems that potential cutoffs and bins will be different if we sort target variable (ascending, descending or unsorted)…

Any help with this, someone maybe already tried to figure out this?

Do I really need to have header attributes in elements [closed]

I’m trying to make a website I’m working on meet accessibility requirements. I’ve checked it at https://achecker.ca/checker which complains about all the <td> elements in my tables not having id and header attributes. The message from the checker was:

Check 245: Data table with more than one row/column of headers does not use id and headers attributes to identify cells. Repair: Add id and headers attributes to table cells so they identify the cells that relate to the headers. 

This implies that each <th> element should have an id attribute and each <td> should have a header attribute pointing to the relevant <th> elements. This method is described in https://www.w3.org/TR/WCAG20-TECHS/H43.html

I have already specified a scope for all the header elements in accordance with https://www.w3.org/TR/WCAG20-TECHS/H63.html so I wouldn’t have expected it to be necessary to include header tags in the <td> elements as well, especially since the notes in H63.html suggest that for simple tables that have the headers in the first row or column then it is sufficient to simply use the <th> elements without scope and only suggests that the extra id and header attributes required in H43.html should be used in more complex tables.

Here’s a simplified pruned down example of one of my tables:

<table> <caption>Full council Meetings in 2020</caption> <thead>     <tr>         <th scope="col">Meeting date</th>         <th scope="col">Agenda</th>         <th scope="col">Minutes</th>         <th scope="col">Attachments</th>     </tr> </thead> <tbody>     <tr>         <th scope="row">Jan 9th 2020</th>         <td><a href="http://www.example.com/Agenda-Januray.pdf">view</a></td>         <td><a href="http://www.example.com/Minutes-January.pdf">view</a></td>         <td>&nbsp;</td>     </tr>     <tr>         <th scope="row">Feb 13th 2020</th>         <td><a href="http://www.example.com/Agenda-February.pdf">view</a></td>         <td><a href="http://www.example.com/Minutes-February.pdf">view</a></td>         <td><a href="http://www.example.com/Attachments-February.pdf">view</a></td>     </tr> </tbody> </table> 

This leads me to wonder if the accessibility checker is being over pedantic?

I could easily add the header tags if needed but I’m reluctant to add extra bloat if it’s not needed.

simplyfing common data values (parts of a string) in an array – by merging same attributes (data values)

I have arrays comprised of string elements like the following 2 examples. Each of the following lines is a string element of the array.


aaa bbb cc1 dd1  aaa bbb cc1 dd2  aaa bbb cc2 dd1  aaa bbb cc2 dd2  aaa bbb cc3 dd1  aaa bbb cc3 dd2  


bbb rrr nnn ttt ooo eee ddd fff contr  bbb sss nnn ttt ppp eee contr  bbb sss nnn aaa ooo eee ddd fff contr  bbb rrr nnn ttt yyy eee ddd fff contr  

I want to simplify and remove "redundant" lines by merging in a single line duplicate attributes. So the results should be:


aaa bbb cc1 dd1/dd2 aaa bbb cc2 dd1/dd2 aaa bbb cc3 dd1/dd2 


bbb rrr nnn ttt ooo/yyy eee ddd fff contr  bbb sss nnn ttt ppp eee contr  bbb sss nnn aaa ooo eee ddd fff contr  

(the results are an array as well).

My current approach goes like this: remove the first column then compare all elements. if equal lines are found, merge them. remove second column, compare. It becomes though somewhat complicated, as not all lines have the same number of data values (separated by spaces).

I’m stuck here. Any help would be welcome.

How can I add attributes to all characters in a folder and set them to a default value?

I recently decided to consolidate my macros that refer to a character’s gender by pronoun into a single one using attributes on the character sheet (ie subjective, objective, possessiveA, and possessiveP) and am looking for a way to loop through each character in a folder and add those attributes to each of them and set them to a default of {it, it, its, and its} respectively. Is there any way I can do that? I do have api access if it’s required to do it.

Reprinting tags with all attributes

I’m reworking a WordPress plugin that I’ve made which specifies image dimensions that are missing width and/or height attributes.

As you can see in my current version on GitHub, I manually list all of the attributes for the <img> tag (L38). However, if a user were to add custom attribute, it would get omitted since it’s not listed in my $ attributes variable:

# Before <img src="https://example.com/img.png" class="img" custom-attr="value"> # After <img src="https://example.com/img.png" class="img" width="100" height="30"> 

Creating a simple test file, I was able to update the regex to store all attributes that are found in the <img> tags. Yes, I’m aware of the recommendation to use DOMDocument, but it has caused more issues with WordPress in the past.

preg_match_all( '/(?:<img|(?<!^)\G)\h*([-\w]+)="([^"]+)"(?=.*?\/>)/', $  content, $  images ); 

In order to not fill up this post with too much code, I have the current working test file on my GitHub Gist here. You can also see the regex test here to verify.

Using var_dump( $ images );, this gives me the following output from my sample images (I added ... at the end of each array to save space):

    0 =>        array (size=19)         0 => string '<img src="https://placehold.it/250x100/99cc00/000.jpg?text=JPG"' (length=63)         1 => string ' alt="JPG"' (length=10)         2 => string '<img src="https://placehold.it/250x100.gif?text=GIF"' (length=52)         ...     1 =>        array (size=19)         0 => string 'src' (length=3)         1 => string 'alt' (length=3)         2 => string 'src' (length=3)         ...     2 =>        array (size=19)         0 => string 'https://placehold.it/250x100/99cc00/000.jpg?text=JPG' (length=52)         1 => string 'JPG' (length=3)         2 => string 'https://placehold.it/250x100.gif?text=GIF' (length=41)         ... 

My goal is to recreate the image tags with all of their attributes and values after the dimensions are calculated. From my tests, I’ve tried the following, but it hasn’t given me the results I’m expecting:

foreach ( $  images[1] as $  attributes[1] => $  value ) {     echo( '< img ' . $  value . '="' . 'value' . '" ><br>' ); } 

Can there exist Tables with no Non-Prime Attributes? If so, are they always normalised to 3NF?

Can there exist a table with no non-prime attributes?

Here is an example of a table which I believe has no non-prime attributes:

I came to this conclusion because the list of attributes in the relation is [id, tag_desc_id, name] and the list of candidate keys is [{id}, {tag_desc_id, name}]. There are no attributes in the list of attributes that are in none of the candidate keys. Thus, there are no non-prime attributes.

Is my reasoning correct?

If so, is it normalised to 3NF?

The criteria for 3NF is:

  • 2NF

  • Every non-prime attribute of R is non-transitively dependent on every key of R

There are no non-prime attributes, thus 3NF is satisfied

The criteria for 2NF is:

  • 1NF

  • Every non-prime attribute is (…)

Again, there are no non-prime attributes.

Is this true generally?

For any table, assuming the table has a primary key id as above (and so 1NF is satisfied), and the table has no non-prime attributes, is it always the case that the table is normalised to the third normal form (3NF)?