id
stringlengths 40
40
| text
stringlengths 29
2.03k
| original_text
stringlengths 3
154k
| subdomain
stringclasses 20
values | metadata
dict | emb
listlengths 1.02k
1.02k
|
---|---|---|---|---|---|
5eaa2b27884644695c60e3d55050b002f78e64e8
|
Wordpress Stackexchange
Q: Prevent empty Post Title on form submit via front end post (wp_insert_post_) I am creating a post from the front end using (shortened for brevity);
if (empty($_POST['my_title'])){
echo 'error: please insert a title';
} else {
$title = $_POST['my_title'];
}
$new_post = array(
'post_title' => $title,
'post_status' => 'publish',
'post_type' => 'post'
$pid = wp_insert_post($new_post);
If no Post Title is present on submit then the form returns the error message,
error: please insert a title
However WordPress still inserts the post with a title of (no title).
Is there a way through simple PHP validation to prevent wp_insert_post from accepting an empty value? (without using Javascript).
A: Simply put the wp_insert_post call inside your conditional check so its only called if the post title is not empty, something like this:
if (empty($_POST['my_title'])){
echo 'error: please insert a title';
} else {
$title = $_POST['my_title'];
$new_post = array(
'post_title' => $title,
'post_status' => 'publish',
'post_type' => 'post');
$pid = wp_insert_post($new_post);
}
|
Q: Prevent empty Post Title on form submit via front end post (wp_insert_post_) I am creating a post from the front end using (shortened for brevity);
if (empty($_POST['my_title'])){
echo 'error: please insert a title';
} else {
$title = $_POST['my_title'];
}
$new_post = array(
'post_title' => $title,
'post_status' => 'publish',
'post_type' => 'post'
$pid = wp_insert_post($new_post);
If no Post Title is present on submit then the form returns the error message,
error: please insert a title
However WordPress still inserts the post with a title of (no title).
Is there a way through simple PHP validation to prevent wp_insert_post from accepting an empty value? (without using Javascript).
A: Simply put the wp_insert_post call inside your conditional check so its only called if the post title is not empty, something like this:
if (empty($_POST['my_title'])){
echo 'error: please insert a title';
} else {
$title = $_POST['my_title'];
$new_post = array(
'post_title' => $title,
'post_status' => 'publish',
'post_type' => 'post');
$pid = wp_insert_post($new_post);
}
A: Or you could just
return;
after echoing the error. :)
|
wordpress
|
{
"language": "en",
"length": 172,
"provenance": "stackexchange_00019.jsonl.gz:419768",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51475"
}
|
[
0.07196044921875,
0.0024967193603515625,
0.0313720703125,
-0.008270263671875,
-0.005001068115234375,
-0.0180206298828125,
0.049591064453125,
-0.05621337890625,
0.02398681640625,
-0.021270751953125,
-0.0255889892578125,
-0.0049591064453125,
-0.0269317626953125,
-0.041473388671875,
0.01372528076171875,
-0.031646728515625,
0.01178741455078125,
-0.00548553466796875,
0.0179443359375,
-0.02154541015625,
0.0037384033203125,
-0.0267181396484375,
0.021514892578125,
-0.0199127197265625,
-0.01375579833984375,
-0.0260009765625,
0.08282470703125,
-0.03802490234375,
0.003971099853515625,
-0.024383544921875,
0.005565643310546875,
0.01611328125,
0.0153045654296875,
0.0516357421875,
-0.0281219482421875,
0.07757568359375,
0.061004638671875,
-0.0010509490966796875,
0.0265045166015625,
0.045440673828125,
0.0264739990234375,
-0.0095977783203125,
0.024932861328125,
-0.0095977783203125,
0.003162384033203125,
-0.0104522705078125,
0.027191162109375,
-0.017425537109375,
-0.01442718505859375,
-0.015777587890625,
0.035797119140625,
-0.0104522705078125,
0.0621337890625,
-0.01071929931640625,
-0.004100799560546875,
0.01546478271484375,
-0.021270751953125,
-0.0006685256958007812,
0.051727294921875,
0.0272064208984375,
-0.030975341796875,
-0.044189453125,
0.0008339881896972656,
-0.07745361328125,
0.0162506103515625,
0.001373291015625,
0.0179443359375,
0.03948974609375,
-0.036224365234375,
0.0025634765625,
0.001201629638671875,
-0.0296630859375,
-0.0243377685546875,
-0.00943756103515625,
-0.030059814453125,
0.0003592967987060547,
-0.0006375312805175781,
-0.05499267578125,
0.023193359375,
0.0153961181640625,
-0.0224761962890625,
-0.036346435546875,
0.01666259765625,
-0.0343017578125,
0.0240020751953125,
0.005290985107421875,
-0.0267486572265625,
0.017181396484375,
-0.0223541259765625,
-0.00823211669921875,
-0.01458740234375,
-0.0205535888671875,
-0.0361328125,
0.0003204345703125,
0.01708984375,
-0.0306243896484375,
0.0012645721435546875,
0.08062744140625,
-0.034210205078125,
0.031646728515625,
-0.006450653076171875,
-0.0302734375,
0.058074951171875,
-0.06878662109375,
0.004795074462890625,
0.050445556640625,
-0.0167083740234375,
-0.09185791015625,
-0.01629638671875,
0.007511138916015625,
-0.0104522705078125,
-0.00861358642578125,
-0.007427215576171875,
0.0040283203125,
-0.04058837890625,
0.0396728515625,
-0.005584716796875,
-0.0160675048828125,
-0.005680084228515625,
0.03179931640625,
-0.00034427642822265625,
0.0087432861328125,
-0.004947662353515625,
-0.0116729736328125,
0.0306549072265625,
0.017578125,
-0.0164642333984375,
-0.0127716064453125,
-0.01114654541015625,
0.005901336669921875,
-0.03887939453125,
0.01971435546875,
0.11529541015625,
0.04833984375,
0.0230560302734375,
-0.0248260498046875,
-0.0200958251953125,
-0.01593017578125,
-0.00951385498046875,
-0.00482177734375,
0.01690673828125,
-0.03570556640625,
0.01558685302734375,
0.01120758056640625,
0.002292633056640625,
0.0482177734375,
0.0074615478515625,
-0.015869140625,
-0.01039886474609375,
-0.05743408203125,
0.00884246826171875,
-0.0777587890625,
0.0367431640625,
0.016082763671875,
-0.0291900634765625,
0.004474639892578125,
-0.0161895751953125,
-0.00434112548828125,
-0.0189971923828125,
-0.0187225341796875,
0.0170440673828125,
0.01806640625,
0.0177154541015625,
-0.053009033203125,
-0.0673828125,
-0.025421142578125,
-0.0447998046875,
-0.020965576171875,
0.011322021484375,
0.0426025390625,
-0.00946044921875,
0.0282135009765625,
-0.0182037353515625,
-0.0083160400390625,
-0.0137481689453125,
-0.028839111328125,
0.00934600830078125,
-0.03656005859375,
0.01346588134765625,
0.036102294921875,
-0.0357666015625,
-0.0306854248046875,
0.0213775634765625,
-0.01140594482421875,
-0.0333251953125,
0.01026153564453125,
0.02630615234375,
0.0311126708984375,
-0.004436492919921875,
0.01537322998046875,
0.05706787109375,
0.018280029296875,
-0.046905517578125,
-0.006740570068359375,
-0.029571533203125,
-0.0259857177734375,
0.04266357421875,
0.000023245811462402344,
-0.014404296875,
0.053466796875,
-0.006008148193359375,
0.006595611572265625,
-0.0126953125,
0.00652313232421875,
-0.03851318359375,
-0.0419921875,
-0.01000213623046875,
0.0229644775390625,
-0.045257568359375,
0.01605224609375,
0.025360107421875,
-0.01467132568359375,
-0.015838623046875,
-0.0243072509765625,
0.004573822021484375,
-0.01319122314453125,
-0.055328369140625,
-0.004146575927734375,
-0.0212554931640625,
0.04205322265625,
-0.06964111328125,
0.02032470703125,
-0.0455322265625,
-0.045623779296875,
0.06072998046875,
-0.0328369140625,
0.0025234222412109375,
-0.023956298828125,
0.044036865234375,
0.007434844970703125,
-0.0173187255859375,
-0.0006418228149414062,
0.042266845703125,
0.01378631591796875,
-0.04583740234375,
-0.01418304443359375,
-0.056610107421875,
-0.089599609375,
-0.01531982421875,
0.0908203125,
0.0177154541015625,
-0.002361297607421875,
-0.00911712646484375,
0.03741455078125,
0.0341796875,
-0.0253753662109375,
-0.00835418701171875,
0.021728515625,
0.0194854736328125,
0.038726806640625,
-0.01806640625,
-0.01151275634765625,
0.0194244384765625,
-0.059539794921875,
-0.0106964111328125,
0.050567626953125,
-0.0095367431640625,
-0.023284912109375,
0.009521484375,
-0.0019073486328125,
0.00035762786865234375,
-0.04327392578125,
-0.01313018798828125,
-0.0130157470703125,
0.03826904296875,
0.0096893310546875,
0.025604248046875,
0.0227203369140625,
-0.02960205078125,
0.02105712890625,
0.01165771484375,
-0.0526123046875,
0.0059661865234375,
-0.0082244873046875,
-0.0086212158203125,
0.05340576171875,
-0.048095703125,
0.0139312744140625,
0.0235137939453125,
-0.0008406639099121094,
-0.035552978515625,
0.0045318603515625,
0.021331787109375,
-0.004940032958984375,
-0.0006647109985351562,
-0.047576904296875,
0.033935546875,
-0.0222930908203125,
0.026153564453125,
-0.023651123046875,
-0.01448822021484375,
0.0216064453125,
-0.045806884765625,
0.07373046875,
0.0413818359375,
-0.037445068359375,
-0.00786590576171875,
-0.042205810546875,
0.044281005859375,
-0.035369873046875,
0.0029621124267578125,
0.0589599609375,
0.0142974853515625,
-0.001712799072265625,
-0.0021457672119140625,
0.0083465576171875,
-0.0379638671875,
0.0197906494140625,
-0.0268707275390625,
0.0010576248168945312,
-0.09381103515625,
-0.0010013580322265625,
0.02001953125,
0.04583740234375,
0.00942230224609375,
-0.0382080078125,
0.0269927978515625,
0.034088134765625,
-0.011505126953125,
-0.0270233154296875,
-0.036651611328125,
-0.045318603515625,
0.04046630859375,
-0.0171661376953125,
0.0012578964233398438,
-0.0179901123046875,
0.0076751708984375,
0.0177764892578125,
-0.0283203125,
-0.01441192626953125,
-0.03961181640625,
-0.03680419921875,
-0.048858642578125,
0.00421142578125,
-0.0027942657470703125,
0.007434844970703125,
-0.00029277801513671875,
0.10296630859375,
0.02105712890625,
-0.038360595703125,
0.0004024505615234375,
0.0281982421875,
-0.0246124267578125,
-0.004756927490234375,
-0.019744873046875,
0.001674652099609375,
0.0250396728515625,
-0.005908966064453125,
-0.0341796875,
0.00762176513671875,
0.00856781005859375,
-0.0204010009765625,
-0.01209259033203125,
-0.033905029296875,
-0.0065155029296875,
0.06182861328125,
0.02410888671875,
-0.005519866943359375,
0.048492431640625,
-0.0200653076171875,
-0.053375244140625,
0.003589630126953125,
-0.0809326171875,
0.009002685546875,
0.022857666015625,
0.024749755859375,
0.047271728515625,
-0.009368896484375,
0.005420684814453125,
0.0224609375,
-0.004608154296875,
0.003978729248046875,
0.015472412109375,
-0.0026035308837890625,
-0.006900787353515625,
0.0022144317626953125,
0.03363037109375,
-0.01120758056640625,
0.03009033203125,
0.026641845703125,
0.0028858184814453125,
0.01120758056640625,
-0.019744873046875,
-0.026153564453125,
-0.034332275390625,
0.006298065185546875,
-0.05926513671875,
0.06207275390625,
-0.06427001953125,
-0.008880615234375,
-0.01465606689453125,
0.073974609375,
-0.03173828125,
-0.0165557861328125,
-0.016448974609375,
0.021759033203125,
-0.01232147216796875,
-0.0771484375,
0.0174102783203125,
-0.0266265869140625,
0.03125,
0.006877899169921875,
-0.0340576171875,
0.04217529296875,
-0.0176849365234375,
0.0246429443359375,
0.032501220703125,
-0.0131072998046875,
0.0341796875,
-0.06170654296875,
0.04254150390625,
0.0185546875,
0.00717926025390625,
-0.004741668701171875,
-0.032073974609375,
-0.042724609375,
-0.0693359375,
-0.00001233816146850586,
-0.014556884765625,
0.0112762451171875,
-0.042724609375,
0.05352783203125,
-0.028106689453125,
0.006153106689453125,
-0.03387451171875,
0.01715087890625,
-0.0181884765625,
0.031768798828125,
-0.0168914794921875,
0.002025604248046875,
-0.017425537109375,
-0.01153564453125,
-0.0015020370483398438,
-0.00908660888671875,
-0.039093017578125,
-0.0005168914794921875,
-0.034088134765625,
-0.0126495361328125,
0.00043582916259765625,
-0.0246429443359375,
-0.003131866455078125,
-0.04046630859375,
-0.00475311279296875,
0.0183563232421875,
0.00801849365234375,
-0.018707275390625,
-0.0653076171875,
-0.03704833984375,
0.066162109375,
-0.032073974609375,
-0.0062103271484375,
-0.01081085205078125,
0.09173583984375,
0.0113983154296875,
-0.0232391357421875,
-0.0186309814453125,
-0.01024627685546875,
0.035858154296875,
0.00565338134765625,
0.0058441162109375,
-0.0141143798828125,
-0.043731689453125,
0.05584716796875,
0.006542205810546875,
-0.02978515625,
0.0028133392333984375,
0.0318603515625,
0.004421234130859375,
-0.029693603515625,
0.001155853271484375,
-0.0272674560546875,
0.031829833984375,
0.0186309814453125,
0.0020847320556640625,
0.01061248779296875,
0.00775146484375,
-0.003528594970703125,
-0.0283966064453125,
0.040496826171875,
0.0203857421875,
-0.042694091796875,
0.0200653076171875,
0.01427459716796875,
-0.023956298828125,
-0.01126861572265625,
0.0221405029296875,
-0.0286712646484375,
-0.038482666015625,
0.00290679931640625,
-0.0157928466796875,
-0.0010013580322265625,
0.0143890380859375,
0.03173828125,
0.0051116943359375,
0.01922607421875,
-0.0186614990234375,
-0.0003681182861328125,
-0.00360870361328125,
-0.018829345703125,
-0.045562744140625,
-0.0196380615234375,
-0.01030731201171875,
0.038330078125,
0.003986358642578125,
0.037017822265625,
-0.0033702850341796875,
0.0301361083984375,
0.0183258056640625,
0.0031108856201171875,
0.0550537109375,
0.041259765625,
0.00331878662109375,
-0.002849578857421875,
0.04339599609375,
-0.031341552734375,
-0.003047943115234375,
0.027069091796875,
0.035369873046875,
-0.01151275634765625,
-0.0268707275390625,
0.06329345703125,
0.061798095703125,
0.0241546630859375,
0.008392333984375,
0.01291656494140625,
-0.0259857177734375,
0.032379150390625,
-0.033172607421875,
-0.060577392578125,
-0.03515625,
0.007076263427734375,
0.04632568359375,
-0.03173828125,
-0.017730712890625,
0.04034423828125,
0.0034999847412109375,
-0.0180816650390625,
0.036834716796875,
0.0201263427734375,
-0.04852294921875,
-0.01502227783203125,
-0.012542724609375,
0.006031036376953125,
-0.01947021484375,
0.0031871795654296875,
-0.029510498046875,
-0.0245361328125,
-0.012115478515625,
0.025726318359375,
-0.017364501953125,
-0.0163421630859375,
-0.0161285400390625,
0.0189971923828125,
-0.029876708984375,
-0.00586700439453125,
0.0002455711364746094,
0.04693603515625,
-0.05584716796875,
-0.033233642578125,
0.020782470703125,
-0.0240478515625,
0.0218505859375,
-0.05535888671875,
0.036468505859375,
-0.0304107666015625,
0.00214385986328125,
0.028228759765625,
0.0218963623046875,
0.042755126953125,
-0.02423095703125,
-0.02703857421875,
-0.05291748046875,
-0.038726806640625,
-0.0076141357421875,
-0.04302978515625,
0.003673553466796875,
0.015716552734375,
0.027618408203125,
-0.021514892578125,
-0.046478271484375,
-0.01033782958984375,
0.005924224853515625,
0.0203857421875,
0.050628662109375,
-0.0202484130859375,
0.060455322265625,
0.01287078857421875,
0.0288543701171875,
-0.0007562637329101562,
0.007228851318359375,
-0.01009368896484375,
-0.010101318359375,
-0.0189361572265625,
-0.068115234375,
0.00864410400390625,
0.0284881591796875,
0.0016336441040039062,
0.03125,
0.0108795166015625,
0.0142974853515625,
0.0002181529998779297,
0.00324249267578125,
0.00608062744140625,
-0.00969696044921875,
-0.0026645660400390625,
0.01241302490234375,
-0.03045654296875,
0.0477294921875,
-0.0367431640625,
-0.0158843994140625,
-0.0003960132598876953,
0.01153564453125,
0.0176544189453125,
-0.033477783203125,
-0.0029926300048828125,
0.003955841064453125,
-0.034881591796875,
0.03314208984375,
0.061492919921875,
0.0194549560546875,
0.050872802734375,
0.0057525634765625,
0.022186279296875,
0.0197906494140625,
0.011566162109375,
-0.04498291015625,
-0.00836181640625,
0.0712890625,
0.0272674560546875,
-0.006855010986328125,
0.07501220703125,
-0.01690673828125,
0.0048675537109375,
0.062744140625,
0.0706787109375,
-0.056854248046875,
0.005340576171875,
0.044952392578125,
-0.007045745849609375,
0.01861572265625,
-0.034454345703125,
0.031158447265625,
-0.004032135009765625,
0.050384521484375,
0.0063629150390625,
-0.019927978515625,
0.00885772705078125,
-0.02874755859375,
0.0125579833984375,
-0.0183563232421875,
0.045654296875,
0.001895904541015625,
-0.06256103515625,
-0.0032901763916015625,
0.049530029296875,
-0.0205230712890625,
-0.01186370849609375,
0.007843017578125,
-0.00904083251953125,
-0.041229248046875,
-0.09503173828125,
-0.030853271484375,
0.0042572021484375,
-0.03662109375,
-0.0015277862548828125,
0.038787841796875,
0.0251007080078125,
0.06793212890625,
-0.00677490234375,
0.016815185546875,
0.033538818359375,
0.014373779296875,
-0.050079345703125,
-0.0184326171875,
-0.0007419586181640625,
0.0294189453125,
-0.0145263671875,
0.032379150390625,
-0.0155181884765625,
-0.0255584716796875,
0.0246124267578125,
0.012298583984375,
0.0284881591796875,
-0.0021839141845703125,
-0.0266265869140625,
0.01383209228515625,
-0.043670654296875,
0.026275634765625,
-0.0206146240234375,
0.029083251953125,
-0.05145263671875,
-0.010345458984375,
-0.00623321533203125,
-0.01263427734375,
-0.03240966796875,
-0.019683837890625,
-0.0989990234375,
0.1339111328125,
0.0538330078125,
0.0533447265625,
0.0029392242431640625,
0.033966064453125,
-0.06982421875,
-0.01357269287109375,
-0.039306640625,
0.061676025390625,
0.003223419189453125,
0.01387786865234375,
-0.032501220703125,
-0.006160736083984375,
0.01161956787109375,
0.01556396484375,
0.0413818359375,
-0.005283355712890625,
-0.0032367706298828125,
0.0027179718017578125,
0.08843994140625,
0.045806884765625,
0.01285552978515625,
0.0087127685546875,
-0.01641845703125,
0.013763427734375,
0.0469970703125,
-0.0237884521484375,
0.04119873046875,
-0.006336212158203125,
-0.0220794677734375,
-0.00811004638671875,
0.007373809814453125,
0.003276824951171875,
0.0234832763671875,
-0.0308380126953125,
-0.01861572265625,
0.008697509765625,
0.002071380615234375,
0.0240325927734375,
0.01189422607421875,
0.0092926025390625,
0.034759521484375,
-0.06695556640625,
0.0126190185546875,
-0.03399658203125,
0.04998779296875,
0.00919342041015625,
0.01904296875,
0.0338134765625,
0.01129150390625,
0.05511474609375,
0.01265716552734375,
0.009124755859375,
0.01474761962890625,
0.016021728515625,
-0.0018644332885742188,
0.0131683349609375,
0.0291595458984375,
-0.0208892822265625,
-0.0159912109375,
0.0657958984375,
0.032318115234375,
-0.017913818359375,
0.005893707275390625,
0.00814056396484375,
0.01529693603515625,
-0.0303955078125,
-0.047821044921875,
-0.0098114013671875,
0.0025463104248046875,
0.039520263671875,
-0.011932373046875,
0.006923675537109375,
0.026275634765625,
0.0164337158203125,
-0.00775146484375,
-0.0060272216796875,
-0.0186920166015625,
0.00569915771484375,
-0.041046142578125,
-0.0012331008911132812,
0.006130218505859375,
0.0819091796875,
0.0308380126953125,
0.042572021484375,
-0.046234130859375,
-0.0161590576171875,
-0.0064849853515625,
0.01331329345703125,
0.037872314453125,
-0.01065826416015625,
-0.006694793701171875,
-0.00829315185546875,
0.0185699462890625,
0.0011615753173828125,
0.038604736328125,
0.07000732421875,
0.049713134765625,
0.01025390625,
-0.005306243896484375,
0.0167388916015625,
0.00011026859283447266,
-0.039398193359375,
-0.046661376953125,
-0.00949859619140625,
-0.0259552001953125,
0.01556396484375,
-0.0139007568359375,
0.007476806640625,
0.062225341796875,
-0.0271453857421875,
-0.0372314453125,
0.004314422607421875,
-0.005428314208984375,
-0.03955078125,
0.04296875,
-0.0031585693359375,
0.04620361328125,
-0.006435394287109375,
-0.043548583984375,
-0.011627197265625,
-0.0162353515625,
-0.0068511962890625,
-0.006664276123046875,
0.0151519775390625,
-0.00803375244140625,
0.03350830078125,
0.020263671875,
0.0053558349609375,
-0.0079345703125,
-0.01021575927734375,
0.031341552734375,
0.0306396484375,
0.015869140625,
0.04022216796875,
-0.05413818359375,
-0.01096343994140625,
-0.00618743896484375,
-0.004932403564453125,
0.007579803466796875,
0.01058197021484375,
0.0198211669921875,
0.00582122802734375,
-0.030029296875,
0.0200958251953125,
-0.049285888671875,
-0.0313720703125,
-0.009002685546875,
-0.02130126953125,
0.01373291015625,
0.01302337646484375,
-0.0732421875,
0.0132904052734375,
0.01470947265625,
0.028411865234375,
0.032501220703125,
-0.04205322265625,
0.0293121337890625,
0.00861358642578125,
0.0254058837890625,
-0.01523590087890625,
0.0200042724609375,
-0.0239410400390625,
-0.0228271484375,
0.054779052734375,
0.0243988037109375,
0.009246826171875,
0.041290283203125,
-0.03338623046875,
-0.038238525390625,
0.031707763671875,
-0.087646484375,
0.0225982666015625,
0.02825927734375,
-0.01117706298828125,
0.01189422607421875,
-0.00559234619140625,
-0.01739501953125,
-0.00933837890625,
0.03302001953125,
-0.0247955322265625,
-0.004322052001953125,
-0.007236480712890625,
-0.029327392578125,
0.0090179443359375,
0.03204345703125,
-0.02703857421875,
0.029510498046875,
-0.01380157470703125,
-0.00980377197265625,
-0.004634857177734375,
-0.007045745849609375,
-0.00972747802734375,
-0.040252685546875,
-0.032867431640625,
-0.006198883056640625,
-0.04388427734375,
-0.054901123046875,
-0.008697509765625,
-0.0218048095703125,
-0.0178680419921875,
-0.0225677490234375,
-0.006206512451171875,
-0.02264404296875,
-0.0184173583984375,
0.0053558349609375,
-0.0430908203125,
0.0228118896484375,
0.00911712646484375,
0.040496826171875,
-0.043487548828125,
-0.01462554931640625,
0.00485992431640625,
0.00714874267578125,
-0.005035400390625,
-0.015625,
0.03656005859375,
-0.0197906494140625,
-0.0643310546875,
-0.04144287109375,
-0.01155853271484375,
-0.00469207763671875,
0.00823211669921875,
-0.0086212158203125,
-0.00601959228515625,
0.0207977294921875,
-0.0218658447265625,
-0.07110595703125,
0.017425537109375,
-0.0677490234375,
-0.0135650634765625,
-0.0484619140625,
0.0004744529724121094,
-0.010589599609375,
-0.044586181640625,
-0.058990478515625,
0.07965087890625,
-0.016265869140625,
-0.018707275390625,
0.004474639892578125,
0.01024627685546875,
-0.020172119140625,
0.062408447265625,
0.03204345703125,
-0.056610107421875,
0.011993408203125,
0.008209228515625,
0.003437042236328125,
-0.0223236083984375,
0.04632568359375,
-0.0284423828125,
-0.05859375,
-0.020538330078125,
-0.01027679443359375,
-0.0126800537109375,
0.0304412841796875,
-0.01507568359375,
0.00818634033203125,
0.0271453857421875,
-0.04632568359375,
-0.0030670166015625,
-0.04193115234375,
-0.015594482421875,
-0.01337432861328125,
-0.03375244140625,
-0.0134429931640625,
-0.0131988525390625,
0.08990478515625,
0.034088134765625,
0.021942138671875,
-0.037933349609375,
-0.0035572052001953125,
-0.03594970703125,
-0.05194091796875,
0.0158233642578125,
0.023223876953125,
-0.0496826171875,
0.00908660888671875,
0.0145416259765625,
0.025909423828125,
0.00696563720703125,
-0.021148681640625,
0.01422119140625,
-0.05096435546875,
-0.0271148681640625,
-0.0301361083984375,
0.006587982177734375,
-0.05889892578125,
0.0745849609375,
-0.0374755859375,
-0.0244598388671875,
0.0189208984375,
0.033721923828125,
-0.0024471282958984375,
0.0153350830078125,
0.016021728515625,
0.0281524658203125,
-0.048980712890625,
-0.0226593017578125,
0.01947021484375,
0.031951904296875,
-0.006595611572265625,
-0.0172882080078125,
-0.01131439208984375,
0.0013980865478515625,
-0.0005736351013183594,
-0.0022563934326171875,
-0.0105743408203125,
0.025146484375,
-0.002513885498046875,
0.07501220703125,
-0.02069091796875,
-0.0207366943359375,
-0.005138397216796875,
-0.0002332925796508789,
0.002941131591796875,
-0.00412750244140625,
0.0494384765625,
-0.0195770263671875,
0.0189361572265625,
-0.0013761520385742188,
0.009674072265625,
0.003147125244140625,
0.005130767822265625,
-0.005809783935546875,
0.0052032470703125,
-0.0010957717895507812
] |
7f967b2713a6e217fc90fd082f58b5612e371d29
|
Wordpress Stackexchange
Q: Wordpress slug issue with non-latin characters I'm using permalinks in WP as: domain.com/category/post_name
The issue is that post names have non-latin characters such as chinese, hebrew, and arabic. So it encodes them to something like: %20%18%6b%20 therefore it counts every symbol's character as an actual character, ending up with 3x times more length that it truncates some very short slugs.
How to fix that? Or how to extend the length limit at least? I've tried to extend the length of the database field "post_name" from 200 to 500, But it's still truncating short.
A: Apart from sanitizing, the only way to extend length of slug is modifying WP code
in file wp-includes/formatting.php:
replace 200 accordingly:
$title = utf8_uri_encode($title, 200);
in file: wp-includes/post.php search for 3 lines with:
$alt_post_name = substr( $slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
The problem will hunt You down with each WP update
|
Q: Wordpress slug issue with non-latin characters I'm using permalinks in WP as: domain.com/category/post_name
The issue is that post names have non-latin characters such as chinese, hebrew, and arabic. So it encodes them to something like: %20%18%6b%20 therefore it counts every symbol's character as an actual character, ending up with 3x times more length that it truncates some very short slugs.
How to fix that? Or how to extend the length limit at least? I've tried to extend the length of the database field "post_name" from 200 to 500, But it's still truncating short.
A: Apart from sanitizing, the only way to extend length of slug is modifying WP code
in file wp-includes/formatting.php:
replace 200 accordingly:
$title = utf8_uri_encode($title, 200);
in file: wp-includes/post.php search for 3 lines with:
$alt_post_name = substr( $slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
The problem will hunt You down with each WP update
A: Permalinks like http://example/שָׁלוֹם are actually working in my WordPress 3.3. Could be the remove_accents() improvements for i18n permalinks.
As Sean & Steve noted,
*
*make sure you're using WordPress ≥ 3.3
*make sure your .htaccess file contains a rule similar to RewriteRule . /index.php [L]
*check that your database is UTF-8 encoded (and consider converting to UTF-8 if not).
[My original answer follows, not so relevant now but maybe still useful:]
See
*
*http://queryposts.com/function/sanitize_title/
*http://queryposts.com/function/remove_accents/
*http://queryposts.com/function/esc_url/
If your post titles contain some ASCII characters, you can strip out non-ASCII characters when generating post slugs.
Some plugins may help:
*
*http://wordpress.org/extend/plugins/strings-sanitizer/
Aggressively sanitizes titles for clean, SEO friendly post slugs, and media filenames during upload. Works by converting common accentuated UTF-8 characters, as well as a few special cyrillic, hebrew, spanish and german characters.
*http://wordpress.org/extend/plugins/universal-slugs/
[…] if you happen to speak a language that uses characted that are not included on the English alphabet, then you either have to bear with massive, odd looking permalinks, or manually update each one whenever you write a post or a page. […] The plugin will also remove common words such as "and", "και", "το", "the" etc. from the URLs, as they do simply contribute to the URL length without adding anything to the meaning or the SEO value.
*http://wordpress.org/extend/plugins/pinyin-slug/
For example, when you publish a post with a title like this: "Chinese PinYin" Wordpress automatically assigns a long filename to your post, called a post slug: /%e4%b8%ad%e6%96%87%e6%8b%bc%e9%9f%b3 […] With Chinese PinYin plugin activated, the slug for our example blog post would look like this: /zhongwenpinyin
*http://wordpress.org/extend/plugins/remove-utf-8-from-slug/
remove all UTF-8 from title to permalink
*http://wordpress.org/extend/plugins/pinyin-seo/
Convert Chinese characters to Pinyin Permalinks.
Also, some of the multilingual plugins might be able to translate your slugs into English (and hence Latin-only characters) automatically, but I haven't used any of them, so I'm not sure.
|
wordpress
|
{
"language": "en",
"length": 463,
"provenance": "stackexchange_00019.jsonl.gz:419774",
"question_score": "11",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51498"
}
|
[
0.0164337158203125,
-0.0203857421875,
0.0103607177734375,
0.034423828125,
-0.03778076171875,
-0.0192718505859375,
0.030303955078125,
-0.055877685546875,
0.001171112060546875,
0.030731201171875,
0.028472900390625,
0.0012340545654296875,
0.01238250732421875,
-0.0244598388671875,
-0.003936767578125,
0.0190277099609375,
0.018157958984375,
-0.006679534912109375,
0.03466796875,
-0.013214111328125,
0.0035610198974609375,
0.00145721435546875,
0.0202178955078125,
-0.0026302337646484375,
0.01128387451171875,
-0.049102783203125,
0.11663818359375,
-0.05877685546875,
0.007770538330078125,
-0.075439453125,
0.0177001953125,
0.04046630859375,
0.01517486572265625,
-0.0078582763671875,
0.015899658203125,
0.04718017578125,
0.0025386810302734375,
0.00286865234375,
0.0088653564453125,
0.00396728515625,
0.02117919921875,
-0.023651123046875,
0.05279541015625,
0.043365478515625,
0.0203704833984375,
-0.033294677734375,
0.02081298828125,
-0.0728759765625,
0.01430511474609375,
0.003276824951171875,
-0.004222869873046875,
0.02105712890625,
0.0038299560546875,
-0.008819580078125,
-0.01363372802734375,
-0.0121612548828125,
-0.0308837890625,
0.02752685546875,
0.036529541015625,
-0.007152557373046875,
-0.034698486328125,
-0.00870513916015625,
0.008636474609375,
-0.01416015625,
-0.0084075927734375,
0.004425048828125,
0.033294677734375,
-0.001983642578125,
-0.0215911865234375,
0.003162384033203125,
0.02667236328125,
-0.0219879150390625,
-0.01531982421875,
-0.021087646484375,
-0.02508544921875,
0.016143798828125,
-0.0186920166015625,
-0.01129913330078125,
0.0187835693359375,
0.004947662353515625,
0.0221710205078125,
-0.016357421875,
-0.0028743743896484375,
0.00007110834121704102,
-0.0092926025390625,
0.0101318359375,
-0.01025390625,
-0.0191802978515625,
-0.0265350341796875,
-0.049591064453125,
-0.02667236328125,
-0.0252532958984375,
-0.06787109375,
0.01421356201171875,
0.00812530517578125,
-0.031707763671875,
0.019134521484375,
0.0081634521484375,
0.0078582763671875,
0.0209197998046875,
0.05572509765625,
-0.08453369140625,
0.09954833984375,
-0.0266876220703125,
0.0158538818359375,
0.01552581787109375,
0.0160064697265625,
0.0615234375,
0.055419921875,
0.0093994140625,
-0.006011962890625,
0.053497314453125,
-0.010101318359375,
-0.03948974609375,
-0.0013246536254882812,
0.054168701171875,
-0.0089874267578125,
0.029632568359375,
0.004299163818359375,
0.01270294189453125,
0.0015134811401367188,
0.0180511474609375,
0.0017547607421875,
-0.0116424560546875,
0.0200347900390625,
0.01004791259765625,
-0.0161590576171875,
-0.02545166015625,
0.01297760009765625,
0.06011962890625,
-0.03643798828125,
-0.0185699462890625,
0.03326416015625,
0.0230560302734375,
-0.00991058349609375,
-0.038055419921875,
0.017913818359375,
-0.0174560546875,
-0.0166778564453125,
0.029998779296875,
-0.034027099609375,
-0.00041866302490234375,
0.03936767578125,
-0.0302276611328125,
0.0264739990234375,
0.016632080078125,
-0.01397705078125,
0.00789642333984375,
0.034912109375,
-0.004425048828125,
-0.007396697998046875,
-0.0594482421875,
0.07806396484375,
-0.00476837158203125,
-0.0936279296875,
-0.046844482421875,
0.0019245147705078125,
-0.052032470703125,
-0.0340576171875,
-0.08917236328125,
-0.05291748046875,
-0.0226898193359375,
0.0423583984375,
-0.038116455078125,
-0.0616455078125,
0.059173583984375,
-0.019439697265625,
-0.01788330078125,
0.00955963134765625,
-0.007572174072265625,
-0.004985809326171875,
0.0012407302856445312,
-0.022918701171875,
-0.03961181640625,
-0.01111602783203125,
-0.01145172119140625,
0.0016460418701171875,
0.01436614990234375,
0.026275634765625,
0.056396484375,
0.0257568359375,
-0.0176849365234375,
0.050933837890625,
0.0010852813720703125,
-0.0625,
0.0128326416015625,
0.0271759033203125,
0.052154541015625,
-0.0029506683349609375,
0.003177642822265625,
0.06304931640625,
0.023345947265625,
-0.055084228515625,
0.01300048828125,
-0.004940032958984375,
-0.003543853759765625,
0.0184173583984375,
0.00004315376281738281,
0.0157470703125,
-0.005695343017578125,
0.01224517822265625,
-0.005237579345703125,
-0.004180908203125,
-0.0019207000732421875,
-0.068603515625,
0.00786590576171875,
-0.01861572265625,
0.0252227783203125,
0.000514984130859375,
0.040130615234375,
0.0141143798828125,
0.004566192626953125,
-0.053192138671875,
0.039337158203125,
0.0030422210693359375,
0.028167724609375,
0.01357269287109375,
-0.00281524658203125,
-0.0286407470703125,
0.0238494873046875,
-0.012298583984375,
-0.0283050537109375,
-0.033905029296875,
0.03692626953125,
0.0207061767578125,
-0.00545501708984375,
-0.0160064697265625,
-0.0146636962890625,
-0.002086639404296875,
-0.00489044189453125,
-0.00688934326171875,
0.038909912109375,
0.04315185546875,
-0.007965087890625,
-0.0501708984375,
0.01593017578125,
-0.00984954833984375,
-0.0189056396484375,
-0.0095367431640625,
0.043731689453125,
0.04095458984375,
0.02496337890625,
-0.0283660888671875,
-0.0635986328125,
0.0046234130859375,
-0.060546875,
0.018768310546875,
-0.05126953125,
-0.0169525146484375,
0.003795623779296875,
0.0144195556640625,
0.0250396728515625,
0.028350830078125,
0.01372528076171875,
-0.0272979736328125,
0.058807373046875,
-0.0233612060546875,
-0.0523681640625,
0.007534027099609375,
0.01427459716796875,
0.0296783447265625,
-0.0244598388671875,
-0.036529541015625,
0.0014791488647460938,
-0.0435791015625,
0.01123809814453125,
-0.00878143310546875,
-0.00008392333984375,
-0.010833740234375,
0.01244354248046875,
0.031158447265625,
-0.0033206939697265625,
-0.0162353515625,
0.0008974075317382812,
0.0122222900390625,
-0.020263671875,
-0.028533935546875,
0.033355712890625,
-0.014495849609375,
-0.0183868408203125,
0.008697509765625,
0.07867431640625,
0.036773681640625,
-0.0045013427734375,
-0.0343017578125,
-0.09033203125,
-0.008544921875,
0.0183868408203125,
-0.0203399658203125,
-0.03240966796875,
-0.00040030479431152344,
0.0240478515625,
-0.035003662109375,
0.022186279296875,
0.0274810791015625,
-0.0264739990234375,
0.05841064453125,
-0.0125732421875,
0.0201416015625,
-0.03826904296875,
0.0404052734375,
0.035736083984375,
-0.04449462890625,
0.003326416015625,
-0.0014314651489257812,
-0.00714111328125,
-0.039642333984375,
0.0308380126953125,
-0.021759033203125,
-0.06591796875,
-0.0189056396484375,
0.0027141571044921875,
0.0214385986328125,
0.03399658203125,
-0.0182342529296875,
-0.045440673828125,
0.005352020263671875,
0.0201416015625,
-0.06732177734375,
-0.06182861328125,
0.00884246826171875,
-0.00945281982421875,
0.0050048828125,
0.01253509521484375,
0.007366180419921875,
-0.021240234375,
0.005695343017578125,
-0.0022430419921875,
-0.01068115234375,
-0.0338134765625,
-0.053558349609375,
-0.057342529296875,
-0.0433349609375,
-0.011260986328125,
0.0015001296997070312,
0.004711151123046875,
-0.003986358642578125,
-0.033416748046875,
-0.0245208740234375,
-0.0191802978515625,
-0.0122528076171875,
0.0633544921875,
0.00030303001403808594,
-0.0540771484375,
0.002048492431640625,
-0.0025463104248046875,
-0.0033740997314453125,
0.002231597900390625,
0.01093292236328125,
0.029541015625,
-0.0223846435546875,
-0.0007414817810058594,
0.005550384521484375,
-0.0113983154296875,
0.0274658203125,
-0.023345947265625,
-0.0200653076171875,
0.0162811279296875,
0.00885009765625,
-0.0413818359375,
-0.0280609130859375,
-0.0295257568359375,
-0.055023193359375,
0.0369873046875,
0.02166748046875,
0.0083770751953125,
-0.00988006591796875,
0.0216827392578125,
-0.0059051513671875,
-0.0008363723754882812,
0.0010356903076171875,
-0.033172607421875,
0.017425537109375,
-0.0012760162353515625,
0.01366424560546875,
-0.003833770751953125,
0.017730712890625,
-0.00736236572265625,
0.0298004150390625,
0.00592041015625,
0.0155029296875,
0.007724761962890625,
-0.007293701171875,
-0.006694793701171875,
-0.043792724609375,
0.044952392578125,
-0.043670654296875,
0.0155029296875,
-0.0509033203125,
-0.025054931640625,
-0.03240966796875,
0.07196044921875,
-0.0023212432861328125,
-0.035308837890625,
-0.03472900390625,
0.00679779052734375,
-0.01404571533203125,
-0.0269927978515625,
0.014404296875,
-0.01084136962890625,
-0.029205322265625,
-0.0159759521484375,
0.00022864341735839844,
-0.03125,
-0.017486572265625,
0.04754638671875,
-0.0163726806640625,
-0.01055908203125,
0.024658203125,
0.01473236083984375,
-0.00647735595703125,
-0.0281219482421875,
-0.0018892288208007812,
-0.0361328125,
-0.0154876708984375,
-0.009979248046875,
-0.07440185546875,
-0.0224456787109375,
-0.0033779144287109375,
0.05877685546875,
-0.015594482421875,
0.00249481201171875,
-0.0213775634765625,
0.06475830078125,
0.0151519775390625,
0.02130126953125,
0.023468017578125,
0.0013513565063476562,
0.036224365234375,
0.052886962890625,
0.038177490234375,
0.00736236572265625,
0.01025390625,
0.0011005401611328125,
-0.0338134765625,
0.016693115234375,
-0.0267791748046875,
-0.002399444580078125,
0.0027446746826171875,
-0.04541015625,
-0.051177978515625,
-0.0233154296875,
-0.0107879638671875,
0.04473876953125,
-0.04644775390625,
0.05511474609375,
-0.04095458984375,
-0.050628662109375,
0.050811767578125,
0.035064697265625,
0.01157379150390625,
-0.00225830078125,
0.0265655517578125,
-0.01273345947265625,
-0.0587158203125,
-0.0198516845703125,
-0.01403045654296875,
0.006702423095703125,
-0.00904083251953125,
0.0751953125,
0.0222015380859375,
0.006267547607421875,
0.044158935546875,
-0.005306243896484375,
-0.03668212890625,
0.0007328987121582031,
-0.00499725341796875,
0.0202178955078125,
-0.00994110107421875,
-0.00479888916015625,
0.00677490234375,
0.051605224609375,
0.040771484375,
-0.018707275390625,
0.00597381591796875,
-0.03521728515625,
0.02294921875,
-0.00072479248046875,
-0.0016946792602539062,
-0.044891357421875,
-0.0604248046875,
0.032928466796875,
-0.0323486328125,
0.003185272216796875,
-0.00753021240234375,
-0.001201629638671875,
0.0111083984375,
-0.018341064453125,
0.0004100799560546875,
-0.007144927978515625,
0.00441741943359375,
-0.00405120849609375,
0.03955078125,
-0.0202484130859375,
-0.002490997314453125,
-0.0137786865234375,
-0.0123138427734375,
0.034271240234375,
0.0155181884765625,
0.00936126708984375,
-0.040283203125,
-0.0174102783203125,
0.0209808349609375,
-0.01544952392578125,
0.0121002197265625,
-0.02349853515625,
0.019073486328125,
0.016571044921875,
0.016510009765625,
0.01436614990234375,
0.006565093994140625,
-0.00601959228515625,
0.028656005859375,
0.0028171539306640625,
-0.00386810302734375,
0.0088043212890625,
0.06591796875,
0.024017333984375,
0.030059814453125,
-0.020355224609375,
-0.01473236083984375,
-0.0014257431030273438,
0.066650390625,
0.03814697265625,
-0.0789794921875,
-0.01861572265625,
0.058929443359375,
-0.0183868408203125,
-0.038177490234375,
-0.0033473968505859375,
0.01190948486328125,
0.044342041015625,
-0.018096923828125,
-0.024810791015625,
0.029754638671875,
-0.031707763671875,
-0.024200439453125,
0.0086517333984375,
0.021026611328125,
-0.0201568603515625,
-0.0201416015625,
0.023590087890625,
0.016998291015625,
0.004787445068359375,
-0.0182342529296875,
0.00511932373046875,
-0.0321044921875,
0.0228271484375,
0.041900634765625,
0.027374267578125,
-0.023956298828125,
-0.045623779296875,
0.00994110107421875,
-0.006008148193359375,
-0.019073486328125,
0.03143310546875,
-0.02099609375,
0.0082550048828125,
-0.01078033447265625,
0.02191162109375,
-0.00559234619140625,
0.04925537109375,
-0.0110626220703125,
-0.019622802734375,
0.048553466796875,
0.0143585205078125,
0.03558349609375,
-0.005924224853515625,
-0.0228729248046875,
-0.004764556884765625,
-0.0029239654541015625,
0.007366180419921875,
0.06341552734375,
-0.0196990966796875,
-0.01479339599609375,
-0.042572021484375,
0.024017333984375,
-0.00745391845703125,
0.024322509765625,
0.0001951456069946289,
-0.038116455078125,
0.039337158203125,
0.051513671875,
0.0283966064453125,
-0.041412353515625,
0.00713348388671875,
0.0312042236328125,
-0.0252685546875,
-0.015106201171875,
0.026123046875,
0.079345703125,
-0.0227813720703125,
0.0104217529296875,
-0.0175628662109375,
-0.0167388916015625,
0.022796630859375,
-0.01580810546875,
-0.005298614501953125,
0.03167724609375,
-0.0032291412353515625,
0.0213165283203125,
-0.0177764892578125,
0.00511932373046875,
-0.01343536376953125,
0.038665771484375,
-0.051483154296875,
-0.02508544921875,
0.038970947265625,
0.01078033447265625,
0.01549530029296875,
-0.027069091796875,
-0.028106689453125,
0.035247802734375,
-0.0029544830322265625,
0.0252685546875,
-0.00977325439453125,
0.01153564453125,
0.0101776123046875,
0.0106048583984375,
0.019500732421875,
0.0304412841796875,
0.0203094482421875,
0.03790283203125,
0.0005965232849121094,
-0.032684326171875,
0.019256591796875,
0.0413818359375,
0.047454833984375,
-0.008697509765625,
0.0266571044921875,
0.032073974609375,
-0.01160430908203125,
0.00980377197265625,
0.052520751953125,
0.07183837890625,
-0.03485107421875,
-0.0228729248046875,
0.007114410400390625,
-0.0557861328125,
-0.0159759521484375,
0.0082550048828125,
0.0024242401123046875,
-0.0012035369873046875,
0.0401611328125,
-0.06268310546875,
-0.0028705596923828125,
0.02557373046875,
-0.0198211669921875,
-0.004161834716796875,
-0.0157623291015625,
0.04931640625,
0.0212554931640625,
0.0166168212890625,
-0.0241546630859375,
-0.01464080810546875,
0.01983642578125,
-0.01305389404296875,
-0.0440673828125,
0.028106689453125,
-0.046234130859375,
-0.034088134765625,
0.02410888671875,
-0.054351806640625,
0.0285491943359375,
0.0509033203125,
0.03759765625,
0.024139404296875,
0.038055419921875,
0.021392822265625,
-0.01873779296875,
0.01096343994140625,
-0.04302978515625,
0.07513427734375,
-0.004444122314453125,
-0.0211181640625,
0.041595458984375,
-0.006954193115234375,
-0.022216796875,
0.01087188720703125,
0.0215911865234375,
-0.005218505859375,
-0.0421142578125,
0.06561279296875,
-0.030120849609375,
-0.0158538818359375,
0.0159149169921875,
-0.0129241943359375,
-0.0209808349609375,
0.0032062530517578125,
0.0110321044921875,
-0.05072021484375,
-0.037200927734375,
-0.002490997314453125,
-0.06964111328125,
-0.01904296875,
-0.0109710693359375,
-0.08221435546875,
0.08447265625,
0.007724761962890625,
0.06591796875,
0.01134490966796875,
0.0206146240234375,
-0.0215301513671875,
-0.0023441314697265625,
-0.040069580078125,
0.0546875,
-0.004795074462890625,
0.036163330078125,
-0.05914306640625,
0.00485992431640625,
-0.007694244384765625,
0.020538330078125,
0.048736572265625,
0.004913330078125,
0.01212310791015625,
-0.00879669189453125,
0.05218505859375,
0.0311737060546875,
-0.0062408447265625,
0.009857177734375,
0.01107025146484375,
0.0248870849609375,
0.0631103515625,
-0.0228271484375,
0.0271759033203125,
0.01256561279296875,
-0.01340484619140625,
0.01812744140625,
0.0171356201171875,
0.0150604248046875,
0.0198516845703125,
-0.01282501220703125,
-0.0226287841796875,
0.00931549072265625,
0.025634765625,
-0.0294647216796875,
0.01580810546875,
0.0182037353515625,
0.04351806640625,
-0.07373046875,
-0.0450439453125,
-0.0308074951171875,
0.04547119140625,
0.00925445556640625,
0.01000213623046875,
0.01898193359375,
0.00562286376953125,
0.036346435546875,
-0.01824951171875,
-0.00757598876953125,
0.0016069412231445312,
-0.0128021240234375,
0.060302734375,
0.042388916015625,
0.0229949951171875,
0.0005221366882324219,
0.01103973388671875,
0.049224853515625,
0.0635986328125,
-0.049896240234375,
-0.0302886962890625,
-0.002368927001953125,
0.0166778564453125,
0.003917694091796875,
-0.01375579833984375,
0.0045928955078125,
0.0182952880859375,
0.0421142578125,
-0.03717041015625,
-0.005390167236328125,
0.035247802734375,
0.060760498046875,
-0.00156402587890625,
-0.03656005859375,
-0.0474853515625,
-0.01177215576171875,
-0.06890869140625,
0.02203369140625,
0.004642486572265625,
0.08648681640625,
0.04168701171875,
0.060699462890625,
-0.004436492919921875,
-0.039703369140625,
0.037445068359375,
0.0036716461181640625,
0.0003681182861328125,
-0.06256103515625,
0.0157318115234375,
-0.04156494140625,
0.0212860107421875,
0.01336669921875,
0.0179290771484375,
-0.0245361328125,
0.058074951171875,
0.03973388671875,
-0.041839599609375,
-0.03619384765625,
-0.01409149169921875,
-0.0129852294921875,
0.044708251953125,
-0.0328369140625,
0.046173095703125,
-0.004467010498046875,
6.556510925292969e-7,
-0.0518798828125,
0.0306854248046875,
0.0207672119140625,
0.0033779144287109375,
0.022216796875,
0.01318359375,
0.00658416748046875,
0.0352783203125,
0.0501708984375,
0.005611419677734375,
0.05767822265625,
-0.03326416015625,
-0.01253509521484375,
-0.0103759765625,
-0.045379638671875,
0.020751953125,
0.04107666015625,
-0.0008974075317382812,
0.0025482177734375,
0.002971649169921875,
-0.044158935546875,
0.021697998046875,
0.0258636474609375,
0.021087646484375,
0.0238037109375,
0.0035915374755859375,
-0.0034389495849609375,
-0.02056884765625,
-0.0126190185546875,
-0.010040283203125,
0.04351806640625,
-0.0178375244140625,
0.1016845703125,
-0.0499267578125,
-0.004505157470703125,
-0.030670166015625,
-0.00679779052734375,
-0.014251708984375,
-0.00696563720703125,
0.0085906982421875,
0.0228424072265625,
0.0033550262451171875,
-0.025970458984375,
0.0038013458251953125,
-0.0179443359375,
0.035675048828125,
-0.05462646484375,
-0.0197296142578125,
-0.04632568359375,
0.02337646484375,
-0.016448974609375,
0.035980224609375,
-0.032501220703125,
-0.054443359375,
-0.07366943359375,
-0.0026988983154296875,
0.0183563232421875,
0.0023212432861328125,
-0.034149169921875,
0.0462646484375,
-0.038848876953125,
0.0034542083740234375,
0.00135040283203125,
-0.03485107421875,
-0.0305328369140625,
0.0258636474609375,
-0.022735595703125,
-0.004085540771484375,
-0.037933349609375,
-0.031036376953125,
-0.01055908203125,
0.00133514404296875,
-0.007415771484375,
-0.0169830322265625,
-0.0178375244140625,
0.006988525390625,
-0.00012791156768798828,
0.0163116455078125,
-0.01415252685546875,
0.0132293701171875,
-0.0163116455078125,
0.0137939453125,
0.0379638671875,
-0.004848480224609375,
-0.0184326171875,
-0.045501708984375,
-0.004764556884765625,
0.0162811279296875,
-0.0219268798828125,
0.00806427001953125,
-0.0100555419921875,
-0.01175689697265625,
0.0219573974609375,
-0.00997161865234375,
-0.01214599609375,
0.007137298583984375,
-0.0156402587890625,
0.0306854248046875,
-0.033416748046875,
-0.0012731552124023438,
-0.01174163818359375,
0.0097503662109375,
-0.043609619140625,
-0.0645751953125,
-0.033782958984375,
0.04779052734375,
-0.049041748046875,
-0.0011682510375976562,
0.03289794921875,
-0.0323486328125,
-0.07098388671875,
-0.0168609619140625,
0.0203704833984375,
0.01186370849609375,
0.049224853515625,
-0.004589080810546875,
0.035186767578125,
0.006931304931640625,
-0.046142578125,
-0.094482421875,
0.0055389404296875,
-0.06805419921875,
0.0046844482421875,
0.01105499267578125,
-0.022735595703125,
-0.0001773834228515625,
-0.032928466796875,
-0.0287933349609375,
0.0238494873046875,
0.0289764404296875,
-0.020355224609375,
-0.04150390625,
0.005733489990234375,
-0.0018482208251953125,
0.052947998046875,
0.004215240478515625,
-0.00909423828125,
-0.035919189453125,
0.0253143310546875,
0.033050537109375,
0.02020263671875,
0.004558563232421875,
0.04443359375,
0.0143890380859375,
0.07696533203125,
0.058746337890625,
0.01140594482421875,
0.05126953125,
-0.0219879150390625,
0.0213775634765625,
0.04150390625,
-0.058746337890625,
-0.039825439453125,
-0.05316162109375,
-0.035125732421875,
-0.0308990478515625,
-0.06988525390625,
-0.028076171875,
-0.02679443359375,
0.122802734375,
0.0188751220703125,
0.0193634033203125,
-0.0246429443359375,
-0.00994873046875,
-0.020477294921875,
-0.00003594160079956055,
-0.0135040283203125,
0.0254669189453125,
-0.07086181640625,
-0.0066375732421875,
0.0052490234375,
0.030029296875,
0.00136566162109375,
-0.02679443359375,
0.011322021484375,
-0.0236968994140625,
0.01541900634765625,
0.00827789306640625,
-0.02593994140625,
-0.005401611328125,
0.03765869140625,
-0.0228271484375,
0.00466156005859375,
-0.009368896484375,
0.0206298828125,
0.01495361328125,
0.0062713623046875,
-0.0703125,
-0.05645751953125,
0.0516357421875,
0.0467529296875,
-0.0226898193359375,
0.036376953125,
-0.002826690673828125,
0.02880859375,
0.0230255126953125,
0.024383544921875,
-0.00214385986328125,
0.033050537109375,
-0.00614166259765625,
0.024017333984375,
-0.01151275634765625,
0.01523590087890625,
-0.01303863525390625,
-0.0831298828125,
-0.0133209228515625,
0.0153045654296875,
-0.037872314453125,
-0.0034656524658203125,
0.006267547607421875,
-0.06365966796875,
0.0121002197265625,
-0.02520751953125,
0.00518798828125,
-0.0120849609375,
-0.0081939697265625,
-0.047454833984375,
-0.0142822265625,
0.01418304443359375
] |
64500b333c66dc4457dff4f29e778604d76633b8
|
Wordpress Stackexchange
Q: Add Class to Specific Paragraph of the_content() Let's say I want to give the first paragraph bold text by adding a body class to the first paragraph. Is there a way to filter the output of
the_content();
or any other paragraph? First paragraph? Last paragraph?
I know I can do this using Javascript or CSS (:firstchild), but is there a native WordPress way?
Thanks.
J
A: The following bit of code adds a class to the first paragraph output by the_content:
function first_paragraph($content){
return preg_replace('/<p([^>]+)?>/', '<p$1 class="intro">', $content, 1);
}
add_filter('the_content', 'first_paragraph');
Add the above to your theme's functions.php file.
Then in your CSS add something like:
p.intro { font-weight:bold; }
I can't claim credit for this solution (see this thread in the WP forums) but I tested it and it worked great for me in WordPress 3.3.2. You should be able to modify it as needed to target whichever paragraph your heart desires.
|
Q: Add Class to Specific Paragraph of the_content() Let's say I want to give the first paragraph bold text by adding a body class to the first paragraph. Is there a way to filter the output of
the_content();
or any other paragraph? First paragraph? Last paragraph?
I know I can do this using Javascript or CSS (:firstchild), but is there a native WordPress way?
Thanks.
J
A: The following bit of code adds a class to the first paragraph output by the_content:
function first_paragraph($content){
return preg_replace('/<p([^>]+)?>/', '<p$1 class="intro">', $content, 1);
}
add_filter('the_content', 'first_paragraph');
Add the above to your theme's functions.php file.
Then in your CSS add something like:
p.intro { font-weight:bold; }
I can't claim credit for this solution (see this thread in the WP forums) but I tested it and it worked great for me in WordPress 3.3.2. You should be able to modify it as needed to target whichever paragraph your heart desires.
|
wordpress
|
{
"language": "en",
"length": 155,
"provenance": "stackexchange_00019.jsonl.gz:419832",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51679"
}
|
[
-0.01519775390625,
-0.011383056640625,
-0.003963470458984375,
-0.0020751953125,
-0.028656005859375,
-0.0270233154296875,
0.0027675628662109375,
-0.016143798828125,
-0.01544952392578125,
0.01251983642578125,
-0.036041259765625,
0.0128173828125,
-0.0248260498046875,
-0.0219268798828125,
0.0182952880859375,
-0.045623779296875,
0.0249786376953125,
0.00537872314453125,
0.0228118896484375,
0.006694793701171875,
0.006328582763671875,
0.020477294921875,
-0.0176544189453125,
0.0298919677734375,
0.035552978515625,
-0.037078857421875,
0.0960693359375,
-0.04339599609375,
0.07080078125,
-0.0001118779182434082,
0.02392578125,
-0.05072021484375,
0.025543212890625,
0.0509033203125,
-0.059173583984375,
-0.00392913818359375,
0.004566192626953125,
0.005523681640625,
0.005832672119140625,
0.0274200439453125,
0.0205841064453125,
0.00994110107421875,
-0.0185699462890625,
0.065673828125,
-0.0305938720703125,
-0.04510498046875,
0.021148681640625,
-0.050262451171875,
0.005558013916015625,
-0.048187255859375,
0.0099945068359375,
-0.00821685791015625,
0.0301971435546875,
-0.039825439453125,
-0.0160064697265625,
0.020599365234375,
-0.01297760009765625,
0.002170562744140625,
0.027313232421875,
0.004779815673828125,
-0.02093505859375,
-0.0106964111328125,
0.00847625732421875,
-0.0186004638671875,
-0.035797119140625,
0.0028362274169921875,
0.02813720703125,
0.01142120361328125,
-0.007633209228515625,
-0.052032470703125,
-0.013702392578125,
0.0166015625,
-0.0276336669921875,
-0.0494384765625,
-0.03826904296875,
0.05047607421875,
-0.002338409423828125,
-0.0304107666015625,
-0.0078277587890625,
0.0016965866088867188,
0.01324462890625,
0.02197265625,
0.00907135009765625,
-0.0718994140625,
0.031341552734375,
-0.04901123046875,
-0.0171051025390625,
0.002475738525390625,
-0.0264129638671875,
-0.02227783203125,
-0.029052734375,
0.004962921142578125,
0.005146026611328125,
-0.04364013671875,
-0.04022216796875,
-0.0267333984375,
-0.0153656005859375,
0.036712646484375,
-0.006092071533203125,
0.063720703125,
-0.0079193115234375,
-0.042633056640625,
0.0885009765625,
-0.06927490234375,
0.028564453125,
0.0206451416015625,
-0.01751708984375,
0.0217742919921875,
0.046112060546875,
0.037750244140625,
-0.00811004638671875,
-0.00794219970703125,
0.0164031982421875,
-0.00803375244140625,
-0.0296630859375,
-0.007289886474609375,
-0.0163421630859375,
-0.0035152435302734375,
0.01544952392578125,
-0.013946533203125,
0.038970947265625,
0.04046630859375,
0.022430419921875,
-0.036163330078125,
-0.0253753662109375,
-0.018402099609375,
-0.040924072265625,
-0.038055419921875,
0.042877197265625,
-0.01346588134765625,
-0.0157318115234375,
0.02801513671875,
0.02423095703125,
0.00762176513671875,
-0.0030117034912109375,
0.0152740478515625,
0.049560546875,
-0.003925323486328125,
-0.01406097412109375,
0.0080108642578125,
0.0205535888671875,
-0.02056884765625,
-0.02154541015625,
-0.0020542144775390625,
-0.006557464599609375,
0.0258026123046875,
0.0213775634765625,
0.003635406494140625,
-0.007801055908203125,
-0.07855224609375,
0.04327392578125,
-0.050506591796875,
0.040313720703125,
0.00164031982421875,
-0.07537841796875,
-0.005157470703125,
-0.0106201171875,
-0.01371002197265625,
-0.041290283203125,
-0.0521240234375,
0.058013916015625,
0.0195770263671875,
-0.0051116943359375,
0.0029239654541015625,
-0.01439666748046875,
-0.03839111328125,
-0.041748046875,
-0.01091766357421875,
0.02239990234375,
-0.0093841552734375,
-0.0019893646240234375,
0.01971435546875,
0.00902557373046875,
-0.01220703125,
-0.0248260498046875,
-0.004810333251953125,
0.028167724609375,
0.03326416015625,
0.0038089752197265625,
0.0279083251953125,
-0.0021648406982421875,
-0.032806396484375,
0.066162109375,
-0.021270751953125,
-0.03167724609375,
-0.038299560546875,
0.035797119140625,
0.046905517578125,
-0.00597381591796875,
0.040313720703125,
-0.005695343017578125,
0.0028858184814453125,
-0.03424072265625,
-0.003955841064453125,
-0.00882720947265625,
-0.0254364013671875,
-0.0098876953125,
-0.006099700927734375,
-0.004474639892578125,
0.01508331298828125,
0.035369873046875,
-0.00396728515625,
0.032440185546875,
-0.00829315185546875,
-0.035186767578125,
0.01436614990234375,
-0.0117645263671875,
0.031890869140625,
-0.025482177734375,
-0.034149169921875,
0.013214111328125,
-0.037811279296875,
0.010406494140625,
-0.05596923828125,
-0.05096435546875,
0.0007443428039550781,
-0.00200653076171875,
-0.0111083984375,
-0.0259246826171875,
-0.004108428955078125,
0.0072479248046875,
-0.0211944580078125,
-0.01422882080078125,
0.0258026123046875,
0.043975830078125,
-0.008453369140625,
-0.0243072509765625,
-0.0067901611328125,
0.020294189453125,
0.013824462890625,
-0.03912353515625,
0.033905029296875,
0.047637939453125,
0.03253173828125,
-0.0533447265625,
0.01332855224609375,
-0.01214599609375,
-0.01280975341796875,
-0.0239410400390625,
0.0293731689453125,
0.06982421875,
0.05712890625,
0.02740478515625,
-0.0303955078125,
0.111572265625,
-0.0241851806640625,
0.0240020751953125,
-0.0557861328125,
0.01251983642578125,
0.0374755859375,
-0.029052734375,
-0.01910400390625,
0.0249786376953125,
-0.029815673828125,
0.02685546875,
0.0311126708984375,
0.01873779296875,
0.014801025390625,
-0.02606201171875,
0.039703369140625,
-0.01049041748046875,
0.029937744140625,
-0.01209259033203125,
0.0006561279296875,
0.0211639404296875,
0.0123748779296875,
0.0496826171875,
0.0304412841796875,
-0.02520751953125,
-0.0143890380859375,
0.018402099609375,
0.06158447265625,
-0.0011644363403320312,
0.05999755859375,
-0.0030117034912109375,
0.006145477294921875,
-0.00670623779296875,
-0.0200042724609375,
-0.0268096923828125,
0.022674560546875,
-0.0123748779296875,
0.0142059326171875,
0.009674072265625,
-0.011962890625,
-0.00394439697265625,
-0.025848388671875,
0.03961181640625,
0.0169525146484375,
-0.049652099609375,
-0.0587158203125,
-0.015106201171875,
0.054443359375,
-0.01447296142578125,
0.0159912109375,
0.044219970703125,
-0.00727081298828125,
0.0062103271484375,
-0.036895751953125,
0.04583740234375,
-0.0496826171875,
0.019012451171875,
0.04107666015625,
-0.055877685546875,
0.0221710205078125,
-0.00815582275390625,
0.045928955078125,
-0.021514892578125,
-0.003620147705078125,
-0.0102386474609375,
-0.0184783935546875,
-0.0185699462890625,
0.026702880859375,
0.033966064453125,
0.0252532958984375,
0.01450347900390625,
-0.0180816650390625,
-0.005161285400390625,
0.0266265869140625,
-0.0333251953125,
-0.0156707763671875,
0.01319122314453125,
-0.06866455078125,
-0.033111572265625,
0.0150909423828125,
-0.060546875,
0.00659942626953125,
0.057891845703125,
-0.00960540771484375,
0.0195159912109375,
0.00452423095703125,
-0.0176849365234375,
0.00019598007202148438,
-0.04437255859375,
-0.0211639404296875,
-0.00873565673828125,
-0.0017642974853515625,
0.01457977294921875,
0.05645751953125,
0.0130462646484375,
-0.05218505859375,
0.0226593017578125,
0.044891357421875,
-0.01113128662109375,
0.04388427734375,
0.012542724609375,
-0.053985595703125,
-0.04681396484375,
-0.0106201171875,
-0.011260986328125,
-0.0106201171875,
0.023956298828125,
0.0179901123046875,
-0.042938232421875,
0.007007598876953125,
-0.03704833984375,
0.07568359375,
0.06658935546875,
0.006465911865234375,
0.031829833984375,
-0.0401611328125,
0.002716064453125,
0.019287109375,
-0.01346588134765625,
-0.03338623046875,
0.0113983154296875,
-0.040130615234375,
-0.051727294921875,
0.0207672119140625,
-0.039764404296875,
-0.023834228515625,
0.0170135498046875,
-0.0328369140625,
0.05096435546875,
-0.030059814453125,
-0.055084228515625,
0.00009816884994506836,
-0.020965576171875,
-0.016876220703125,
0.03558349609375,
-0.0064849853515625,
0.0275421142578125,
-0.016326904296875,
0.0233154296875,
-0.05950927734375,
-0.03997802734375,
0.04852294921875,
-0.0108642578125,
-0.0280303955078125,
-0.0008454322814941406,
-0.0212554931640625,
0.0186614990234375,
0.06689453125,
-0.055694580078125,
-0.0189056396484375,
-0.007770538330078125,
0.034942626953125,
-0.0404052734375,
-0.07049560546875,
-0.02105712890625,
-0.00539398193359375,
-0.050048828125,
0.01751708984375,
-0.01161956787109375,
-0.022613525390625,
-0.02178955078125,
-0.01067352294921875,
-0.042938232421875,
-0.0224761962890625,
0.03265380859375,
-0.026275634765625,
-0.0036373138427734375,
0.06988525390625,
-0.0241241455078125,
0.051422119140625,
-0.0158843994140625,
-0.038604736328125,
-0.044464111328125,
-0.00693511962890625,
-0.0276336669921875,
0.0543212890625,
-0.0025310516357421875,
0.0184783935546875,
0.0169677734375,
0.05267333984375,
0.01324462890625,
0.01236724853515625,
-0.0013904571533203125,
-0.0021572113037109375,
0.0167388916015625,
-0.00815582275390625,
0.00841522216796875,
-0.022613525390625,
-0.007110595703125,
-0.0137481689453125,
-0.049468994140625,
0.04083251953125,
-0.0230255126953125,
0.033050537109375,
0.0206146240234375,
-0.0109710693359375,
-0.004802703857421875,
-0.048187255859375,
0.01544952392578125,
0.036529541015625,
-0.0114288330078125,
0.042266845703125,
-0.055328369140625,
-0.0016031265258789062,
0.0203094482421875,
-0.004886627197265625,
-0.0200347900390625,
-0.0023097991943359375,
0.0570068359375,
0.03045654296875,
-0.0158233642578125,
0.04888916015625,
-0.0128173828125,
0.020355224609375,
0.021942138671875,
0.050262451171875,
-0.011138916015625,
-0.034332275390625,
0.126708984375,
-0.004825592041015625,
0.036224365234375,
-0.03887939453125,
0.06719970703125,
-0.010650634765625,
-0.0318603515625,
0.058502197265625,
0.0028018951416015625,
-0.004444122314453125,
-0.018951416015625,
-0.030364990234375,
0.0081634521484375,
0.048431396484375,
0.023681640625,
-0.027008056640625,
0.0189666748046875,
-0.01131439208984375,
-0.0225067138671875,
0.0038928985595703125,
0.079345703125,
0.0018739700317382812,
0.00830078125,
0.01678466796875,
-0.015472412109375,
0.02020263671875,
-0.0013933181762695312,
0.0226593017578125,
0.0301361083984375,
-0.0061798095703125,
0.0269775390625,
0.013275146484375,
-0.0202789306640625,
-0.005985260009765625,
-0.0086669921875,
0.058502197265625,
-0.002422332763671875,
-0.06622314453125,
0.0271148681640625,
0.001407623291015625,
0.0355224609375,
0.03363037109375,
-0.00826263427734375,
0.0286712646484375,
-0.017822265625,
0.0018444061279296875,
-0.008148193359375,
-0.02716064453125,
-0.01898193359375,
-0.04608154296875,
0.03765869140625,
0.008331298828125,
-0.0299072265625,
0.0283050537109375,
-0.058319091796875,
-0.0041351318359375,
-0.0222320556640625,
0.010223388671875,
0.0052642822265625,
0.014129638671875,
0.0087432861328125,
0.01377105712890625,
0.0241546630859375,
-0.0056610107421875,
0.0219573974609375,
0.044036865234375,
-0.036895751953125,
0.0014314651489257812,
0.026214599609375,
0.03326416015625,
-0.020965576171875,
-0.0271148681640625,
0.023223876953125,
-0.0092620849609375,
0.0026092529296875,
-0.0165557861328125,
0.0067596435546875,
-0.006855010986328125,
0.01611328125,
0.025146484375,
0.003215789794921875,
0.01605224609375,
0.00799560546875,
0.00010222196578979492,
0.02679443359375,
0.0138397216796875,
-0.0099945068359375,
-0.0311126708984375,
-0.004482269287109375,
0.004154205322265625,
-0.0137786865234375,
-0.0186767578125,
-0.01166534423828125,
-0.058197021484375,
-0.03253173828125,
-0.0103759765625,
0.0134124755859375,
0.036712646484375,
-0.0018529891967773438,
0.05303955078125,
-0.03631591796875,
-0.0246429443359375,
-0.0712890625,
0.01448822021484375,
-0.0005636215209960938,
0.0016679763793945312,
-0.007671356201171875,
0.00473785400390625,
-0.0241546630859375,
-0.01483917236328125,
-0.033233642578125,
-0.0147552490234375,
-0.0234832763671875,
0.00754547119140625,
0.016937255859375,
0.0036563873291015625,
-0.00469970703125,
-0.030548095703125,
-0.021697998046875,
0.021484375,
0.0294952392578125,
0.01531982421875,
-0.001346588134765625,
0.0980224609375,
0.0016031265258789062,
0.07110595703125,
0.04217529296875,
0.0750732421875,
-0.004711151123046875,
-0.0419921875,
-0.01334381103515625,
-0.08343505859375,
-0.0027065277099609375,
0.01885986328125,
-0.018218994140625,
0.05401611328125,
0.0215911865234375,
0.007259368896484375,
0.02545166015625,
0.0009255409240722656,
0.01322174072265625,
-0.0297393798828125,
-0.04632568359375,
-0.0224609375,
-0.029144287109375,
0.038055419921875,
0.020355224609375,
0.04852294921875,
-0.0269622802734375,
0.006458282470703125,
-0.0193328857421875,
-0.0024776458740234375,
0.00435638427734375,
0.008270263671875,
0.0008192062377929688,
0.01456451416015625,
-0.024810791015625,
-0.025848388671875,
0.01279449462890625,
-0.005405426025390625,
0.007793426513671875,
0.024658203125,
-0.01454925537109375,
-0.020477294921875,
0.03204345703125,
0.047576904296875,
0.001102447509765625,
-0.0007228851318359375,
0.0350341796875,
-0.015533447265625,
0.01934814453125,
0.0190887451171875,
0.0295867919921875,
-0.0308380126953125,
-0.000001430511474609375,
-0.003971099853515625,
-0.0301971435546875,
0.043701171875,
0.0249481201171875,
0.006664276123046875,
-0.02130126953125,
0.0550537109375,
-0.0136260986328125,
0.0232391357421875,
0.043212890625,
-0.0212249755859375,
-0.01401519775390625,
-0.006351470947265625,
-0.03131103515625,
-0.014923095703125,
-0.039306640625,
0.00011026859283447266,
0.032562255859375,
-0.0190887451171875,
-0.0259552001953125,
-0.0256500244140625,
0.0035552978515625,
-0.032196044921875,
-0.058197021484375,
-0.022216796875,
-0.024993896484375,
0.01861572265625,
0.01071929931640625,
0.0166778564453125,
0.0029888153076171875,
0.041107177734375,
-0.01380157470703125,
0.01953125,
0.01325225830078125,
-0.01849365234375,
-0.020233154296875,
-0.0180511474609375,
0.0426025390625,
0.02880859375,
-0.074951171875,
0.032196044921875,
-0.019378662109375,
-0.0291748046875,
0.00191497802734375,
-0.03704833984375,
0.02880859375,
-0.0080108642578125,
-0.022705078125,
0.02386474609375,
-0.007232666015625,
-0.010772705078125,
-0.0224609375,
0.015625,
-0.0303955078125,
0.0244903564453125,
-0.00577545166015625,
0.0026836395263671875,
0.011322021484375,
-0.0240936279296875,
-0.06854248046875,
0.0859375,
-0.01331329345703125,
0.032745361328125,
0.01100921630859375,
0.0296173095703125,
-0.039459228515625,
-0.006862640380859375,
-0.037841796875,
0.045684814453125,
0.012451171875,
0.0287628173828125,
-0.03302001953125,
-0.0140838623046875,
0.020965576171875,
0.034942626953125,
0.0006451606750488281,
-0.01552581787109375,
-0.02325439453125,
-0.0191650390625,
0.047637939453125,
0.042816162109375,
0.031005859375,
0.003894805908203125,
-0.002712249755859375,
0.0007185935974121094,
-0.0092926025390625,
-0.031951904296875,
0.026336669921875,
-0.05255126953125,
-0.0020961761474609375,
0.025146484375,
0.0242767333984375,
0.027313232421875,
0.0024394989013671875,
0.018585205078125,
-0.05023193359375,
0.0095367431640625,
0.042327880859375,
0.01134490966796875,
-0.036346435546875,
0.0810546875,
0.025299072265625,
-0.068115234375,
-0.04437255859375,
-0.04833984375,
0.03631591796875,
0.00849151611328125,
0.0306243896484375,
0.050994873046875,
0.033294677734375,
0.025238037109375,
0.01995849609375,
0.0310821533203125,
0.02520751953125,
-0.0236358642578125,
0.0297393798828125,
0.004589080810546875,
0.01110076904296875,
-0.052276611328125,
-0.0254974365234375,
0.0086822509765625,
0.041961669921875,
-0.0275115966796875,
0.02667236328125,
0.01385498046875,
0.0199432373046875,
0.00814056396484375,
-0.04302978515625,
0.01548004150390625,
0.0017480850219726562,
-0.00514984130859375,
-0.034881591796875,
-0.019989013671875,
0.01493072509765625,
0.0242767333984375,
0.0011663436889648438,
0.0111083984375,
-0.008270263671875,
-0.0252838134765625,
-0.0244598388671875,
0.01557159423828125,
0.0217132568359375,
-0.0008254051208496094,
-0.01416015625,
0.046722412109375,
0.01149749755859375,
0.01433563232421875,
-0.01525115966796875,
-0.0265045166015625,
0.039520263671875,
0.0058746337890625,
0.045806884765625,
0.0870361328125,
-0.0045928955078125,
-0.0143890380859375,
0.0082855224609375,
-0.003681182861328125,
0.02923583984375,
0.0233612060546875,
-0.031951904296875,
-0.003963470458984375,
0.00982666015625,
-0.025970458984375,
0.01425933837890625,
-0.02410888671875,
-0.029205322265625,
-0.004520416259765625,
-0.03009033203125,
0.0140228271484375,
-0.001422882080078125,
0.0157012939453125,
0.0136566162109375,
-0.014251708984375,
0.023590087890625,
-0.039825439453125,
-0.01507568359375,
0.048614501953125,
0.0173797607421875,
0.049468994140625,
-0.10504150390625,
0.006122589111328125,
-0.0406494140625,
-0.11517333984375,
0.057342529296875,
0.056610107421875,
-0.061309814453125,
0.0175018310546875,
0.0038700103759765625,
-0.00606536865234375,
-0.01158905029296875,
0.01221466064453125,
0.00885772705078125,
-0.006717681884765625,
0.0116119384765625,
0.0032520294189453125,
-0.058563232421875,
-0.02978515625,
-0.043792724609375,
0.04901123046875,
0.0261383056640625,
0.08367919921875,
-0.01238250732421875,
0.05023193359375,
-0.0134124755859375,
0.054473876953125,
-0.023040771484375,
-0.027069091796875,
0.034698486328125,
0.0236968994140625,
0.04248046875,
-0.01482391357421875,
-0.051513671875,
0.0285797119140625,
0.03875732421875,
-0.00978851318359375,
0.041046142578125,
0.0014524459838867188,
0.00333404541015625,
-0.038787841796875,
0.07275390625,
-0.00939178466796875,
0.03759765625,
-0.029083251953125,
-0.050201416015625,
0.0706787109375,
0.03936767578125,
0.05889892578125,
-0.005550384521484375,
0.030792236328125,
-0.05322265625,
0.0241546630859375,
-0.00977325439453125,
0.0303497314453125,
0.030059814453125,
0.0259857177734375,
-0.056610107421875,
0.0218505859375,
0.01271820068359375,
-0.0009360313415527344,
0.01910400390625,
0.041015625,
0.03948974609375,
-0.042633056640625,
0.0025806427001953125,
0.04425048828125,
0.053192138671875,
0.0011034011840820312,
0.0278778076171875,
0.012298583984375,
-0.01387786865234375,
0.0146026611328125,
0.03277587890625,
-0.0233154296875,
0.0020122528076171875,
-0.0262603759765625,
-0.0022602081298828125,
0.005916595458984375,
-0.044769287109375,
-0.08544921875,
-0.012176513671875,
0.0171051025390625,
-0.02288818359375,
-0.01007080078125,
-0.0102691650390625,
-0.03424072265625,
0.0180816650390625,
-0.0205230712890625,
0.025238037109375,
-0.00632476806640625,
0.020599365234375,
-0.048614501953125,
-0.054840087890625,
-0.057891845703125,
0.0400390625,
-0.07940673828125,
0.0204620361328125,
0.056396484375,
-0.01059722900390625,
0.0200958251953125,
0.00762176513671875,
-0.0161285400390625,
0.059356689453125,
-0.088623046875,
-0.0218658447265625,
0.0181427001953125,
-0.01227569580078125,
-0.006633758544921875,
-0.03271484375,
0.0186767578125,
-0.057708740234375,
-0.015960693359375,
0.01971435546875,
-0.0187225341796875,
0.00850677490234375,
-0.041168212890625,
-0.1107177734375,
0.0216827392578125,
-0.0126190185546875,
-0.048065185546875,
-0.021392822265625,
-0.0017032623291015625,
-0.00968170166015625,
-0.0106048583984375,
-0.0125732421875,
0.00560760498046875,
-0.0137786865234375,
0.01275634765625,
-0.0175323486328125,
0.0379638671875,
0.0036296844482421875,
-0.01557159423828125,
-0.0308685302734375,
-0.01178741455078125,
-0.013092041015625,
-0.01418304443359375,
-0.036773681640625,
0.0137939453125,
-0.0015783309936523438,
0.0247955322265625,
-0.0128631591796875,
0.0014104843139648438,
0.0223388671875,
-0.00812530517578125,
0.0123748779296875,
-0.037261962890625,
-0.01497650146484375,
-0.0301971435546875,
0.051788330078125,
-0.017791748046875,
0.01197052001953125,
0.0019664764404296875,
-0.02093505859375,
0.0006241798400878906,
-0.018829345703125,
0.0227203369140625,
0.0127105712890625,
-0.031707763671875,
-0.0003485679626464844,
-0.004146575927734375,
-0.01084136962890625,
0.028961181640625,
-0.028533935546875,
-0.00495147705078125,
0.00830841064453125,
0.004924774169921875,
0.0226898193359375,
-0.03656005859375,
-0.0733642578125,
0.0372314453125,
-0.013580322265625,
0.008453369140625,
0.006420135498046875,
0.048583984375,
0.01087188720703125,
0.054718017578125,
0.001312255859375,
-0.01273345947265625,
0.004611968994140625,
0.0133514404296875,
0.0082244873046875,
-0.00431060791015625,
-0.00171661376953125,
-0.0082855224609375,
-0.034698486328125,
-0.01070404052734375,
0.037628173828125,
0.0007061958312988281,
-0.0302734375,
-0.033447265625,
-0.00222015380859375,
-0.0166168212890625,
-0.0196685791015625,
0.008880615234375,
-0.016571044921875,
0.01271820068359375,
-0.01503753662109375,
0.005062103271484375,
0.0036563873291015625,
0.00009316205978393555,
-0.00565338134765625,
0.00035643577575683594,
-0.048675537109375,
-0.057861328125,
0.00940704345703125,
-0.0460205078125,
-0.0030841827392578125,
0.01026153564453125
] |
75fb6e90c40ad5bf0380c1d05fa8410c537235b7
|
Wordpress Stackexchange
Q: Secure Validation of wp_editor in Theme Options So I just found this great WPSE thread about security for themes/plugins. It answered most of my questions but it was created before the new wp_editor() function was built.
I have two TinyMCE editors on my Theme Options and I'm wondering whether I need to use esc_html() or esc_textarea() in a validation callback before saving the theme option. It seems to me that TinyMCE takes care of a lot of that stuff (as well as the Settings API security that's taken care of), but there's still not a lot of documentation out there about wp_editor().
Any resources and answers appreciated.
A: esc_html() and esc_textarea() are, appropriate to their names, escaping functions and really meant for display rather than sanitizing or validating. I would use wp_kses() or wp_kses_post() (which is just wp_kses() with the global $allowedposttags) to sanitize input from a wp_editor() field before saving.
|
Q: Secure Validation of wp_editor in Theme Options So I just found this great WPSE thread about security for themes/plugins. It answered most of my questions but it was created before the new wp_editor() function was built.
I have two TinyMCE editors on my Theme Options and I'm wondering whether I need to use esc_html() or esc_textarea() in a validation callback before saving the theme option. It seems to me that TinyMCE takes care of a lot of that stuff (as well as the Settings API security that's taken care of), but there's still not a lot of documentation out there about wp_editor().
Any resources and answers appreciated.
A: esc_html() and esc_textarea() are, appropriate to their names, escaping functions and really meant for display rather than sanitizing or validating. I would use wp_kses() or wp_kses_post() (which is just wp_kses() with the global $allowedposttags) to sanitize input from a wp_editor() field before saving.
A: The TinyMCE has an Filter for all allowed tags. You can change the tags, there are set in standard for your options and the editor filter the tags. Its not necassary, that you filter after save.
Example for enhanced tags:
function fb_change_mce_options( $initArray ) {
// Comma separated string od extendes tags
// Command separated string of extended elements
$ext = 'pre[id|name|class|style],iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]';
if ( isset( $initArray['extended_valid_elements'] ) ) {
$initArray['extended_valid_elements'] .= ',' . $ext;
} else {
$initArray['extended_valid_elements'] = $ext;
}
// set tiny paramter verify_html
$initArray['verify_html'] = true;
return $initArray;
}
add_filter( 'tiny_mce_before_init', 'fb_change_mce_options' );
You can also filter the tags, all tags inside the array $initArray is allowed.
Its easy to kill tags fromthe array.
unset( $initArray['pre'] )
read the items inside the array via var_dump( $initArray );
Best
|
wordpress
|
{
"language": "en",
"length": 284,
"provenance": "stackexchange_00019.jsonl.gz:419838",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51700"
}
|
[
0.0203399658203125,
-0.017181396484375,
-0.042388916015625,
-0.00904083251953125,
0.0163726806640625,
-0.042083740234375,
0.0389404296875,
0.00321197509765625,
0.01355743408203125,
0.03863525390625,
0.0244140625,
-0.011993408203125,
0.01517486572265625,
-0.049957275390625,
-0.0081634521484375,
0.0029926300048828125,
-0.00614166259765625,
0.0080718994140625,
0.01189422607421875,
-0.0296630859375,
0.0114288330078125,
-0.02838134765625,
0.00640869140625,
-0.03399658203125,
0.00728607177734375,
0.0100860595703125,
0.10577392578125,
-0.0283355712890625,
-0.004886627197265625,
-0.0287933349609375,
0.01538848876953125,
-0.02410888671875,
-0.00034928321838378906,
0.062408447265625,
-0.057708740234375,
0.057708740234375,
-0.0031757354736328125,
0.034149169921875,
0.0122528076171875,
0.0279388427734375,
0.01861572265625,
-0.0035400390625,
0.021820068359375,
0.00872802734375,
-0.01202392578125,
-0.04638671875,
0.04107666015625,
-0.0216217041015625,
-0.0252227783203125,
0.0160369873046875,
0.0114288330078125,
-0.0251312255859375,
0.04449462890625,
-0.054840087890625,
-0.00039076805114746094,
-0.00975799560546875,
-0.056396484375,
-0.0136871337890625,
-0.00585174560546875,
0.0970458984375,
0.0450439453125,
0.0186614990234375,
-0.036376953125,
-0.033233642578125,
0.01953125,
0.0187835693359375,
-0.0099029541015625,
0.041656494140625,
-0.006412506103515625,
0.01433563232421875,
-0.01116180419921875,
-0.032012939453125,
0.007801055908203125,
-0.041717529296875,
0.01444244384765625,
0.04473876953125,
-0.039794921875,
-0.00847625732421875,
0.040191650390625,
0.00420379638671875,
-0.020477294921875,
-0.021697998046875,
-0.031402587890625,
-0.03973388671875,
0.018341064453125,
-0.0088958740234375,
-0.00981903076171875,
0.0012540817260742188,
-0.01438140869140625,
-0.031219482421875,
-0.006137847900390625,
-0.0645751953125,
-0.00946044921875,
0.0261993408203125,
0.0097503662109375,
-0.034271240234375,
0.034912109375,
0.0243377685546875,
-0.002532958984375,
0.0016431808471679688,
0.053955078125,
-0.073974609375,
0.07049560546875,
-0.0247650146484375,
-0.01204681396484375,
0.0557861328125,
0.003986358642578125,
-0.0273590087890625,
-0.0028896331787109375,
0.009185791015625,
-0.0033016204833984375,
-0.0298309326171875,
-0.01546478271484375,
-0.05255126953125,
0.0221099853515625,
0.02655029296875,
-0.03643798828125,
0.04351806640625,
0.0206756591796875,
0.00458526611328125,
0.01279449462890625,
-0.006221771240234375,
0.052490234375,
-0.0570068359375,
-0.024322509765625,
-0.059661865234375,
-0.07147216796875,
0.00043487548828125,
0.006458282470703125,
0.053741455078125,
-0.033111572265625,
-0.00667572021484375,
0.042266845703125,
0.00594329833984375,
-0.0114288330078125,
-0.034423828125,
-0.0016565322875976562,
-0.023345947265625,
0.006084442138671875,
0.01003265380859375,
-0.00901031494140625,
-0.01812744140625,
0.0189666748046875,
-0.01262664794921875,
0.006595611572265625,
0.036224365234375,
0.0214385986328125,
0.0006055831909179688,
-0.0013399124145507812,
-0.0888671875,
0.04119873046875,
-0.03839111328125,
0.036773681640625,
0.00797271728515625,
-0.01396942138671875,
-0.0218658447265625,
-0.0008144378662109375,
-0.0223236083984375,
-0.005401611328125,
-0.0311126708984375,
-0.00994110107421875,
-0.0187225341796875,
0.0268402099609375,
-0.0361328125,
-0.03741455078125,
0.0037937164306640625,
-0.04296875,
-0.01175689697265625,
0.020904541015625,
0.0357666015625,
0.01461029052734375,
-0.029998779296875,
-0.014984130859375,
0.0218048095703125,
-0.0005016326904296875,
0.0377197265625,
-0.023345947265625,
0.027862548828125,
0.030609130859375,
0.01329803466796875,
0.01010894775390625,
-0.03424072265625,
0.0594482421875,
-0.00592803955078125,
-0.04803466796875,
-0.0032501220703125,
0.0170745849609375,
0.062225341796875,
0.03485107421875,
0.033935546875,
-0.0110321044921875,
-0.018096923828125,
0.03851318359375,
-0.057342529296875,
0.006134033203125,
-0.024749755859375,
-0.01203155517578125,
-0.016510009765625,
-0.01885986328125,
0.03607177734375,
0.0748291015625,
-0.0305633544921875,
0.046234130859375,
-0.040618896484375,
-0.040008544921875,
-0.0110931396484375,
-0.007167816162109375,
0.0139312744140625,
-0.011993408203125,
0.03070068359375,
0.02099609375,
-0.00336456298828125,
-0.0239410400390625,
0.0241851806640625,
0.00150299072265625,
-0.01154327392578125,
-0.0219879150390625,
0.062042236328125,
0.00048065185546875,
0.048980712890625,
0.0213470458984375,
-0.040924072265625,
0.0246124267578125,
0.0029850006103515625,
-0.01471710205078125,
-0.01389312744140625,
-0.00661468505859375,
-0.00440216064453125,
0.0170745849609375,
-0.00592041015625,
0.08270263671875,
-0.0037555694580078125,
0.061798095703125,
0.04595947265625,
-0.017364501953125,
-0.035064697265625,
-0.03814697265625,
-0.11077880859375,
0.01100921630859375,
0.08135986328125,
0.050537109375,
0.055267333984375,
-0.0068206787109375,
-0.028961181640625,
0.0882568359375,
-0.0517578125,
0.0020122528076171875,
-0.0260162353515625,
0.0239410400390625,
0.04644775390625,
0.015777587890625,
-0.039825439453125,
-0.0014438629150390625,
-0.07373046875,
0.0158233642578125,
-0.0037059783935546875,
-0.0128021240234375,
0.023529052734375,
-0.011383056640625,
-0.01053619384765625,
-0.00004500150680541992,
-0.041748046875,
-0.008056640625,
-0.0190582275390625,
0.056640625,
-0.013916015625,
0.033721923828125,
0.0137786865234375,
0.005153656005859375,
-0.0198211669921875,
-0.00113677978515625,
-0.020233154296875,
-0.00467681884765625,
0.044586181640625,
0.0275115966796875,
0.0253143310546875,
-0.029541015625,
-0.0090179443359375,
0.01122283935546875,
0.03955078125,
-0.021575927734375,
0.026031494140625,
-0.0118408203125,
-0.020294189453125,
-0.0166778564453125,
-0.0224761962890625,
0.0189971923828125,
0.01316070556640625,
0.0290985107421875,
-0.01335906982421875,
0.0200653076171875,
-0.0160369873046875,
-0.044281005859375,
0.041900634765625,
0.03729248046875,
-0.046630859375,
0.012054443359375,
0.003627777099609375,
0.0013113021850585938,
-0.0033283233642578125,
0.03546142578125,
0.035308837890625,
0.002193450927734375,
-0.021453857421875,
0.010650634765625,
-0.00920867919921875,
-0.00604248046875,
0.04522705078125,
0.01517486572265625,
0.0025177001953125,
-0.07867431640625,
-0.031005859375,
0.0205535888671875,
0.024993896484375,
-0.003574371337890625,
-0.03363037109375,
-0.02166748046875,
0.019378662109375,
-0.03082275390625,
-0.0001080632209777832,
-0.0231170654296875,
-0.070068359375,
0.0070953369140625,
-0.0291900634765625,
-0.021240234375,
0.0171356201171875,
-0.0173797607421875,
0.01255035400390625,
-0.0260467529296875,
0.0158843994140625,
-0.03192138671875,
-0.0163116455078125,
-0.031524658203125,
0.01251220703125,
-0.0160675048828125,
0.01476287841796875,
0.0029048919677734375,
0.06890869140625,
0.00829315185546875,
-0.049072265625,
-0.006916046142578125,
-0.05120849609375,
-0.014068603515625,
0.0236663818359375,
-0.0572509765625,
0.00019466876983642578,
-0.0266265869140625,
-0.00554656982421875,
0.002109527587890625,
-0.037078857421875,
0.042694091796875,
0.006805419921875,
0.00701141357421875,
-0.0248870849609375,
0.037841796875,
-0.006103515625,
-0.0279998779296875,
0.02001953125,
0.042022705078125,
-0.03729248046875,
0.00923919677734375,
0.0250091552734375,
-0.01036834716796875,
0.00036835670471191406,
-0.0290679931640625,
-0.0159454345703125,
0.0186614990234375,
0.0180206298828125,
0.01251220703125,
0.048492431640625,
0.042694091796875,
0.0048980712890625,
0.0191192626953125,
-0.021636962890625,
-0.0174560546875,
-0.03759765625,
-0.0212249755859375,
-0.0400390625,
-0.0102691650390625,
-0.025634765625,
-0.033782958984375,
-0.0307159423828125,
0.02880859375,
0.00562286376953125,
-0.0231475830078125,
0.032745361328125,
-0.003589630126953125,
0.04803466796875,
-0.0576171875,
-0.01212310791015625,
-0.045867919921875,
0.06793212890625,
-0.01314544677734375,
-0.0029544830322265625,
0.0160675048828125,
0.0109405517578125,
-0.027557373046875,
-0.0201416015625,
-0.042205810546875,
-0.00994873046875,
-0.04547119140625,
0.03314208984375,
0.006450653076171875,
-0.00901031494140625,
-0.0283050537109375,
-0.0066070556640625,
-0.041595458984375,
-0.029876708984375,
0.036285400390625,
-0.07904052734375,
0.01666259765625,
0.004161834716796875,
-0.0186767578125,
-0.041534423828125,
-0.017547607421875,
-0.03839111328125,
-0.10693359375,
-0.0184478759765625,
-0.02587890625,
0.07305908203125,
0.01242828369140625,
-0.02264404296875,
-0.034454345703125,
0.046112060546875,
-0.0010862350463867188,
-0.003368377685546875,
0.047088623046875,
0.04827880859375,
-0.0248260498046875,
-0.03704833984375,
0.021026611328125,
-0.055328369140625,
0.0282440185546875,
0.0139312744140625,
-0.06488037109375,
-0.04833984375,
-0.036102294921875,
-0.061614990234375,
0.04473876953125,
-0.06414794921875,
-0.0367431640625,
-0.0168609619140625,
-0.0310516357421875,
0.0100250244140625,
-0.00322723388671875,
-0.02764892578125,
-0.0160064697265625,
-0.0469970703125,
0.057952880859375,
-0.014373779296875,
0.0121002197265625,
-0.00537109375,
0.08331298828125,
0.006229400634765625,
-0.0165557861328125,
-0.0219268798828125,
-0.059844970703125,
0.0244903564453125,
0.0014791488647460938,
0.017486572265625,
0.01279449462890625,
-0.0244903564453125,
0.042999267578125,
0.007717132568359375,
0.00844573974609375,
-0.044189453125,
0.042449951171875,
0.00083160400390625,
0.00978851318359375,
-0.0139923095703125,
-0.0158843994140625,
0.05401611328125,
0.02764892578125,
-0.004840850830078125,
0.0220794677734375,
0.016876220703125,
-0.048431396484375,
-0.022491455078125,
0.009552001953125,
0.031951904296875,
-0.0226287841796875,
-0.011932373046875,
0.0190277099609375,
0.034912109375,
0.035552978515625,
-0.0023937225341796875,
0.009429931640625,
0.03460693359375,
-0.003170013427734375,
-0.0184478759765625,
0.0016994476318359375,
0.007350921630859375,
0.03302001953125,
-0.0118865966796875,
0.0047454833984375,
-0.0294647216796875,
-0.00959014892578125,
0.001071929931640625,
0.004833221435546875,
-0.0223541259765625,
-0.03662109375,
0.005252838134765625,
0.04248046875,
0.000850677490234375,
0.029052734375,
0.0302276611328125,
-0.02789306640625,
-0.060211181640625,
-0.0060882568359375,
0.0105133056640625,
-0.0546875,
-0.040191650390625,
-0.038909912109375,
-0.01389312744140625,
-0.0192108154296875,
0.01500701904296875,
0.005672454833984375,
-0.0166168212890625,
0.00734710693359375,
-0.016693115234375,
0.03741455078125,
0.04254150390625,
0.00397491455078125,
0.0129241943359375,
0.0006833076477050781,
-0.00690460205078125,
-0.0166778564453125,
0.004085540771484375,
-0.03375244140625,
-0.04180908203125,
0.0328369140625,
0.00962066650390625,
-0.03369140625,
0.00774383544921875,
0.0194854736328125,
0.05194091796875,
-0.007396697998046875,
0.02325439453125,
-0.02490234375,
-0.063232421875,
0.0014142990112304688,
0.03265380859375,
0.01116943359375,
-0.031036376953125,
0.0018568038940429688,
-0.011627197265625,
-0.00946807861328125,
-0.00620269775390625,
0.03350830078125,
-0.03558349609375,
-0.002101898193359375,
0.0002646446228027344,
0.00753021240234375,
0.0034923553466796875,
-0.0115203857421875,
-0.058929443359375,
-0.021453857421875,
-0.01995849609375,
-0.005413055419921875,
0.08056640625,
-0.04376220703125,
0.052886962890625,
-0.0274505615234375,
-0.00946044921875,
-0.011505126953125,
0.0286102294921875,
-0.00019431114196777344,
0.010528564453125,
-0.00485992431640625,
0.0009031295776367188,
-0.048492431640625,
-0.0272674560546875,
-0.00714874267578125,
-0.01105499267578125,
-0.037200927734375,
-0.01212310791015625,
0.0172882080078125,
0.0269775390625,
-0.002620697021484375,
-0.029388427734375,
0.020751953125,
0.0207977294921875,
0.0001010894775390625,
0.07440185546875,
-0.00904083251953125,
0.0482177734375,
0.0010824203491210938,
0.044921875,
0.006847381591796875,
-0.0013017654418945312,
-0.01343536376953125,
-0.01129150390625,
-0.00511932373046875,
-0.0340576171875,
0.005115509033203125,
-0.0369873046875,
0.031829833984375,
0.0307464599609375,
0.02789306640625,
0.004833221435546875,
0.039520263671875,
-0.01038360595703125,
0.0019969940185546875,
-0.006999969482421875,
-0.0094146728515625,
-0.0186309814453125,
0.004360198974609375,
0.0455322265625,
-0.06463623046875,
0.00194549560546875,
0.007556915283203125,
0.012725830078125,
0.06390380859375,
-0.057830810546875,
0.040191650390625,
0.04425048828125,
-0.0220184326171875,
0.045684814453125,
0.06982421875,
-0.0118255615234375,
0.0247802734375,
-0.001308441162109375,
-0.0246429443359375,
-0.009918212890625,
0.00481414794921875,
-0.06365966796875,
-0.0023860931396484375,
0.0142669677734375,
0.0204620361328125,
0.0083465576171875,
0.038238525390625,
-0.0096893310546875,
0.03656005859375,
0.057220458984375,
0.1026611328125,
-0.07830810546875,
0.0175323486328125,
0.0635986328125,
-0.03863525390625,
-0.0185089111328125,
-0.0100860595703125,
-0.026275634765625,
-0.060150146484375,
0.083740234375,
-0.047088623046875,
-0.010009765625,
0.0247955322265625,
-0.03826904296875,
-0.0019235610961914062,
-0.0186309814453125,
0.0440673828125,
0.0130462646484375,
-0.0312347412109375,
0.0197601318359375,
0.02886962890625,
0.0033626556396484375,
-0.0038967132568359375,
0.043121337890625,
-0.034698486328125,
-0.022552490234375,
-0.041778564453125,
-0.0164642333984375,
0.026947021484375,
-0.04974365234375,
-0.00823974609375,
0.0033512115478515625,
0.037078857421875,
0.037628173828125,
-0.019317626953125,
0.0022830963134765625,
0.01012420654296875,
0.03875732421875,
0.022857666015625,
-0.01378631591796875,
-0.007720947265625,
0.017303466796875,
-0.0102996826171875,
0.0129547119140625,
-0.00287628173828125,
-0.00994110107421875,
0.010498046875,
0.010955810546875,
0.03765869140625,
0.01751708984375,
-0.0308685302734375,
0.0305633544921875,
-0.0029315948486328125,
-0.005580902099609375,
-0.03863525390625,
0.00063323974609375,
-0.08526611328125,
-0.034881591796875,
-0.036468505859375,
-0.027679443359375,
0.0168609619140625,
-0.03900146484375,
-0.08447265625,
0.11676025390625,
0.050628662109375,
0.0276947021484375,
-0.016998291015625,
0.0360107421875,
-0.060943603515625,
-0.007537841796875,
0.0036602020263671875,
0.034698486328125,
-0.005950927734375,
-0.032684326171875,
-0.029449462890625,
0.0025348663330078125,
-0.03546142578125,
0.042022705078125,
0.015716552734375,
-0.007015228271484375,
0.004241943359375,
0.011932373046875,
0.065185546875,
0.0233917236328125,
-0.00847625732421875,
0.017913818359375,
0.02972412109375,
-0.004985809326171875,
0.03717041015625,
0.004039764404296875,
0.041717529296875,
-0.053314208984375,
0.020904541015625,
0.03204345703125,
0.00994873046875,
0.0009241104125976562,
0.016998291015625,
-0.0266876220703125,
-0.0023441314697265625,
0.00885772705078125,
-0.011383056640625,
-0.0213470458984375,
-0.04290771484375,
0.0224609375,
-0.0013589859008789062,
-0.034149169921875,
-0.022796630859375,
-0.038665771484375,
0.029327392578125,
0.005550384521484375,
0.0050201416015625,
0.018585205078125,
0.01326751708984375,
0.003002166748046875,
0.005718231201171875,
0.005016326904296875,
0.0245819091796875,
-0.00469970703125,
-0.0154266357421875,
-0.0304718017578125,
-0.0018520355224609375,
-0.05059814453125,
0.0234222412109375,
0.023834228515625,
-0.00988006591796875,
-0.012298583984375,
-0.017486572265625,
0.00904083251953125,
0.01236724853515625,
-0.000701904296875,
-0.01165771484375,
0.01983642578125,
0.021026611328125,
0.03570556640625,
0.00673675537109375,
-0.0207061767578125,
0.0024166107177734375,
0.0083160400390625,
0.004791259765625,
0.0136566162109375,
0.0227508544921875,
-0.012115478515625,
-0.031036376953125,
-0.014404296875,
0.015716552734375,
0.0218505859375,
0.036651611328125,
0.01146697998046875,
0.0478515625,
-0.013397216796875,
-0.036834716796875,
0.05010986328125,
0.0261383056640625,
0.031951904296875,
-0.0246429443359375,
0.007106781005859375,
0.024993896484375,
0.0146636962890625,
0.01062774658203125,
0.0272369384765625,
0.0472412109375,
0.0230560302734375,
-0.0167083740234375,
-0.01337432861328125,
-0.01226806640625,
-0.0240325927734375,
-0.0108184814453125,
-0.0130157470703125,
0.005779266357421875,
0.0305023193359375,
-0.0100250244140625,
-0.00659942626953125,
0.0101776123046875,
0.05303955078125,
-0.006336212158203125,
0.01558685302734375,
-0.0016613006591796875,
-0.0185089111328125,
-0.01230621337890625,
-0.01654052734375,
0.01065826416015625,
0.01233673095703125,
-0.026214599609375,
-0.01464080810546875,
0.020965576171875,
0.0015592575073242188,
0.0010919570922851562,
0.0300140380859375,
0.008514404296875,
0.0137939453125,
0.007442474365234375,
-0.06988525390625,
0.04718017578125,
0.045074462890625,
-0.01300048828125,
-0.00457000732421875,
0.006992340087890625,
-0.04656982421875,
-0.044525146484375,
-0.0215301513671875,
-0.00421905517578125,
0.043365478515625,
-0.02056884765625,
0.049346923828125,
-0.0169525146484375,
0.0117340087890625,
-0.0163726806640625,
0.053802490234375,
-0.04266357421875,
-0.0120086669921875,
0.04718017578125,
0.0274505615234375,
0.0218505859375,
-0.0185394287109375,
-0.035064697265625,
0.06622314453125,
-0.01267242431640625,
0.023284912109375,
0.0307769775390625,
-0.03302001953125,
0.01629638671875,
0.0333251953125,
0.0322265625,
-0.025848388671875,
-0.059967041015625,
-0.047149658203125,
0.02081298828125,
-0.0016412734985351562,
0.0258026123046875,
0.00447845458984375,
0.03515625,
-0.0242462158203125,
0.0007486343383789062,
0.00035953521728515625,
-0.0304412841796875,
-0.04345703125,
0.006622314453125,
0.00489044189453125,
0.0154266357421875,
0.02227783203125,
-0.0151214599609375,
0.00022280216217041016,
0.029632568359375,
-0.01264190673828125,
0.007205963134765625,
-0.033935546875,
0.00749969482421875,
0.055419921875,
0.0653076171875,
0.01519012451171875,
0.013702392578125,
0.0285186767578125,
-0.01544952392578125,
-0.0215301513671875,
-0.03851318359375,
-0.02294921875,
-0.0244903564453125,
-0.00763702392578125,
0.0208892822265625,
-0.014068603515625,
-0.01251220703125,
-0.034698486328125,
-0.015411376953125,
0.0178985595703125,
-0.00909423828125,
-0.002017974853515625,
-0.036224365234375,
-0.0088958740234375,
0.05224609375,
-0.00937652587890625,
0.039794921875,
-0.0136871337890625,
0.01313018798828125,
-0.04083251953125,
-0.0206451416015625,
-0.0252838134765625,
0.0253753662109375,
-0.042327880859375,
-0.0051727294921875,
0.024200439453125,
-0.00311279296875,
-0.04876708984375,
0.044219970703125,
-0.02325439453125,
0.07110595703125,
-0.0256805419921875,
-0.017913818359375,
0.03521728515625,
0.0078582763671875,
-0.03436279296875,
-0.09307861328125,
-0.0127410888671875,
-0.048065185546875,
0.037750244140625,
-0.0234222412109375,
-0.0228271484375,
-0.01708984375,
-0.0728759765625,
-0.0985107421875,
0.058624267578125,
-0.02056884765625,
-0.0298919677734375,
-0.0017232894897460938,
-0.0078887939453125,
-0.018798828125,
0.01715087890625,
-0.0022125244140625,
-0.0085906982421875,
0.0114593505859375,
0.03564453125,
0.0255889892578125,
0.036712646484375,
0.048095703125,
0.01248931884765625,
-0.0017299652099609375,
-0.0107269287109375,
-0.042388916015625,
0.006256103515625,
-0.0024318695068359375,
0.0014104843139648438,
0.0283660888671875,
0.042572021484375,
-0.014678955078125,
-0.026336669921875,
-0.003143310546875,
-0.0015592575073242188,
-0.0246429443359375,
-0.03668212890625,
-0.0198211669921875,
-0.0036411285400390625,
0.10107421875,
0.04779052734375,
0.0222015380859375,
-0.034881591796875,
-0.0192413330078125,
-0.0306854248046875,
-0.0290374755859375,
-0.01153564453125,
0.007358551025390625,
-0.039886474609375,
-0.0018253326416015625,
-0.010894775390625,
0.02471923828125,
0.00759124755859375,
-0.0170440673828125,
0.0175933837890625,
-0.031829833984375,
-0.0019397735595703125,
-0.00997161865234375,
0.006412506103515625,
-0.050384521484375,
0.04608154296875,
-0.03363037109375,
-0.0078582763671875,
0.0182037353515625,
0.03143310546875,
0.003391265869140625,
0.03851318359375,
0.0237274169921875,
0.02960205078125,
-0.061248779296875,
-0.006267547607421875,
0.0011415481567382812,
0.061248779296875,
-0.053497314453125,
-0.03704833984375,
-0.006496429443359375,
0.0225677490234375,
-0.01023101806640625,
0.0249176025390625,
0.00786590576171875,
0.015411376953125,
-0.0015974044799804688,
0.0205078125,
-0.05133056640625,
-0.003124237060546875,
-0.0175628662109375,
-0.01448822021484375,
-0.0028705596923828125,
0.0298309326171875,
0.055938720703125,
-0.0146484375,
0.0172271728515625,
-0.0071563720703125,
0.0123291015625,
0.0248565673828125,
-0.022796630859375,
-0.0012674331665039062,
-0.0311126708984375,
-0.01395416259765625
] |
020e3370051ad4bf2107abe2139fbfccd455be10
|
Wordpress Stackexchange
Q: Will it break my site if I delete all transient records in wp_options table? My site currently has an outrageous 500k+ transient records in the wp_options table.
This causes the table to be crashed frequently and so be my site.
I thought transient records will all expired after some time.
I'm not sure which plugins are responsible and what went wrong yet.
However, I don't want my site to crash frequently like this.
The number of records in wp_options table has grossly increased to 200k+ a few weeks ago and now 500k+.
Should I only delete the %transient_timeout% records - 200k+ of them at the moment?
Any help would be greatly appreciated.
Updates on 16th July 2012
I actually took risk (I backed up my site first) by deleting all the transient records and my site's database hasnt' crashed ever since :)
Thanks again, everyone!
A: This is a fairly definitive set of responses about transients
WPSE: Are transients garbage collected?
|
Q: Will it break my site if I delete all transient records in wp_options table? My site currently has an outrageous 500k+ transient records in the wp_options table.
This causes the table to be crashed frequently and so be my site.
I thought transient records will all expired after some time.
I'm not sure which plugins are responsible and what went wrong yet.
However, I don't want my site to crash frequently like this.
The number of records in wp_options table has grossly increased to 200k+ a few weeks ago and now 500k+.
Should I only delete the %transient_timeout% records - 200k+ of them at the moment?
Any help would be greatly appreciated.
Updates on 16th July 2012
I actually took risk (I backed up my site first) by deleting all the transient records and my site's database hasnt' crashed ever since :)
Thanks again, everyone!
A: This is a fairly definitive set of responses about transients
WPSE: Are transients garbage collected?
A: Transients, as a rule are temporary data. So if the person who coded the use of such data did so properly, you should be fine. My knowledge of the subject is limited, though, and I have not had much experience with them myself.
Your best bet will almost certainly be to back up your database, wipe out the data you don't think you need, then test your site. If your live site is heavily trafficked, be sure to test on a local instance so nobody is affected during testing.
A: Here's a simple function to clear all transients and timeouts - add extra to fit your needs.
function clear_transients()
{
global $wpdb;
// delete all "namespace" transients
$sql = "
DELETE
FROM {$wpdb->options}
WHERE option_name like '\_transient\_namespace\_%'
OR option_name like '\_transient\_timeout\_namespace\_%'
";
$wpdb->query($sql);
}
A: I used:
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_transient\_%');
to cleanup with great results :)
(from here https://stackoverflow.com/questions/10422574/can-i-remove-transients-in-the-wp-options-table-of-my-wordpress-install)
A: Transients are nothing but temporary options, which are kept in the database for a certain period, means they expire once their purpose is over.
For example: The _site_transient_update_plugins transient. It holds the information about the plugins which have updates available. If you delete this transient, and then refresh your dashboard, you'll find it back in your database. So, even if you delete a transient, WP will regenerate it. It won't break your site, but will definitely cause unexpected things to happen! Make sure you backup your DB before deleting any of these transient values.
A: Transients are suppose to be temporary, but if a developer coded stuff wrong, then after deleting all of the transients, you may need to re-save theme/plugin/widget settings to recreate transients. Most of the time this isn't an issue though, and you will be just fine to delete all of the transients on the site.
Once the transients are deleted, your theme and your plugins will need to rebuild the transients they rely on. This will cause a performance hit immediately the transients have been removed, after which the site should run slightly faster with the unnecessary transients that may have accumulated in your database now gone.
|
wordpress
|
{
"language": "en",
"length": 518,
"provenance": "stackexchange_00019.jsonl.gz:419839",
"question_score": "17",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51701"
}
|
[
0.07708740234375,
0.020233154296875,
-0.0143890380859375,
-0.04962158203125,
0.04425048828125,
-0.054412841796875,
0.046295166015625,
-0.00121307373046875,
0.0322265625,
-0.0005235671997070312,
-0.0467529296875,
-0.040863037109375,
0.002323150634765625,
-0.0186767578125,
-0.027587890625,
-0.045806884765625,
0.04058837890625,
-0.01493072509765625,
0.0298309326171875,
0.00719451904296875,
-0.006542205810546875,
0.033447265625,
0.01416778564453125,
-0.0076904296875,
0.0036907196044921875,
0.00914764404296875,
0.0709228515625,
-0.044189453125,
0.0068206787109375,
-0.042694091796875,
0.0160675048828125,
0.032501220703125,
-0.0160980224609375,
0.049224853515625,
0.01318359375,
0.048126220703125,
0.044708251953125,
0.01898193359375,
0.0235137939453125,
0.041961669921875,
-0.014892578125,
-0.0060272216796875,
0.0260162353515625,
-0.01055145263671875,
0.00679779052734375,
-0.0159149169921875,
-0.021270751953125,
-0.058349609375,
0.004547119140625,
-0.01080322265625,
0.00966644287109375,
0.0203094482421875,
0.020233154296875,
-0.044525146484375,
-0.0037555694580078125,
-0.00904083251953125,
-0.03515625,
-0.0310211181640625,
0.01056671142578125,
0.022857666015625,
0.0293426513671875,
0.0011930465698242188,
0.010772705078125,
0.005649566650390625,
-0.03533935546875,
-0.01050567626953125,
0.0149078369140625,
0.00931549072265625,
0.01380157470703125,
-0.02398681640625,
0.0096893310546875,
0.0134429931640625,
-0.02569580078125,
-0.044708251953125,
-0.0253448486328125,
0.0105438232421875,
0.0281982421875,
-0.0235595703125,
-0.0261993408203125,
0.014190673828125,
0.044921875,
-0.00830078125,
0.0013818740844726562,
0.01410675048828125,
-0.0035076141357421875,
0.017059326171875,
0.0065460205078125,
-0.01611328125,
-0.033203125,
-0.006961822509765625,
-0.0152740478515625,
-0.0870361328125,
-0.041229248046875,
0.03192138671875,
0.02972412109375,
-0.03326416015625,
0.0156402587890625,
0.04296875,
-0.003574371337890625,
0.004180908203125,
-0.00928497314453125,
-0.043670654296875,
-0.00237274169921875,
-0.0160675048828125,
0.025848388671875,
-0.01018524169921875,
-0.006877899169921875,
-0.041229248046875,
0.04180908203125,
0.01160430908203125,
-0.020843505859375,
0.03863525390625,
0.0146636962890625,
-0.0144500732421875,
0.0089263916015625,
-0.0295562744140625,
-0.060577392578125,
0.058349609375,
-0.00860595703125,
0.0163726806640625,
0.0012197494506835938,
0.00824737548828125,
-0.06512451171875,
-0.0506591796875,
0.0024738311767578125,
-0.06793212890625,
-0.04840087890625,
0.093017578125,
-0.058807373046875,
0.0009636878967285156,
-0.0236358642578125,
0.04034423828125,
0.032623291015625,
0.0135040283203125,
-0.0150909423828125,
-0.004215240478515625,
0.021240234375,
0.01027679443359375,
0.0282745361328125,
-0.0210418701171875,
0.0562744140625,
-0.03765869140625,
-0.0263824462890625,
0.05865478515625,
0.0256805419921875,
0.04974365234375,
0.03717041015625,
-0.01235198974609375,
-0.0293731689453125,
-0.0176544189453125,
-0.032379150390625,
0.029266357421875,
0.04754638671875,
-0.00699615478515625,
-0.004566192626953125,
-0.05572509765625,
0.07220458984375,
-0.04461669921875,
-0.029815673828125,
-0.07891845703125,
-0.06317138671875,
-0.0213165283203125,
0.045135498046875,
-0.014862060546875,
-0.0196380615234375,
0.0469970703125,
-0.01513671875,
-0.0135498046875,
0.0384521484375,
0.0272979736328125,
0.006633758544921875,
-0.076416015625,
0.0477294921875,
0.050872802734375,
0.007049560546875,
0.07806396484375,
-0.0007433891296386719,
-0.00011682510375976562,
0.04736328125,
-0.048858642578125,
-0.06500244140625,
-0.0616455078125,
0.04302978515625,
-0.033111572265625,
-0.037933349609375,
0.0250396728515625,
0.00441741943359375,
0.060028076171875,
0.024810791015625,
0.01215362548828125,
0.0040435791015625,
-0.018463134765625,
-0.0078887939453125,
0.03497314453125,
0.055511474609375,
-0.033172607421875,
-0.0692138671875,
-0.037261962890625,
0.015655517578125,
-0.054046630859375,
0.00433349609375,
0.039459228515625,
-0.01486968994140625,
-0.01470184326171875,
-0.030670166015625,
0.008453369140625,
-0.0097503662109375,
0.04266357421875,
-0.0123748779296875,
0.0212554931640625,
0.0177459716796875,
0.0011539459228515625,
-0.0587158203125,
0.09393310546875,
0.011993408203125,
0.00897979736328125,
-0.02056884765625,
0.021392822265625,
0.00943756103515625,
-0.004482269287109375,
0.032135009765625,
-0.00914764404296875,
0.0216064453125,
0.003238677978515625,
0.004856109619140625,
-0.0217132568359375,
0.00595855712890625,
-0.01103973388671875,
0.026519775390625,
-0.02154541015625,
0.04132080078125,
0.022064208984375,
-0.0146636962890625,
-0.01275634765625,
-0.0261688232421875,
0.000858306884765625,
-0.03582763671875,
-0.07843017578125,
-0.01038360595703125,
0.061126708984375,
0.0413818359375,
0.0011682510375976562,
0.00429534912109375,
0.0035877227783203125,
-0.00015878677368164062,
-0.07635498046875,
0.0096893310546875,
0.00240325927734375,
-0.005481719970703125,
0.03070068359375,
-0.02899169921875,
0.00681304931640625,
0.0267333984375,
0.0249176025390625,
-0.0238189697265625,
0.037506103515625,
-0.022003173828125,
-0.00775146484375,
0.01611328125,
-0.02593994140625,
-0.005916595458984375,
-0.047607421875,
-0.01300811767578125,
-0.0195465087890625,
0.0306854248046875,
0.007526397705078125,
0.01068115234375,
-0.00732421875,
0.0110015869140625,
0.0264434814453125,
0.0031585693359375,
-0.1058349609375,
0.0090789794921875,
0.038543701171875,
-0.0323486328125,
0.00891876220703125,
0.0088653564453125,
0.00592803955078125,
-0.0275115966796875,
0.005401611328125,
-0.016448974609375,
0.0667724609375,
-0.0163116455078125,
-0.0231170654296875,
-0.055633544921875,
-0.038665771484375,
-0.00908660888671875,
-0.0156707763671875,
-0.006374359130859375,
-0.038055419921875,
-0.014068603515625,
0.0276336669921875,
-0.01050567626953125,
0.0178680419921875,
0.05865478515625,
-0.022735595703125,
0.0135040283203125,
-0.039764404296875,
0.03558349609375,
-0.02532958984375,
0.046173095703125,
0.0670166015625,
-0.0244293212890625,
0.00835418701171875,
0.00844573974609375,
0.018463134765625,
0.03265380859375,
-0.022003173828125,
-0.01500701904296875,
0.012115478515625,
-0.056060791015625,
0.0079803466796875,
0.03753662109375,
0.10400390625,
0.01079559326171875,
-0.037017822265625,
0.0293121337890625,
0.06683349609375,
-0.0144805908203125,
-0.068115234375,
-0.0020008087158203125,
-0.0038738250732421875,
-0.0281219482421875,
-0.0218963623046875,
-0.005176544189453125,
0.004638671875,
-0.024139404296875,
-0.00042366981506347656,
-0.06488037109375,
-0.0230560302734375,
-0.006786346435546875,
-0.044830322265625,
-0.020477294921875,
-0.005123138427734375,
0.003185272216796875,
0.0181884765625,
-0.0153350830078125,
0.07330322265625,
-0.005329132080078125,
-0.055999755859375,
-0.05377197265625,
0.002597808837890625,
-0.0165863037109375,
-0.03045654296875,
-0.02923583984375,
0.00450897216796875,
0.0066375732421875,
0.01261138916015625,
-0.0164642333984375,
0.0111083984375,
0.011383056640625,
-0.0267791748046875,
-0.0165557861328125,
0.00540924072265625,
0.05609130859375,
-0.0513916015625,
-0.0202789306640625,
0.0701904296875,
0.033935546875,
-0.0013017654418945312,
-0.01161956787109375,
0.004119873046875,
-0.028839111328125,
-0.0011768341064453125,
-0.01030731201171875,
-0.0120391845703125,
0.014312744140625,
-0.005222320556640625,
-0.0229034423828125,
-0.03369140625,
0.0110321044921875,
-0.0216522216796875,
-0.0279388427734375,
-0.01629638671875,
-0.021270751953125,
0.006572723388671875,
0.044647216796875,
-0.01593017578125,
-0.01165771484375,
0.016876220703125,
-0.0292510986328125,
-0.00460052490234375,
-0.018707275390625,
0.00514984130859375,
-0.02362060546875,
0.0222015380859375,
-0.0273590087890625,
0.00839996337890625,
-0.0172119140625,
-0.025177001953125,
-0.011383056640625,
0.0693359375,
-0.0247802734375,
-0.021820068359375,
-0.0244598388671875,
0.030670166015625,
-0.00693511962890625,
-0.02459716796875,
0.03802490234375,
-0.028961181640625,
-0.01849365234375,
0.00960540771484375,
-0.014404296875,
0.0047607421875,
-0.033172607421875,
0.01349639892578125,
0.013671875,
-0.028961181640625,
0.005931854248046875,
-0.05780029296875,
0.0179443359375,
-0.0394287109375,
-0.01255035400390625,
-0.044464111328125,
0.003604888916015625,
-0.06805419921875,
-0.055084228515625,
-0.0258636474609375,
-0.0189056396484375,
0.044952392578125,
0.02142333984375,
-0.04595947265625,
-0.00678253173828125,
0.03765869140625,
-0.00817108154296875,
0.0252838134765625,
-0.001239776611328125,
0.00400543212890625,
0.01015472412109375,
0.00841522216796875,
0.0169525146484375,
-0.0015020370483398438,
-0.0037937164306640625,
-0.05157470703125,
-0.0292510986328125,
-0.035400390625,
-0.037384033203125,
0.038665771484375,
-0.033111572265625,
-0.001129150390625,
-0.01129150390625,
-0.0238189697265625,
-0.062225341796875,
0.00504302978515625,
-0.0302581787109375,
-0.01126861572265625,
-0.0267181396484375,
-0.0382080078125,
0.065673828125,
0.006610870361328125,
0.0263671875,
0.01507568359375,
0.0416259765625,
-0.015167236328125,
-0.034759521484375,
-0.05322265625,
0.01116943359375,
-0.00385284423828125,
-0.017822265625,
0.033966064453125,
-0.006137847900390625,
0.01104736328125,
0.034423828125,
-0.037200927734375,
-0.020538330078125,
-0.058746337890625,
0.025238037109375,
-0.00836944580078125,
0.0015153884887695312,
-0.005916595458984375,
-0.060577392578125,
0.1044921875,
0.0037593841552734375,
-0.0080108642578125,
0.0006184577941894531,
-0.00836181640625,
0.024078369140625,
-0.0066070556640625,
-0.0007600784301757812,
-0.045013427734375,
-0.05694580078125,
0.0028362274169921875,
-0.0218353271484375,
0.010498046875,
0.01568603515625,
0.002559661865234375,
0.04571533203125,
0.0303192138671875,
-0.0012350082397460938,
-0.00555419921875,
0.06719970703125,
-0.0191802978515625,
0.038848876953125,
-0.0034770965576171875,
-0.0212554931640625,
-0.060516357421875,
0.003997802734375,
0.048492431640625,
-0.06378173828125,
-0.0888671875,
-0.00873565673828125,
-0.0313720703125,
0.017486572265625,
0.07928466796875,
0.0250701904296875,
0.003009796142578125,
0.02642822265625,
-0.0234832763671875,
0.0007982254028320312,
0.0029659271240234375,
0.032318115234375,
-0.038726806640625,
0.02728271484375,
-0.00037670135498046875,
-0.0006241798400878906,
0.0046539306640625,
0.0078582763671875,
0.0105133056640625,
0.0033054351806640625,
-0.0146484375,
0.0382080078125,
0.01751708984375,
0.0273284912109375,
0.00838470458984375,
-0.002460479736328125,
0.0025482177734375,
-0.002399444580078125,
-0.004039764404296875,
-0.068603515625,
0.025054931640625,
0.039520263671875,
0.056396484375,
-0.001201629638671875,
-0.05450439453125,
0.005168914794921875,
-0.0374755859375,
-0.01416015625,
0.0160369873046875,
-0.043060302734375,
-0.044036865234375,
-0.0231781005859375,
0.0194091796875,
0.0256195068359375,
-0.016754150390625,
0.0391845703125,
0.0024776458740234375,
0.01177978515625,
0.03387451171875,
-0.036346435546875,
0.041259765625,
-0.06463623046875,
-0.046417236328125,
-0.0548095703125,
-0.056427001953125,
-0.028564453125,
-0.048736572265625,
0.0093994140625,
-0.004070281982421875,
-0.0101165771484375,
-0.0011692047119140625,
0.0233612060546875,
-0.027679443359375,
-0.041534423828125,
0.0146331787109375,
-0.01319122314453125,
-0.01018524169921875,
-0.01024627685546875,
-0.0601806640625,
-0.0312042236328125,
-0.0186309814453125,
-0.01055145263671875,
-0.0244903564453125,
0.046966552734375,
0.0024204254150390625,
-0.027984619140625,
-0.0201263427734375,
0.0101470947265625,
0.0028476715087890625,
-0.0183563232421875,
-0.049713134765625,
-0.0088653564453125,
0.0289306640625,
0.032623291015625,
-0.01276397705078125,
-0.015655517578125,
0.007598876953125,
0.036590576171875,
-0.027587890625,
0.026275634765625,
0.0185394287109375,
0.020172119140625,
-0.019744873046875,
0.049407958984375,
0.022857666015625,
-0.051055908203125,
-0.0694580078125,
-0.01007080078125,
-0.027313232421875,
0.06634521484375,
-0.032257080078125,
0.0294189453125,
-0.050689697265625,
0.00923919677734375,
-0.0193634033203125,
0.037689208984375,
-0.08282470703125,
-0.0190582275390625,
0.0186920166015625,
-0.00630950927734375,
0.01377105712890625,
-0.0123291015625,
0.018341064453125,
-0.0135650634765625,
-0.00798797607421875,
0.004718780517578125,
0.01537322998046875,
-0.007190704345703125,
0.022857666015625,
0.03753662109375,
0.006252288818359375,
0.0016384124755859375,
0.022857666015625,
-0.014434814453125,
-0.046844482421875,
0.027435302734375,
-0.0232696533203125,
-0.05487060546875,
0.032958984375,
0.0160980224609375,
-0.01532745361328125,
0.029541015625,
-0.04022216796875,
0.0093994140625,
0.018157958984375,
0.0513916015625,
-0.0223846435546875,
-0.0069580078125,
-0.0003809928894042969,
-0.05322265625,
0.00693511962890625,
-0.0197906494140625,
-0.0038623809814453125,
-0.00899505615234375,
0.01074981689453125,
-0.001255035400390625,
-0.0413818359375,
-0.0026092529296875,
0.007480621337890625,
-0.0158538818359375,
-0.031768798828125,
0.0030574798583984375,
-0.0010538101196289062,
-0.0280914306640625,
0.03985595703125,
0.01459503173828125,
-0.005950927734375,
-0.035125732421875,
0.0184478759765625,
-0.0025844573974609375,
-0.0016355514526367188,
-0.03753662109375,
0.035552978515625,
0.0036487579345703125,
-0.011993408203125,
0.03472900390625,
0.0073394775390625,
0.057159423828125,
0.028228759765625,
0.01218414306640625,
0.0156402587890625,
-0.01325225830078125,
0.05352783203125,
0.019073486328125,
-0.023773193359375,
0.029296875,
0.042755126953125,
-0.036376953125,
0.02020263671875,
-0.00244903564453125,
-0.0197296142578125,
-0.0038471221923828125,
-0.0229034423828125,
0.0601806640625,
-0.048828125,
0.0028591156005859375,
0.0325927734375,
-0.00946807861328125,
-0.0173797607421875,
-0.006130218505859375,
-0.04779052734375,
-0.0106353759765625,
-0.0128021240234375,
-0.04150390625,
-0.07086181640625,
0.017333984375,
-0.0174407958984375,
-0.038421630859375,
0.053253173828125,
-0.007747650146484375,
0.00983428955078125,
0.03118896484375,
0.00856781005859375,
-0.039825439453125,
-0.016082763671875,
-0.01284027099609375,
0.0271148681640625,
-0.036468505859375,
0.0129852294921875,
-0.02264404296875,
0.0028667449951171875,
0.00055694580078125,
0.015350341796875,
0.08831787109375,
0.0252227783203125,
-0.00803375244140625,
-0.0258941650390625,
0.0263671875,
0.0007309913635253906,
-0.05474853515625,
0.035064697265625,
-0.0006346702575683594,
0.0277557373046875,
0.03863525390625,
-0.046478271484375,
0.016326904296875,
0.0123291015625,
-0.0047607421875,
0.0149993896484375,
0.002689361572265625,
-0.004863739013671875,
0.004467010498046875,
-0.01273345947265625,
0.000385284423828125,
-0.0086669921875,
-0.0126800537109375,
-0.0005803108215332031,
0.014404296875,
0.01406097412109375,
0.003910064697265625,
-0.01207733154296875,
-0.006214141845703125,
-0.0157470703125,
0.038330078125,
0.007015228271484375,
-0.033203125,
0.051483154296875,
0.01505279541015625,
-0.04034423828125,
0.0140228271484375,
0.0033016204833984375,
0.00208282470703125,
-0.00868988037109375,
0.0269317626953125,
0.0202178955078125,
0.0156707763671875,
-0.02703857421875,
-0.006427764892578125,
0.00827789306640625,
0.03875732421875,
-0.0227813720703125,
-0.0469970703125,
0.01392364501953125,
0.004146575927734375,
0.0208282470703125,
0.01523590087890625,
0.0177154541015625,
0.0202484130859375,
0.039703369140625,
0.04150390625,
0.006977081298828125,
-0.02093505859375,
0.003437042236328125,
0.023193359375,
0.076904296875,
-0.047027587890625,
0.02374267578125,
0.01181793212890625,
-0.0225372314453125,
0.0228424072265625,
0.01438140869140625,
0.0026073455810546875,
0.023345947265625,
0.023406982421875,
-0.00012934207916259766,
-0.01263427734375,
0.0560302734375,
-0.0106964111328125,
0.00815582275390625,
-0.027191162109375,
-0.064208984375,
0.01319122314453125,
0.030853271484375,
-0.01114654541015625,
0.01306915283203125,
0.03350830078125,
0.03240966796875,
-0.0399169921875,
-0.015411376953125,
0.0494384765625,
-0.0234222412109375,
-0.033203125,
-0.03167724609375,
-0.0271759033203125,
0.0309906005859375,
-0.006122589111328125,
0.054840087890625,
0.006748199462890625,
-0.006664276123046875,
-0.00910186767578125,
0.01468658447265625,
0.0079498291015625,
-0.027923583984375,
0.0537109375,
0.038299560546875,
0.0234832763671875,
0.0310211181640625,
-0.0210113525390625,
-0.01435089111328125,
-0.035614013671875,
0.046905517578125,
-0.0272979736328125,
0.00775146484375,
0.04119873046875,
0.0106201171875,
-0.0116119384765625,
-0.0379638671875,
0.0007410049438476562,
0.031524658203125,
-0.01222991943359375,
0.029693603515625,
0.0276336669921875,
-0.0174713134765625,
-0.03143310546875,
-0.014251708984375,
0.0083160400390625,
0.02264404296875,
-0.045166015625,
0.107421875,
-0.04681396484375,
-0.0011749267578125,
0.0184478759765625,
-0.016754150390625,
0.0528564453125,
0.036224365234375,
-0.0048675537109375,
0.033660888671875,
0.00894927978515625,
-0.042938232421875,
-0.04608154296875,
0.0009369850158691406,
0.0299530029296875,
-0.01197052001953125,
0.00995635986328125,
-0.0219879150390625,
0.020538330078125,
-0.00438690185546875,
0.0073089599609375,
-0.0196075439453125,
-0.004062652587890625,
0.058685302734375,
0.01348114013671875,
-0.00165557861328125,
0.01020050048828125,
0.034393310546875,
0.005069732666015625,
0.016693115234375,
0.01113128662109375,
0.0276031494140625,
0.010772705078125,
0.0295867919921875,
0.0263824462890625,
-0.00897216796875,
-0.00672149658203125,
-0.04461669921875,
-0.0260162353515625,
0.019989013671875,
-0.0225067138671875,
0.0090179443359375,
-0.00021219253540039062,
0.05291748046875,
0.01116180419921875,
-0.0369873046875,
0.019989013671875,
-0.0267333984375,
-0.0204010009765625,
-0.03863525390625,
0.0504150390625,
0.0234222412109375,
0.05194091796875,
-0.024505615234375,
0.016571044921875,
0.000003933906555175781,
0.00301361083984375,
0.0288543701171875,
-0.0169219970703125,
-0.0146331787109375,
-0.0264434814453125,
0.028106689453125,
0.0266876220703125,
-0.028900146484375,
0.0304107666015625,
-0.005367279052734375,
-0.049468994140625,
0.033447265625,
0.0267181396484375,
-0.025726318359375,
-0.0037746429443359375,
-0.024749755859375,
-0.046966552734375,
-0.02947998046875,
0.053497314453125,
-0.0240631103515625,
-0.002471923828125,
0.02410888671875,
0.0021495819091796875,
-0.00859832763671875,
-0.007221221923828125,
-0.0072174072265625,
0.038238525390625,
-0.041168212890625,
-0.02313232421875,
0.01947021484375,
0.0188140869140625,
-0.00872802734375,
-0.059967041015625,
-0.01422119140625,
-0.0163726806640625,
0.0213165283203125,
-0.0169830322265625,
0.01959228515625,
0.0092620849609375,
-0.031097412109375,
-0.02606201171875,
0.053558349609375,
-0.005512237548828125,
-0.017242431640625,
-0.0102691650390625,
-0.0426025390625,
-0.037139892578125,
0.07293701171875,
0.0160980224609375,
-0.03460693359375,
-0.0080413818359375,
0.055694580078125,
0.0333251953125,
0.0587158203125,
-0.0021610260009765625,
0.0102081298828125,
-0.032684326171875,
0.031768798828125,
0.01312255859375,
0.0816650390625,
-0.03619384765625,
0.0150299072265625,
0.0160675048828125,
0.06134033203125,
0.014617919921875,
-0.0023059844970703125,
0.0277099609375,
-0.06195068359375,
0.0010890960693359375,
-0.002864837646484375,
-0.0218048095703125,
0.01329803466796875,
0.06640625,
0.055938720703125,
0.02435302734375,
-0.041046142578125,
0.01299285888671875,
-0.052337646484375,
-0.0083465576171875,
-0.0438232421875,
-0.0012884140014648438,
-0.046630859375,
-0.0200042724609375,
0.00739288330078125,
0.00609588623046875,
0.02197265625,
-0.02642822265625,
0.015289306640625,
-0.01666259765625,
0.01983642578125,
-0.018707275390625,
0.0124664306640625,
-0.004940032958984375,
-0.056121826171875,
-0.002227783203125,
-0.04998779296875,
-0.024810791015625,
0.02508544921875,
-0.0595703125,
-0.0233154296875,
-0.02801513671875,
-0.0085601806640625,
-0.0264129638671875,
0.0299072265625,
-0.0189056396484375,
0.040679931640625,
-0.03082275390625,
-0.0051116943359375,
0.0227813720703125,
0.01383209228515625,
-0.001430511474609375,
0.001201629638671875,
-0.00864410400390625,
0.042205810546875,
-0.023101806640625,
0.006847381591796875,
0.01129913330078125,
0.05377197265625,
-0.00989532470703125,
0.06536865234375,
-0.01629638671875,
-0.036529541015625,
0.00704193115234375,
-0.037445068359375,
0.0005059242248535156,
-0.01508331298828125,
-0.01108551025390625,
-0.05560302734375,
0.003795623779296875,
-0.039825439453125,
0.0181732177734375,
0.0173187255859375
] |
550d0917a66136d3167500152bb75ab14e3034e9
|
Wordpress Stackexchange
Q: What filters are applied to the_content function? How does WordPress convert raw data from the database to a readable format in the_content function?
I've noticed that it applies the_content filter, but what does the_content filter do?
A: the default filters are set in /wp-includes/default-filters.php;
for 'the_content' this is from line 135:
add_filter( 'the_content', 'wptexturize' );
add_filter( 'the_content', 'convert_smilies' );
add_filter( 'the_content', 'convert_chars' );
add_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'shortcode_unautop' );
add_filter( 'the_content', 'prepend_attachment' );
to trace the individual functions, you could try and use http://phpxref.ftwr.co.uk/wordpress/nav.html?_functions/index.html
then follow the links...
Edit
Missed one (wp-includes/default-filters.php, line 102):
// Format WordPress
foreach ( array( 'the_content', 'the_title' ) as $filter )
add_filter( $filter, 'capital_P_dangit', 11 );
|
Q: What filters are applied to the_content function? How does WordPress convert raw data from the database to a readable format in the_content function?
I've noticed that it applies the_content filter, but what does the_content filter do?
A: the default filters are set in /wp-includes/default-filters.php;
for 'the_content' this is from line 135:
add_filter( 'the_content', 'wptexturize' );
add_filter( 'the_content', 'convert_smilies' );
add_filter( 'the_content', 'convert_chars' );
add_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'shortcode_unautop' );
add_filter( 'the_content', 'prepend_attachment' );
to trace the individual functions, you could try and use http://phpxref.ftwr.co.uk/wordpress/nav.html?_functions/index.html
then follow the links...
Edit
Missed one (wp-includes/default-filters.php, line 102):
// Format WordPress
foreach ( array( 'the_content', 'the_title' ) as $filter )
add_filter( $filter, 'capital_P_dangit', 11 );
A: All filters are stored in the global $wp_filter variable. You can inspect that variable to see which functions are bound to a certain filter.
global $wp_filter;
print_r($wp_filter['the_content']);
To exactly understand the array that gets outputted, knowing how the $wp_filter variable is built up helps a lot. This line is from the source of the add_filter() function:
$wp_filter[$tag][$priority][$idx] = array('function' => $function_to_add, 'accepted_args' => $accepted_args);
A:
but what does the_content filter do?
The content_filter enables you to return custom content before or after the content.
2 very basic practical examples of using the_content filter in a custom function are as follows:
This example returns custom content before the content
add_filter( 'the_content', 'return_before_content' );
function return_before_content( $content ) {
if ( is_singular('post')) {
$before_content = '<p>Text Returned Before the_content</p>';
$content = $before_content . $content;
}
return $content;
}
This example returns custom content after the content
add_filter( 'the_content', 'return_after_content' );
function return_after_content( $content ) {
if ( is_singular('post')) {
$after_content = '<p>Text Returned After the_content</p>';
$content = $content . $after_content;
}
return $content;
}
|
wordpress
|
{
"language": "en",
"length": 287,
"provenance": "stackexchange_00019.jsonl.gz:419844",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51732"
}
|
[
0.036590576171875,
0.02008056640625,
-0.00582122802734375,
-0.03582763671875,
0.048736572265625,
-0.03851318359375,
0.05072021484375,
-0.0338134765625,
0.03326416015625,
0.010162353515625,
-0.0296630859375,
-0.070068359375,
0.000484466552734375,
-0.044342041015625,
-0.0379638671875,
-0.06622314453125,
0.0198516845703125,
-0.016143798828125,
0.00997161865234375,
-0.01558685302734375,
-0.01038360595703125,
-0.0109405517578125,
0.01087188720703125,
-0.005817413330078125,
0.0098114013671875,
-0.026092529296875,
0.09552001953125,
-0.041900634765625,
0.035797119140625,
-0.01715087890625,
0.01556396484375,
-0.00962066650390625,
0.03363037109375,
0.0157318115234375,
-0.057342529296875,
0.055084228515625,
0.01074981689453125,
-0.005039215087890625,
-0.01036834716796875,
0.037689208984375,
0.0056915283203125,
-0.005619049072265625,
0.0265350341796875,
-0.0038661956787109375,
0.003662109375,
-0.023040771484375,
0.03216552734375,
-0.035888671875,
0.0032329559326171875,
0.001499176025390625,
0.02947998046875,
0.01175689697265625,
0.032470703125,
-0.055633544921875,
0.006317138671875,
0.0060272216796875,
-0.0482177734375,
0.0143585205078125,
0.029144287109375,
0.005397796630859375,
-0.0104217529296875,
-0.01030731201171875,
0.00580596923828125,
-0.014617919921875,
0.007015228271484375,
0.020172119140625,
0.040679931640625,
-0.001708984375,
-0.01947021484375,
0.017181396484375,
0.01271820068359375,
-0.0238037109375,
0.000743865966796875,
-0.034332275390625,
-0.0025043487548828125,
0.04461669921875,
-0.0264739990234375,
-0.002330780029296875,
0.045135498046875,
-0.0204315185546875,
0.0090179443359375,
-0.005126953125,
-0.00267791748046875,
0.0004189014434814453,
0.0050048828125,
0.016632080078125,
-0.00872802734375,
-0.024017333984375,
-0.002147674560546875,
0.01338958740234375,
0.004383087158203125,
0.050018310546875,
-0.0271148681640625,
-0.001132965087890625,
-0.01042938232421875,
-0.0291900634765625,
0.004505157470703125,
0.0484619140625,
0.0015687942504882812,
0.02557373046875,
0.0180206298828125,
-0.051239013671875,
0.04693603515625,
-0.043609619140625,
0.00789642333984375,
0.00862884521484375,
-0.033538818359375,
0.02191162109375,
0.066162109375,
0.05535888671875,
0.00728607177734375,
0.0138397216796875,
-0.035736083984375,
-0.0413818359375,
-0.012420654296875,
0.03375244140625,
-0.0264129638671875,
-0.001964569091796875,
0.004619598388671875,
-0.0015048980712890625,
0.0170135498046875,
0.006237030029296875,
0.01300048828125,
-0.042724609375,
0.01357269287109375,
-0.0243377685546875,
-0.053375244140625,
0.00461578369140625,
0.0006723403930664062,
0.039794921875,
-0.0162506103515625,
-0.02337646484375,
0.00815582275390625,
0.04656982421875,
-0.0005669593811035156,
-0.026336669921875,
0.0243988037109375,
-0.028564453125,
-0.025726318359375,
0.042266845703125,
0.00972747802734375,
-0.0015964508056640625,
0.004352569580078125,
-0.005634307861328125,
0.0026073455810546875,
0.0198822021484375,
0.02655029296875,
0.033477783203125,
-0.0197296142578125,
-0.061737060546875,
0.01983642578125,
0.017425537109375,
0.044036865234375,
-0.01290130615234375,
-0.027435302734375,
-0.032501220703125,
0.0169830322265625,
-0.05010986328125,
-0.0258331298828125,
-0.054901123046875,
0.05413818359375,
-0.02191162109375,
-0.05535888671875,
0.0175323486328125,
-0.007213592529296875,
0.0264434814453125,
-0.0228729248046875,
0.002349853515625,
0.0163726806640625,
-0.020843505859375,
-0.030242919921875,
0.0016298294067382812,
-0.001323699951171875,
-0.0188446044921875,
-0.005283355712890625,
0.0101165771484375,
-0.040069580078125,
0.032501220703125,
0.00600433349609375,
0.05999755859375,
0.03704833984375,
-0.027862548828125,
0.0299530029296875,
0.025238037109375,
-0.044921875,
-0.00907135009765625,
0.02435302734375,
0.036865234375,
0.0222625732421875,
0.0282440185546875,
-0.0004017353057861328,
0.00018167495727539062,
-0.032928466796875,
-0.0007376670837402344,
0.0104522705078125,
-0.056488037109375,
0.0022869110107421875,
-0.03887939453125,
0.00762176513671875,
0.0399169921875,
0.07220458984375,
0.0015621185302734375,
0.0180206298828125,
-0.0085296630859375,
-0.035247802734375,
0.0018854141235351562,
-0.01241302490234375,
0.0009832382202148438,
-0.03179931640625,
-0.0325927734375,
0.0228271484375,
-0.0352783203125,
-0.019927978515625,
0.0139617919921875,
-0.04425048828125,
0.007415771484375,
-0.020263671875,
-0.05316162109375,
0.008453369140625,
-0.022064208984375,
0.01226806640625,
0.00746917724609375,
-0.0273284912109375,
0.022003173828125,
0.06134033203125,
-0.011444091796875,
-0.0110321044921875,
-0.017547607421875,
0.046051025390625,
-0.01184844970703125,
-0.0038127899169921875,
0.04718017578125,
0.050994873046875,
0.016876220703125,
-0.0457763671875,
-0.015106201171875,
-0.033782958984375,
-0.07769775390625,
-0.01502227783203125,
0.09197998046875,
0.042449951171875,
0.062408447265625,
-0.001346588134765625,
-0.0280303955078125,
0.1268310546875,
0.00220489501953125,
0.01410675048828125,
-0.03302001953125,
0.05303955078125,
0.06695556640625,
-0.038238525390625,
-0.0457763671875,
0.01471710205078125,
-0.08209228515625,
0.033355712890625,
0.008453369140625,
-0.0106658935546875,
-0.0110931396484375,
0.0026226043701171875,
0.0216522216796875,
0.00795745849609375,
0.016448974609375,
0.007843017578125,
-0.0012073516845703125,
-0.008026123046875,
0.018951416015625,
0.01800537109375,
0.01407623291015625,
-0.0218353271484375,
-0.00015556812286376953,
0.015960693359375,
0.036895751953125,
-0.01377105712890625,
0.02545166015625,
0.01397705078125,
-0.0173492431640625,
-0.02838134765625,
0.00145721435546875,
0.00858306884765625,
0.0040283203125,
-0.0095977783203125,
0.0709228515625,
0.00508880615234375,
-0.030303955078125,
-0.0237884521484375,
0.007171630859375,
-0.0087890625,
-0.03662109375,
0.0009021759033203125,
-0.0433349609375,
-0.02593994140625,
0.06689453125,
-0.00548553466796875,
0.032806396484375,
0.029876708984375,
-0.0130157470703125,
0.0270233154296875,
-0.029083251953125,
0.031219482421875,
-0.050994873046875,
0.0169219970703125,
0.0439453125,
-0.0229949951171875,
-0.0184478759765625,
0.00879669189453125,
0.038055419921875,
0.003925323486328125,
0.0188446044921875,
0.007091522216796875,
0.0088043212890625,
-0.06109619140625,
-0.0135650634765625,
0.01042938232421875,
0.0309600830078125,
-0.039520263671875,
-0.04437255859375,
-0.0296478271484375,
-0.0038585662841796875,
-0.067138671875,
0.0013875961303710938,
-0.0213165283203125,
-0.06494140625,
-0.063720703125,
-0.00881195068359375,
-0.04412841796875,
0.043701171875,
-0.0181427001953125,
-0.0023136138916015625,
-0.00994873046875,
-0.01210784912109375,
-0.0748291015625,
-0.030181884765625,
-0.07183837890625,
0.045074462890625,
-0.022216796875,
0.04534912109375,
0.021026611328125,
0.0284423828125,
0.03228759765625,
-0.0131988525390625,
0.045989990234375,
0.0052337646484375,
-0.036163330078125,
-0.00018525123596191406,
-0.01494598388671875,
-0.012451171875,
-0.0176849365234375,
-0.0107421875,
-0.0024127960205078125,
0.01287841796875,
-0.00403594970703125,
0.01218414306640625,
-0.019989013671875,
0.014129638671875,
-0.01227569580078125,
0.036468505859375,
0.033966064453125,
0.007694244384765625,
0.0160980224609375,
-0.0457763671875,
0.0005125999450683594,
-0.0109710693359375,
-0.034423828125,
0.03802490234375,
0.0244293212890625,
-0.0080108642578125,
-0.00820159912109375,
0.007694244384765625,
0.006587982177734375,
0.0208740234375,
0.0215606689453125,
-0.0076904296875,
-0.043792724609375,
-0.005451202392578125,
-0.01129913330078125,
0.0141448974609375,
0.02227783203125,
-0.0200042724609375,
0.0193634033203125,
0.0191650390625,
0.023773193359375,
0.0223541259765625,
-0.006649017333984375,
0.00983428955078125,
-0.07708740234375,
0.056243896484375,
-0.0227203369140625,
-0.015228271484375,
-0.051055908203125,
-0.031036376953125,
-0.0205841064453125,
0.09466552734375,
-0.058685302734375,
-0.010650634765625,
0.0202178955078125,
0.017120361328125,
0.033477783203125,
-0.019317626953125,
-0.0221099853515625,
-0.037109375,
-0.054962158203125,
-0.0147247314453125,
-0.033416748046875,
-0.0250396728515625,
0.000423431396484375,
-0.054656982421875,
-0.004177093505859375,
-0.04766845703125,
0.034149169921875,
0.0224456787109375,
0.0023956298828125,
0.0308685302734375,
0.0132293701171875,
-0.001155853271484375,
-0.007720947265625,
0.0016489028930664062,
-0.0689697265625,
-0.00998687744140625,
-0.0195770263671875,
0.041656494140625,
0.030975341796875,
-0.055877685546875,
-0.020843505859375,
0.0309906005859375,
0.0104522705078125,
-0.0007739067077636719,
0.0036163330078125,
-0.01100921630859375,
0.038543701171875,
0.00833892822265625,
0.0049591064453125,
-0.00522613525390625,
0.0090484619140625,
-0.03179931640625,
-0.015777587890625,
0.02984619140625,
-0.040008544921875,
0.065673828125,
-0.045989990234375,
0.0051727294921875,
-0.07177734375,
-0.05987548828125,
-0.04510498046875,
-0.007053375244140625,
-0.0275115966796875,
0.002094268798828125,
-0.041656494140625,
-0.07098388671875,
0.06884765625,
-0.0034694671630859375,
-0.0207061767578125,
-0.003459930419921875,
0.0687255859375,
0.0179595947265625,
-0.03961181640625,
-0.0227813720703125,
-0.0150299072265625,
0.033172607421875,
-0.038116455078125,
0.09307861328125,
0.050567626953125,
-0.0173492431640625,
0.0992431640625,
0.0053253173828125,
0.0209808349609375,
-0.033111572265625,
0.0771484375,
0.004669189453125,
0.007720947265625,
0.0178070068359375,
-0.0030460357666015625,
0.01454925537109375,
0.0094757080078125,
-0.0234222412109375,
-0.00738525390625,
0.0214080810546875,
0.0182647705078125,
-0.0263519287109375,
0.03802490234375,
-0.0083465576171875,
-0.004657745361328125,
0.004589080810546875,
0.02349853515625,
0.01045989990234375,
0.006214141845703125,
0.01340484619140625,
-0.03033447265625,
0.019805908203125,
0.01849365234375,
0.0305328369140625,
0.045928955078125,
-0.0153961181640625,
0.048309326171875,
-0.0024204254150390625,
0.0013875961303710938,
-0.00812530517578125,
0.00022113323211669922,
0.0204925537109375,
-0.01806640625,
-0.035919189453125,
0.00998687744140625,
-0.004383087158203125,
-0.0268707275390625,
0.037872314453125,
-0.006313323974609375,
-0.01995849609375,
0.02532958984375,
-0.0242767333984375,
0.01461029052734375,
0.00931549072265625,
0.0245819091796875,
-0.0218658447265625,
-0.0005841255187988281,
-0.0207977294921875,
-0.01617431640625,
0.031158447265625,
-0.038360595703125,
-0.04949951171875,
0.00243377685546875,
0.0069122314453125,
0.001766204833984375,
0.0143585205078125,
0.0292816162109375,
0.009735107421875,
-0.0009784698486328125,
-0.01203155517578125,
0.027313232421875,
0.0232696533203125,
-0.046295166015625,
-0.043609619140625,
0.0015115737915039062,
0.028961181640625,
-0.048370361328125,
-0.00800323486328125,
0.043792724609375,
0.01314544677734375,
0.00786590576171875,
-0.012054443359375,
-0.0163116455078125,
-0.0084075927734375,
-0.0103759765625,
-0.00916290283203125,
0.007595062255859375,
-0.0036182403564453125,
0.0005826950073242188,
0.0010023117065429688,
-0.018585205078125,
0.03436279296875,
-0.036102294921875,
0.012359619140625,
-0.01029205322265625,
-0.01515960693359375,
0.044952392578125,
-0.0318603515625,
-0.01812744140625,
-0.049652099609375,
0.026763916015625,
-0.0276947021484375,
0.0196533203125,
0.0435791015625,
-0.0270843505859375,
0.014495849609375,
-0.0074005126953125,
-0.0009388923645019531,
0.00675201416015625,
0.0228118896484375,
0.01751708984375,
-0.0090179443359375,
0.017608642578125,
-0.0183563232421875,
-0.04864501953125,
-0.0284271240234375,
-0.0252685546875,
-0.030731201171875,
-0.01149749755859375,
-0.0016202926635742188,
-0.01378631591796875,
-0.001354217529296875,
-0.003818511962890625,
-0.019622802734375,
-0.006847381591796875,
0.01641845703125,
0.00920867919921875,
-0.0011491775512695312,
-0.0267486572265625,
0.1356201171875,
-0.0070648193359375,
0.0928955078125,
0.015838623046875,
0.0604248046875,
-0.042083740234375,
-0.011932373046875,
-0.003604888916015625,
-0.05194091796875,
-0.01458740234375,
0.0019702911376953125,
-0.000827789306640625,
0.014801025390625,
0.005550384521484375,
-0.00257110595703125,
0.047821044921875,
-0.0260467529296875,
-0.01410675048828125,
-0.0155792236328125,
0.01271820068359375,
-0.049407958984375,
0.0150146484375,
-0.00433349609375,
-0.00240325927734375,
0.052032470703125,
0.0080108642578125,
-0.0369873046875,
0.02056884765625,
-0.0024929046630859375,
0.01461029052734375,
0.034912109375,
-0.01363372802734375,
0.057373046875,
0.042144775390625,
-0.0390625,
-0.005237579345703125,
0.0284576416015625,
-0.0323486328125,
-0.01335906982421875,
-0.01873779296875,
0.00994110107421875,
-0.00650787353515625,
0.01346588134765625,
-0.021453857421875,
-0.00247955322265625,
-0.0126190185546875,
-0.028564453125,
0.0288543701171875,
0.07672119140625,
0.07464599609375,
-0.10528564453125,
0.00519561767578125,
0.0242462158203125,
-0.0233306884765625,
-0.00035643577575683594,
0.0273895263671875,
-0.01849365234375,
0.0021877288818359375,
0.018829345703125,
-0.01465606689453125,
-0.00669097900390625,
0.025482177734375,
0.0283203125,
-0.0038852691650390625,
0.0190887451171875,
0.025238037109375,
0.004146575927734375,
-0.004177093505859375,
-0.03143310546875,
-0.0044403076171875,
-0.01506805419921875,
-0.0236053466796875,
0.02996826171875,
-0.02984619140625,
-0.00656890869140625,
-0.040069580078125,
-0.00701141357421875,
0.011566162109375,
-0.007965087890625,
-0.00711822509765625,
-0.0092926025390625,
0.00489044189453125,
0.053009033203125,
-0.040374755859375,
0.037750244140625,
0.030181884765625,
0.0031890869140625,
-0.0152130126953125,
0.0125274658203125,
0.0221405029296875,
0.031463623046875,
-0.047882080078125,
0.021636962890625,
-0.027069091796875,
-0.006999969482421875,
-0.004024505615234375,
-0.06829833984375,
0.032501220703125,
-0.01434326171875,
-0.008758544921875,
0.0291595458984375,
-0.007030487060546875,
-0.0133056640625,
-0.041473388671875,
0.0457763671875,
-0.0736083984375,
-0.021392822265625,
-0.007762908935546875,
-0.00815582275390625,
-0.0209808349609375,
-0.044952392578125,
-0.04998779296875,
0.042938232421875,
-0.0152587890625,
0.0083465576171875,
0.02178955078125,
0.0031890869140625,
-0.05511474609375,
-0.033447265625,
-0.035888671875,
0.05096435546875,
0.0227508544921875,
0.0570068359375,
-0.072265625,
-0.0322265625,
0.0174102783203125,
0.061676025390625,
0.028228759765625,
0.005859375,
-0.0263519287109375,
0.00390625,
0.0716552734375,
0.038970947265625,
0.017120361328125,
0.0204010009765625,
-0.00951385498046875,
0.041748046875,
0.029571533203125,
-0.0465087890625,
0.0176544189453125,
-0.0140380859375,
-0.0255889892578125,
0.014862060546875,
0.03143310546875,
0.0257568359375,
0.0221099853515625,
0.01556396484375,
-0.0233154296875,
-0.0002846717834472656,
0.03094482421875,
-0.041717529296875,
-0.02838134765625,
0.0594482421875,
0.024658203125,
-0.09857177734375,
-0.049957275390625,
-0.04931640625,
0.0396728515625,
-0.00981903076171875,
0.05218505859375,
0.06304931640625,
0.027679443359375,
0.061767578125,
-0.0172882080078125,
0.0260467529296875,
-0.0186309814453125,
-0.0034503936767578125,
0.0458984375,
0.027862548828125,
0.0005102157592773438,
-0.03082275390625,
0.0037784576416015625,
0.005828857421875,
0.04852294921875,
-0.0377197265625,
-0.036651611328125,
0.0094757080078125,
0.007656097412109375,
0.0205841064453125,
0.006389617919921875,
0.025299072265625,
-0.040985107421875,
-0.025238037109375,
-0.041351318359375,
-0.0037021636962890625,
0.048248291015625,
-0.01474761962890625,
-0.0038356781005859375,
-0.0007610321044921875,
0.004940032958984375,
0.005443572998046875,
-0.0192108154296875,
0.00567626953125,
0.03204345703125,
0.052947998046875,
-0.019012451171875,
0.08135986328125,
-0.034423828125,
-0.027923583984375,
-0.0310211181640625,
0.045562744140625,
-0.01132965087890625,
0.03192138671875,
-0.04156494140625,
-0.0229339599609375,
-0.004913330078125,
0.033172607421875,
0.03570556640625,
-0.01397705078125,
0.0477294921875,
0.0265045166015625,
-0.04656982421875,
-0.01153564453125,
0.01502227783203125,
-0.0212249755859375,
-0.0245513916015625,
-0.03729248046875,
-0.0004551410675048828,
0.01953125,
0.01430511474609375,
0.003963470458984375,
0.01806640625,
0.0243072509765625,
-0.03125,
0.019317626953125,
-0.0092926025390625,
-0.0304412841796875,
0.040069580078125,
-0.008453369140625,
0.05255126953125,
-0.01358795166015625,
-0.09234619140625,
-0.0026378631591796875,
-0.0174407958984375,
-0.09771728515625,
0.03912353515625,
0.052886962890625,
-0.0274505615234375,
-0.0006308555603027344,
-0.00977325439453125,
-0.0244903564453125,
0.006282806396484375,
0.033966064453125,
-0.026947021484375,
-0.00543975830078125,
0.029022216796875,
-0.04437255859375,
-0.0185089111328125,
-0.005832672119140625,
-0.00897979736328125,
0.045684814453125,
0.00982666015625,
0.08123779296875,
-0.037811279296875,
0.03021240234375,
0.0007658004760742188,
-0.0297393798828125,
0.0166015625,
0.00246429443359375,
0.0025386810302734375,
0.01702880859375,
0.0088653564453125,
-0.0292510986328125,
-0.00969696044921875,
-0.0177001953125,
0.056182861328125,
-0.03521728515625,
-0.0181121826171875,
0.004558563232421875,
0.0249786376953125,
-0.0236053466796875,
0.057342529296875,
-0.00756072998046875,
-0.0015840530395507812,
-0.034027099609375,
-0.0343017578125,
0.054962158203125,
0.0258941650390625,
0.01934814453125,
0.0377197265625,
0.04864501953125,
0.039825439453125,
0.01486968994140625,
0.00975799560546875,
0.0210723876953125,
0.030029296875,
-0.0050811767578125,
-0.042510986328125,
-0.0191650390625,
-0.01873779296875,
-0.0006213188171386719,
-0.003269195556640625,
0.0306854248046875,
0.0065460205078125,
-0.0247802734375,
-0.044586181640625,
-0.016571044921875,
0.03265380859375,
-0.0019855499267578125,
0.02130126953125,
-0.047088623046875,
0.01358795166015625,
0.00853729248046875,
0.012603759765625,
-0.00836181640625,
-0.0218505859375,
-0.03912353515625,
-0.0206756591796875,
-0.0291900634765625,
-0.0830078125,
-0.039642333984375,
0.011962890625,
0.006328582763671875,
-0.001708984375,
-0.020904541015625,
0.001445770263671875,
-0.00838470458984375,
0.0198211669921875,
-0.0186309814453125,
0.0245361328125,
-0.0171051025390625,
-0.03326416015625,
-0.04345703125,
-0.039398193359375,
-0.05511474609375,
0.032958984375,
-0.032440185546875,
0.0250244140625,
0.05780029296875,
-0.0264892578125,
-0.0109405517578125,
0.026031494140625,
0.0035953521728515625,
0.08575439453125,
-0.037567138671875,
-0.035186767578125,
0.0316162109375,
-0.0295257568359375,
0.004791259765625,
-0.0202178955078125,
-0.015472412109375,
-0.0218353271484375,
0.0004324913024902344,
0.02581787109375,
-0.0251922607421875,
0.01175689697265625,
-0.0301971435546875,
-0.07623291015625,
-0.0126800537109375,
0.01024627685546875,
-0.0362548828125,
-0.0279998779296875,
-0.0063018798828125,
-0.00435638427734375,
-0.023223876953125,
-0.02362060546875,
0.01107025146484375,
-0.036285400390625,
0.01233673095703125,
-0.0009131431579589844,
0.0355224609375,
0.0243377685546875,
-0.0189971923828125,
-0.031829833984375,
0.0014295578002929688,
-0.0087890625,
-0.00229644775390625,
0.0330810546875,
-0.032379150390625,
0.034027099609375,
0.02923583984375,
-0.0214691162109375,
-0.017059326171875,
-0.0070037841796875,
-0.0347900390625,
0.006748199462890625,
-0.004688262939453125,
-0.024200439453125,
-0.006343841552734375,
0.055938720703125,
0.023895263671875,
0.0167388916015625,
-0.00606536865234375,
0.007213592529296875,
0.005401611328125,
-0.006011962890625,
-0.015960693359375,
0.0047607421875,
-0.0399169921875,
-0.0305328369140625,
-0.02020263671875,
-0.019927978515625,
0.0046844482421875,
-0.058319091796875,
-0.029632568359375,
-0.013336181640625,
-0.0411376953125,
0.01079559326171875,
0.013916015625,
-0.07476806640625,
-0.005901336669921875,
-0.0033931732177734375,
-0.01398468017578125,
0.00518035888671875,
0.03973388671875,
-0.0218658447265625,
0.0594482421875,
-0.06671142578125,
-0.01503753662109375,
0.0156402587890625,
0.0012569427490234375,
0.00038504600524902344,
-0.01104736328125,
0.021636962890625,
0.031646728515625,
0.0018062591552734375,
-0.006092071533203125,
-0.006000518798828125,
-0.0033054351806640625,
0.01078033447265625,
0.00722503662109375,
-0.019927978515625,
0.0335693359375,
-0.0300445556640625,
0.01168060302734375,
-0.030426025390625,
0.034271240234375,
-0.0421142578125,
-0.0024852752685546875,
-0.0009541511535644531,
-0.0235443115234375,
0.01091766357421875,
-0.0126953125,
0.004116058349609375,
-0.00875091552734375,
-0.0040435791015625,
-0.06622314453125,
-0.01454925537109375,
0.0021495819091796875
] |
aa6906f47a6514867172fd27881484e8c37b25fa
|
Wordpress Stackexchange
Q: Get post content from outside the loop Is there a way to get the content from another outside the loop? The ID is 302 and I need to display the content of that on another page.
A: to get the content of the post outside the loop you can write something like this
global $post;
$content = $post->post_content;
if ( !empty( $content ) ) :
echo $content;
endif;
|
Q: Get post content from outside the loop Is there a way to get the content from another outside the loop? The ID is 302 and I need to display the content of that on another page.
A: to get the content of the post outside the loop you can write something like this
global $post;
$content = $post->post_content;
if ( !empty( $content ) ) :
echo $content;
endif;
A: You can use get_page() to return the $post object of a static page:
$page_id = 302;
$page_object = get_page( $page_id );
echo $page_object->post_content;
Edit
Similarly, you can use get_post() to return the $post object of a post:
$post_id = 302;
$post_object = get_post( $post_id );
echo $post_object->post_content;
A: If your content include shortcodes, you should use:
$post_id = 22;
$post_object = get_post( $post_id );
echo do_shortcode( $post_object->post_content );
A: Was looking for the same thing, I'm surprised nobody said this:
$pageID = 302;
echo get_the_content(null, false, $pageID);
Works good! :)
A: For completeness, building on Tim's comment above and inspired by Stephen Harris's article, the solution that enables use of the_content() is:
$post_id = 302;
global $post;
$post = get_post($post_id);
setup_postdata( $post );
the_content();
wp_reset_postdata( $post );
And hence filters get applied (paragraphs will be inserted etc.) and shortcodes work.
A: You can use, as said, the solution with get_post and $post_object->post_content, but don't forget to add a check before you use that post object:
function get_post_content( $post_id = null ) {
$post_object = get_post( $post_id );
if ( ! $post_object ) { return ''; }
//else
return apply_filters('the_content', $post_object->post_content);
}
echo get_post_content( $other_post_id );
A: Since you know your target post ID (302), you may find useful this shorthand syntax that you can use out of the loop (though its performance is pretty much the same as in any other alternative method:)
echo(get_post_field('post_content',302));
A: You can use the get_post_data() function to get post outside the loop. Place this code in functions.php
function get_post_data($postId) {
global $wpdb;
return $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID=$postId");
}
and then add this snippet for more control on the process
<?php $data = get_post_data(302);
echo $data->post_date; // post date
echo $data->post_title; // post title
echo $data->post_content; // post content
echo $data->comment_count; // comments number
?>
A: you can put content in a category X and use query_post before while like this :
<?php query_posts('cat=X&showposts=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<?= get_the_content(); ?>
<?php endwhile; ?>
A: use wp_reset_postdata(); it will work.. (edited)
<?php
$args = array(
'post_type' => 'posttype',
'p' => 'post_id'
);
$the_query = new WP_Query( $args );
if( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif;
wp_reset_postdata();
?>
posttype can be "post" , "page" or your custom post type. Here p=302 is your post id.. Hope it will work.
A: You can simply call get_the_content(postId)
<?php echo get_the_content($postId); ?>
|
wordpress
|
{
"language": "en",
"length": 477,
"provenance": "stackexchange_00019.jsonl.gz:419848",
"question_score": "26",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51741"
}
|
[
0.041656494140625,
-0.022918701171875,
-0.014617919921875,
0.0043182373046875,
0.0211181640625,
-0.052703857421875,
0.06951904296875,
-0.01438140869140625,
0.033538818359375,
0.01485443115234375,
-0.08917236328125,
0.00574493408203125,
-0.052703857421875,
0.023895263671875,
-0.0377197265625,
-0.0634765625,
0.020721435546875,
-0.028472900390625,
0.0273590087890625,
-0.003192901611328125,
0.0007009506225585938,
-0.01007843017578125,
0.028045654296875,
0.009307861328125,
0.0235595703125,
-0.020904541015625,
0.04107666015625,
0.0205078125,
-0.01507568359375,
-0.0215606689453125,
0.021820068359375,
0.0021305084228515625,
0.019775390625,
0.01959228515625,
-0.046905517578125,
-0.049285888671875,
-0.0251922607421875,
0.0124359130859375,
-0.0149993896484375,
0.0275115966796875,
0.00727081298828125,
0.00738525390625,
0.036224365234375,
0.06121826171875,
-0.0115203857421875,
-0.00897979736328125,
-0.018890380859375,
-0.06719970703125,
0.01134490966796875,
0.035858154296875,
0.0301971435546875,
0.0130767822265625,
0.01959228515625,
0.062042236328125,
-0.00922393798828125,
0.004154205322265625,
0.01404571533203125,
-0.055450439453125,
0.057525634765625,
-0.04364013671875,
-0.060516357421875,
-0.06097412109375,
0.061248779296875,
-0.032135009765625,
0.0009264945983886719,
0.0023365020751953125,
0.03326416015625,
0.018798828125,
-0.05145263671875,
0.0023632049560546875,
0.044525146484375,
-0.023651123046875,
-0.004520416259765625,
-0.0213470458984375,
-0.02606201171875,
-0.0188751220703125,
0.02587890625,
-0.0455322265625,
-0.01442718505859375,
0.0063018798828125,
-0.06585693359375,
0.0180511474609375,
-0.0904541015625,
-0.03704833984375,
-0.01261138916015625,
-0.023162841796875,
-0.0224456787109375,
0.0174560546875,
-0.01261138916015625,
-0.010009765625,
-0.01395416259765625,
0.047393798828125,
0.0034656524658203125,
-0.01490020751953125,
-0.050537109375,
-0.0188140869140625,
0.016387939453125,
0.03619384765625,
-0.0172882080078125,
0.01407623291015625,
0.006496429443359375,
-0.04937744140625,
0.044769287109375,
-0.04461669921875,
0.0027751922607421875,
0.0044708251953125,
0.0276031494140625,
-0.0203094482421875,
0.0294189453125,
0.00775146484375,
-0.0272674560546875,
0.091552734375,
-0.002899169921875,
-0.01459503173828125,
-0.04937744140625,
0.0323486328125,
-0.012298583984375,
-0.01678466796875,
0.012451171875,
-0.0036334991455078125,
-0.005603790283203125,
0.01018524169921875,
-0.01116180419921875,
0.005046844482421875,
0.032135009765625,
0.0274658203125,
-0.006671905517578125,
-0.021453857421875,
0.0179443359375,
0.038909912109375,
-0.031158447265625,
0.00943756103515625,
0.0266876220703125,
0.0020236968994140625,
-0.00852203369140625,
-0.021820068359375,
-0.0208587646484375,
-0.01303863525390625,
-0.04302978515625,
0.042144775390625,
-0.010650634765625,
-0.052764892578125,
-0.0162811279296875,
-0.0231781005859375,
-0.01338958740234375,
0.0291900634765625,
0.0343017578125,
-0.00543212890625,
-0.0226898193359375,
-0.0731201171875,
0.004756927490234375,
-0.0030956268310546875,
0.01047515869140625,
-0.01381683349609375,
0.049530029296875,
-0.06201171875,
0.035919189453125,
-0.03436279296875,
0.01934814453125,
-0.0161590576171875,
0.0168609619140625,
0.0045318603515625,
0.02734375,
-0.0181121826171875,
-0.052490234375,
0.0058135986328125,
-0.04986572265625,
-0.0206146240234375,
0.03155517578125,
0.043426513671875,
0.010711669921875,
-0.032501220703125,
-0.0268096923828125,
-0.010986328125,
-0.0192108154296875,
0.018157958984375,
-0.008636474609375,
-0.0355224609375,
0.0215301513671875,
0.0389404296875,
-0.022552490234375,
-0.0360107421875,
0.0018491744995117188,
-0.0059661865234375,
-0.046630859375,
0.0179595947265625,
0.0194854736328125,
0.040802001953125,
0.019989013671875,
0.0001806020736694336,
0.041015625,
-0.005786895751953125,
-0.034759521484375,
0.01904296875,
-0.01300048828125,
-0.0011892318725585938,
-0.0026149749755859375,
0.0233306884765625,
-0.0113067626953125,
-0.0253143310546875,
0.00623321533203125,
0.00653076171875,
-0.01221466064453125,
0.0203399658203125,
-0.007526397705078125,
-0.01386260986328125,
0.00835418701171875,
-0.007762908935546875,
0.020843505859375,
0.023406982421875,
0.0023021697998046875,
-0.0170135498046875,
0.0031337738037109375,
-0.047271728515625,
-0.04345703125,
0.01160430908203125,
-0.0112152099609375,
0.00823974609375,
0.02093505859375,
0.044769287109375,
0.020355224609375,
0.006793975830078125,
-0.00176239013671875,
-0.035858154296875,
0.08154296875,
-0.033966064453125,
-0.0048370361328125,
-0.047882080078125,
0.0501708984375,
0.00917816162109375,
-0.058380126953125,
0.01132965087890625,
0.01172637939453125,
-0.0006155967712402344,
-0.021881103515625,
-0.002620697021484375,
0.00388336181640625,
-0.0623779296875,
-0.005321502685546875,
0.051513671875,
0.028350830078125,
0.07275390625,
-0.01702880859375,
-0.0093536376953125,
0.087158203125,
-0.0205230712890625,
-0.0039520263671875,
-0.00579833984375,
0.030914306640625,
0.04510498046875,
-0.0257110595703125,
0.005035400390625,
0.04510498046875,
0.00342559814453125,
0.01873779296875,
0.035369873046875,
0.00678253173828125,
0.016021728515625,
-0.051605224609375,
0.047943115234375,
-0.0028839111328125,
0.01302337646484375,
-0.02777099609375,
-0.00696563720703125,
0.020172119140625,
-0.01479339599609375,
0.0296478271484375,
0.0183563232421875,
-0.0211181640625,
-0.04388427734375,
0.0189971923828125,
0.043212890625,
0.00858306884765625,
0.02203369140625,
-0.031829833984375,
-0.004680633544921875,
-0.0102996826171875,
-0.0161285400390625,
0.0168914794921875,
-0.01067352294921875,
-0.0288543701171875,
-0.0293121337890625,
-0.023101806640625,
-0.007549285888671875,
0.0138092041015625,
-0.0057830810546875,
0.0180511474609375,
-0.00972747802734375,
-0.006809234619140625,
0.01361846923828125,
0.01273345947265625,
0.067626953125,
-0.00807952880859375,
0.036102294921875,
-0.030548095703125,
0.0189208984375,
0.0259857177734375,
-0.004100799560546875,
0.009063720703125,
-0.0029277801513671875,
0.06689453125,
0.05743408203125,
0.006198883056640625,
-0.00687408447265625,
0.01055908203125,
0.0013971328735351562,
0.01111602783203125,
0.00699615478515625,
0.014312744140625,
0.035919189453125,
-0.078857421875,
-0.010711669921875,
0.0214996337890625,
0.04644775390625,
-0.00409698486328125,
-0.04022216796875,
0.007419586181640625,
0.032135009765625,
-0.06695556640625,
-0.086669921875,
0.041229248046875,
-0.06671142578125,
-0.0309906005859375,
-0.039306640625,
-0.040130615234375,
-0.0029697418212890625,
-0.0207672119140625,
-0.01421356201171875,
0.0310211181640625,
-0.05145263671875,
-0.09332275390625,
-0.0538330078125,
-0.08953857421875,
0.01119232177734375,
-0.00464630126953125,
0.0279541015625,
0.00949859619140625,
-0.002643585205078125,
0.006221771240234375,
-0.0626220703125,
-0.0232696533203125,
0.041229248046875,
-0.0269927978515625,
-0.019775390625,
-0.054595947265625,
0.0145111083984375,
-0.049591064453125,
0.0168304443359375,
0.007373809814453125,
-0.03570556640625,
0.0115814208984375,
-0.00027489662170410156,
-0.048614501953125,
0.008636474609375,
0.01947021484375,
-0.045166015625,
0.039337158203125,
0.0740966796875,
0.0223846435546875,
0.00984954833984375,
-0.055511474609375,
0.005855560302734375,
-0.07440185546875,
-0.00997161865234375,
0.07464599609375,
-0.00957489013671875,
-0.000017404556274414062,
-0.0200653076171875,
-0.0173797607421875,
-0.016082763671875,
-0.05462646484375,
-0.0198974609375,
0.053497314453125,
0.0014085769653320312,
0.02288818359375,
0.053009033203125,
0.003597259521484375,
-0.0179443359375,
0.031951904296875,
0.00788116455078125,
0.0350341796875,
0.011505126953125,
0.026275634765625,
-0.02142333984375,
-0.0184783935546875,
0.03704833984375,
0.0163726806640625,
0.05218505859375,
-0.0209197998046875,
-0.04815673828125,
0.0069580078125,
0.1103515625,
-0.04754638671875,
0.0016078948974609375,
-0.01171875,
-0.014007568359375,
0.01263427734375,
-0.031280517578125,
-0.048980712890625,
-0.0252227783203125,
0.0004277229309082031,
0.00543212890625,
0.0006093978881835938,
-0.0017242431640625,
-0.034393310546875,
0.060699462890625,
-0.006130218505859375,
-0.0008697509765625,
0.0208282470703125,
0.0096893310546875,
0.0361328125,
-0.01242828369140625,
0.01190948486328125,
-0.0021533966064453125,
-0.01666259765625,
-0.0160369873046875,
-0.051300048828125,
-0.0018672943115234375,
0.0014963150024414062,
0.050201416015625,
0.0143280029296875,
0.00386810302734375,
0.00711822509765625,
0.04156494140625,
-0.0135498046875,
0.033050537109375,
-0.00493621826171875,
0.0255584716796875,
0.01666259765625,
-0.02423095703125,
0.001888275146484375,
-0.0286407470703125,
-0.041107177734375,
-0.041229248046875,
0.04034423828125,
0.04913330078125,
-0.039031982421875,
-0.0177459716796875,
-0.06256103515625,
0.0266876220703125,
-0.03863525390625,
0.00449371337890625,
0.026824951171875,
0.0025043487548828125,
-0.022125244140625,
0.020751953125,
0.00897216796875,
-0.0216217041015625,
0.0440673828125,
0.0675048828125,
-0.034210205078125,
-0.003391265869140625,
0.0167694091796875,
0.02020263671875,
-0.051513671875,
-0.0689697265625,
-0.03369140625,
0.03271484375,
-0.048431396484375,
0.05731201171875,
0.054534912109375,
-0.01280975341796875,
0.048980712890625,
0.00024628639221191406,
-0.004150390625,
0.01123046875,
0.06903076171875,
0.01142120361328125,
-0.002655029296875,
0.012786865234375,
-0.01476287841796875,
-0.017913818359375,
0.0157623291015625,
-0.04571533203125,
0.0223236083984375,
-0.0061187744140625,
0.00759124755859375,
-0.03912353515625,
0.049407958984375,
-0.0176849365234375,
-0.0091094970703125,
-0.01361083984375,
0.002323150634765625,
0.045684814453125,
0.04925537109375,
0.00020873546600341797,
0.018310546875,
0.037322998046875,
0.006137847900390625,
0.0254974365234375,
-0.0087890625,
0.005702972412109375,
0.0382080078125,
0.006694793701171875,
-0.013916015625,
0.024749755859375,
-0.00678253173828125,
0.01555633544921875,
-0.0196075439453125,
-0.0261688232421875,
-0.012908935546875,
-0.004871368408203125,
0.018035888671875,
0.037567138671875,
0.0017604827880859375,
-0.0157470703125,
0.01030731201171875,
0.0003426074981689453,
0.01401519775390625,
0.042816162109375,
0.01490020751953125,
0.004184722900390625,
0.0009236335754394531,
-0.01444244384765625,
-0.0108795166015625,
-0.032623291015625,
0.08380126953125,
-0.0533447265625,
0.034759521484375,
-0.00791168212890625,
0.0321044921875,
0.01910400390625,
0.006771087646484375,
0.0219879150390625,
-0.004322052001953125,
0.026641845703125,
-0.033447265625,
0.01273345947265625,
-0.03155517578125,
-0.021148681640625,
0.0182342529296875,
0.07037353515625,
0.00885772705078125,
0.005344390869140625,
-0.0015439987182617188,
-0.016143798828125,
-0.02032470703125,
0.0472412109375,
0.0491943359375,
-0.0248565673828125,
-0.03558349609375,
-0.01308441162109375,
0.01361846923828125,
0.04022216796875,
0.00795745849609375,
-0.0177001953125,
-0.01177978515625,
-0.0209197998046875,
-0.00878143310546875,
-0.03857421875,
-0.0084228515625,
-0.0018024444580078125,
-0.00971221923828125,
-0.0171966552734375,
-0.02874755859375,
-0.0045166015625,
0.002834320068359375,
-0.0159149169921875,
-0.0020751953125,
0.04132080078125,
-0.005451202392578125,
0.004833221435546875,
-0.0164947509765625,
-0.0012054443359375,
-0.028961181640625,
-0.01181793212890625,
0.0728759765625,
0.0308074951171875,
-0.0087432861328125,
0.031158447265625,
-0.059234619140625,
0.002376556396484375,
-0.00543212890625,
-0.0828857421875,
-0.01508331298828125,
-0.048065185546875,
0.0131988525390625,
0.037811279296875,
0.00585174560546875,
-0.0283203125,
-0.0183563232421875,
0.01125335693359375,
0.01519775390625,
0.0540771484375,
-0.0197906494140625,
0.0545654296875,
-0.00788116455078125,
0.029266357421875,
0.01210784912109375,
0.0192108154296875,
-0.0274505615234375,
-0.01258087158203125,
-0.039794921875,
-0.07635498046875,
0.0367431640625,
0.02728271484375,
0.031707763671875,
0.0221099853515625,
-0.034912109375,
0.034942626953125,
-0.016815185546875,
-0.015045166015625,
0.0022830963134765625,
-0.0235443115234375,
0.037994384765625,
-0.00875091552734375,
-0.0311279296875,
0.0015382766723632812,
0.014404296875,
-0.00882720947265625,
-0.0128936767578125,
0.0163116455078125,
-0.04010009765625,
0.0257415771484375,
-0.033782958984375,
-0.0194549560546875,
-0.0389404296875,
0.038116455078125,
0.064208984375,
-0.022308349609375,
0.03289794921875,
0.0285491943359375,
0.0005459785461425781,
0.042816162109375,
0.035888671875,
0.01800537109375,
-0.04400634765625,
0.05853271484375,
0.01312255859375,
-0.0396728515625,
0.0258941650390625,
-0.05157470703125,
0.0007925033569335938,
0.0180816650390625,
0.05316162109375,
-0.044677734375,
0.0004138946533203125,
0.023590087890625,
-0.0193634033203125,
-0.007049560546875,
-0.00325775146484375,
-0.01210784912109375,
0.0023059844970703125,
0.05340576171875,
-0.0026073455810546875,
-0.011627197265625,
0.032623291015625,
0.00724029541015625,
-0.008270263671875,
-0.01427459716796875,
0.006862640380859375,
0.0290069580078125,
-0.04779052734375,
0.049102783203125,
0.0251617431640625,
0.050506591796875,
-0.051300048828125,
0.022796630859375,
-0.00013935565948486328,
0.01202392578125,
-0.0309295654296875,
0.03851318359375,
0.0038280487060546875,
0.0205535888671875,
-0.0130462646484375,
-0.0006780624389648438,
-0.017608642578125,
0.0263519287109375,
-0.021087646484375,
-0.006500244140625,
-0.0084991455078125,
-0.016204833984375,
0.0164642333984375,
-0.0004642009735107422,
0.00836944580078125,
0.00283050537109375,
-0.0009431838989257812,
0.00626373291015625,
-0.0115509033203125,
-0.0203857421875,
-0.01132965087890625,
-0.00827789306640625,
0.0426025390625,
-0.01258087158203125,
-0.01611328125,
0.054901123046875,
0.01538848876953125,
-0.03619384765625,
0.0023784637451171875,
0.022216796875,
-0.017669677734375,
0.0251617431640625,
0.0203857421875,
0.0379638671875,
-0.024566650390625,
-0.01308441162109375,
-0.0673828125,
0.08001708984375,
0.004917144775390625,
0.003131866455078125,
0.01995849609375,
0.0219268798828125,
-0.056884765625,
-0.01546478271484375,
-0.058624267578125,
0.061676025390625,
0.0218658447265625,
0.03729248046875,
-0.07171630859375,
-0.026397705078125,
0.0031261444091796875,
0.04425048828125,
0.0187225341796875,
-0.00560760498046875,
-0.0278778076171875,
-0.04931640625,
-0.0020503997802734375,
0.0645751953125,
0.0200347900390625,
-0.0007357597351074219,
0.0347900390625,
0.03759765625,
0.08526611328125,
-0.029632568359375,
0.042236328125,
-0.0283660888671875,
0.036041259765625,
0.0494384765625,
0.030975341796875,
-0.004383087158203125,
0.09259033203125,
-0.00004398822784423828,
-0.04803466796875,
0.051788330078125,
0.0222930908203125,
0.0445556640625,
-0.025482177734375,
0.045074462890625,
0.0175018310546875,
-0.03936767578125,
-0.006175994873046875,
-0.03717041015625,
0.04034423828125,
0.01332855224609375,
0.037017822265625,
0.021270751953125,
0.0197601318359375,
0.09375,
-0.041900634765625,
0.00582122802734375,
-0.00760650634765625,
-0.0014286041259765625,
0.043365478515625,
0.0195159912109375,
0.01175689697265625,
-0.03839111328125,
0.03826904296875,
0.0308685302734375,
0.03564453125,
-0.03668212890625,
0.0211029052734375,
0.01727294921875,
0.02276611328125,
-0.0197296142578125,
-0.047882080078125,
-0.007808685302734375,
0.025543212890625,
0.0310211181640625,
-0.0421142578125,
-0.00525665283203125,
0.0254364013671875,
0.031951904296875,
0.00479888916015625,
-0.006195068359375,
-0.064453125,
-0.0252227783203125,
-0.035858154296875,
0.013702392578125,
0.0254669189453125,
0.03680419921875,
0.0040283203125,
0.03369140625,
-0.01708984375,
-0.01050567626953125,
0.01393890380859375,
0.01409149169921875,
0.0161895751953125,
-0.01036834716796875,
-0.00885772705078125,
-0.030731201171875,
0.020050048828125,
0.0230255126953125,
0.05230712890625,
-0.017364501953125,
0.039581298828125,
0.0211944580078125,
-0.01522064208984375,
-0.00730133056640625,
-0.0023784637451171875,
-0.00997161865234375,
0.048126220703125,
-0.057373046875,
-0.007648468017578125,
-0.01824951171875,
-0.0206451416015625,
-0.01654052734375,
-0.052276611328125,
0.0430908203125,
0.0183868408203125,
0.046539306640625,
0.00789642333984375,
0.00179290771484375,
-0.00469970703125,
-0.04364013671875,
0.046661376953125,
0.019195556640625,
-0.0830078125,
-0.0135650634765625,
-0.0261077880859375,
-0.018798828125,
0.015167236328125,
0.041900634765625,
-0.0117645263671875,
-0.0009355545043945312,
0.01082611083984375,
-0.02392578125,
0.0242156982421875,
-0.00274658203125,
0.0016279220581054688,
0.0223236083984375,
0.00937652587890625,
-0.004238128662109375,
-0.0523681640625,
-0.0457763671875,
-0.0265045166015625,
0.046539306640625,
0.0343017578125,
-0.041107177734375,
0.041259765625,
0.051483154296875,
-0.007244110107421875,
0.019439697265625,
-0.0171051025390625,
-0.00856781005859375,
-0.01580810546875,
0.01467132568359375,
0.031463623046875,
-0.007328033447265625,
-0.0267333984375,
0.0194091796875,
0.034423828125,
-0.00879669189453125,
0.01560211181640625,
-0.049407958984375,
0.024932861328125,
-0.03143310546875,
-0.0132904052734375,
-0.00823974609375,
0.023223876953125,
0.02764892578125,
-0.0014905929565429688,
0.0513916015625,
0.0352783203125,
-0.0298004150390625,
-0.00258636474609375,
-0.007659912109375,
-0.020721435546875,
0.01056671142578125,
0.026763916015625,
0.01161956787109375,
0.0303955078125,
-0.04376220703125,
-0.01885986328125,
-0.027801513671875,
-0.021453857421875,
0.046478271484375,
-0.0172119140625,
0.0494384765625,
-0.00933074951171875,
0.034423828125,
0.0078277587890625,
-0.00034046173095703125,
0.04736328125,
-0.019256591796875,
0.01251220703125,
0.00984954833984375,
0.00754547119140625,
0.0068359375,
-0.0203857421875,
-0.0184173583984375,
-0.04437255859375,
-0.0017108917236328125,
0.008941650390625,
-0.01108551025390625,
-0.0204925537109375,
-0.02227783203125,
-0.0185089111328125,
0.038970947265625,
0.00018155574798583984,
-0.0181732177734375,
-0.0244293212890625,
-0.0005540847778320312,
0.03558349609375,
0.0020751953125,
0.05523681640625,
-0.005092620849609375,
0.02447509765625,
-0.054168701171875,
-0.001125335693359375,
-0.0107269287109375,
0.0008721351623535156,
0.005062103271484375,
0.0124664306640625,
0.0172271728515625,
-0.0218505859375,
-0.006622314453125,
0.031494140625,
0.0136260986328125,
0.06524658203125,
0.02374267578125,
0.004642486572265625,
-0.01531982421875,
0.036224365234375,
-0.038482666015625,
-0.033050537109375,
0.038665771484375,
-0.014923095703125,
-0.057342529296875,
-0.00140380859375,
-0.00748443603515625,
0.0241546630859375,
-0.014495849609375,
-0.032257080078125,
-0.005573272705078125,
0.01247406005859375,
-0.0309295654296875,
-0.0234527587890625,
0.0003342628479003906,
0.0162811279296875,
-0.0269012451171875,
-0.01079559326171875,
-0.0189666748046875,
-0.0479736328125,
-0.0033054351806640625,
0.035400390625,
-0.03753662109375,
0.058013916015625,
-0.00635528564453125,
-0.07000732421875,
0.00785064697265625,
0.0004372596740722656,
0.031463623046875,
-0.0022716522216796875,
0.0091094970703125,
-0.0015888214111328125,
-0.00975799560546875,
-0.05828857421875,
0.0077056884765625,
-0.0015325546264648438,
0.054412841796875,
-0.0016622543334960938,
-0.03155517578125,
-0.0188446044921875,
-0.0169830322265625,
0.033294677734375,
0.03277587890625,
0.0147857666015625,
-0.031951904296875,
0.0302581787109375,
-0.000522613525390625,
-0.0557861328125,
0.0164642333984375,
0.0258331298828125,
-0.04608154296875,
-0.011016845703125,
0.0036907196044921875,
-0.0213470458984375,
0.0191192626953125,
-0.0200958251953125,
-0.043304443359375,
-0.0028076171875,
-0.0386962890625,
-0.00959014892578125,
-0.021697998046875,
-0.00913238525390625,
0.03564453125,
-0.0261688232421875,
-0.003772735595703125,
0.017364501953125,
-0.007289886474609375,
0.0140533447265625,
0.047515869140625,
0.00960540771484375,
-0.018646240234375,
-0.050933837890625,
0.00152587890625,
-0.01171112060546875,
0.0853271484375,
-0.037017822265625,
-0.04095458984375,
-0.0159454345703125,
0.018798828125,
-0.00047087669372558594,
0.019134521484375,
0.0198974609375,
0.0124969482421875,
-0.00212860107421875,
0.00989532470703125,
-0.0005288124084472656,
0.0474853515625,
0.0034770965576171875,
0.045013427734375,
-0.0286102294921875,
-0.011444091796875,
0.0019321441650390625,
-0.057952880859375,
0.0003509521484375,
-0.0208587646484375,
-0.029571533203125,
-0.041168212890625,
0.04071044921875,
0.049102783203125,
-0.02557373046875,
0.032470703125
] |
f81d5fed640c85b392da99d88045b1e85e64de88
|
Wordpress Stackexchange
Q: How reduce wordpress login session timeout time? I want to logout user autometically when user is idle for more than 10 minutes.That mean suppose user is logged in to a site and user didn't browse any pages for more than 10 mins.when he browse any page after 10mins, it will logout user and redirect to login page.Any Solution?
Advance Thanks.
A: You just need to add your filter hook like this:
function myplugin_cookie_expiration( $expiration, $user_id, $remember ) {
return $remember ? $expiration : 600;
}
add_filter( 'auth_cookie_expiration', 'myplugin_cookie_expiration', 99, 3 );
You can add it to your theme’s functions.php file.
|
Q: How reduce wordpress login session timeout time? I want to logout user autometically when user is idle for more than 10 minutes.That mean suppose user is logged in to a site and user didn't browse any pages for more than 10 mins.when he browse any page after 10mins, it will logout user and redirect to login page.Any Solution?
Advance Thanks.
A: You just need to add your filter hook like this:
function myplugin_cookie_expiration( $expiration, $user_id, $remember ) {
return $remember ? $expiration : 600;
}
add_filter( 'auth_cookie_expiration', 'myplugin_cookie_expiration', 99, 3 );
You can add it to your theme’s functions.php file.
|
wordpress
|
{
"language": "en",
"length": 101,
"provenance": "stackexchange_00019.jsonl.gz:419887",
"question_score": "12",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51874"
}
|
[
0.07275390625,
0.0162200927734375,
0.0142974853515625,
-0.0014505386352539062,
0.017181396484375,
-0.044830322265625,
0.06451416015625,
-0.03753662109375,
-0.026092529296875,
0.01126861572265625,
-0.0148162841796875,
0.0108642578125,
-0.049102783203125,
-0.02099609375,
0.0027561187744140625,
-0.043609619140625,
-0.00469207763671875,
0.014617919921875,
-0.01259613037109375,
-0.0195465087890625,
0.007686614990234375,
-0.03363037109375,
-0.0184326171875,
-0.0182342529296875,
-0.005336761474609375,
0.01094818115234375,
0.1085205078125,
-0.022186279296875,
0.0157318115234375,
-0.0089874267578125,
0.0181427001953125,
-0.044403076171875,
0.0103759765625,
0.0400390625,
-0.0267181396484375,
0.01174163818359375,
-0.026275634765625,
0.032684326171875,
0.0264434814453125,
-0.01355743408203125,
0.0136871337890625,
-0.0240325927734375,
0.0030956268310546875,
0.0019702911376953125,
-0.023040771484375,
0.0167388916015625,
-0.005504608154296875,
-0.02520751953125,
0.0159759521484375,
0.0090179443359375,
0.03729248046875,
-0.002849578857421875,
0.03570556640625,
-0.0016756057739257812,
-0.0246734619140625,
-0.004596710205078125,
-0.00782012939453125,
0.0171661376953125,
0.037322998046875,
-0.06494140625,
-0.034759521484375,
-0.0258026123046875,
0.037689208984375,
0.0218505859375,
-0.01306915283203125,
-0.004024505615234375,
-0.040435791015625,
0.020233154296875,
0.019927978515625,
-0.007434844970703125,
-0.0015850067138671875,
-0.00902557373046875,
0.0009741783142089844,
0.0533447265625,
-0.051483154296875,
-0.056243896484375,
0.034454345703125,
0.00418853759765625,
0.0176239013671875,
0.0236663818359375,
-0.038543701171875,
-0.003833770751953125,
-0.0355224609375,
-0.03265380859375,
0.015838623046875,
0.004360198974609375,
-0.0220184326171875,
-0.0013418197631835938,
-0.016845703125,
0.007076263427734375,
-0.027252197265625,
-0.004299163818359375,
-0.01556396484375,
0.0242919921875,
-0.0008873939514160156,
-0.0164642333984375,
0.0007538795471191406,
-0.0026302337646484375,
0.01519775390625,
-0.02294921875,
0.0136566162109375,
-0.03936767578125,
-0.01256561279296875,
0.00766754150390625,
-0.020355224609375,
0.0487060546875,
0.01337432861328125,
-0.0119476318359375,
-0.01364898681640625,
0.00943756103515625,
0.0069732666015625,
-0.056640625,
0.004390716552734375,
-0.0288238525390625,
-0.015655517578125,
0.03350830078125,
-0.002410888671875,
-0.00931549072265625,
0.0031566619873046875,
-0.0159759521484375,
-0.0675048828125,
-0.05523681640625,
-0.006175994873046875,
0.0238800048828125,
0.01715087890625,
-0.028533935546875,
-0.01032257080078125,
0.05999755859375,
0.0249481201171875,
0.009002685546875,
-0.041961669921875,
0.0128631591796875,
0.043304443359375,
-0.01068115234375,
-0.0080413818359375,
-0.01611328125,
0.051422119140625,
-0.01485443115234375,
-0.0156707763671875,
0.02960205078125,
-0.015716552734375,
-0.061248779296875,
-0.0178680419921875,
-0.006641387939453125,
0.032073974609375,
0.0109710693359375,
0.016448974609375,
0.013763427734375,
0.01282501220703125,
-0.039398193359375,
0.034576416015625,
-0.0174407958984375,
0.0228118896484375,
-0.01073455810546875,
-0.0189971923828125,
-0.0190277099609375,
-0.003448486328125,
-0.0189971923828125,
-0.005924224853515625,
-0.0180816650390625,
-0.0296478271484375,
-0.00656890869140625,
0.0196075439453125,
-0.0433349609375,
-0.047760009765625,
0.0009365081787109375,
-0.0015993118286132812,
-0.0021381378173828125,
0.042877197265625,
0.02325439453125,
0.0227813720703125,
-0.0128326416015625,
0.02978515625,
0.0193023681640625,
0.0006618499755859375,
0.0190582275390625,
-0.0673828125,
0.054412841796875,
0.049713134765625,
-0.0577392578125,
-0.0087890625,
-0.037506103515625,
0.07757568359375,
0.013427734375,
0.0004837512969970703,
0.00843048095703125,
0.00302886962890625,
0.00168609619140625,
-0.0160980224609375,
0.01171875,
-0.032012939453125,
0.05157470703125,
-0.028228759765625,
0.034271240234375,
-0.0207061767578125,
-0.0301513671875,
0.02362060546875,
0.008636474609375,
-0.0101165771484375,
-0.01047515869140625,
0.060394287109375,
-0.0037174224853515625,
-0.0289459228515625,
-0.03759765625,
-0.08807373046875,
-0.037841796875,
-0.00714111328125,
0.014495849609375,
0.01486968994140625,
0.0404052734375,
0.00016069412231445312,
0.018768310546875,
-0.004192352294921875,
-0.05560302734375,
-0.023834228515625,
-0.01508331298828125,
-0.0225677490234375,
0.061309814453125,
-0.0028171539306640625,
0.056060791015625,
0.0120849609375,
-0.044769287109375,
0.0168609619140625,
-0.01490020751953125,
0.0293121337890625,
-0.004718780517578125,
0.0035610198974609375,
-0.01151275634765625,
0.0280914306640625,
0.0124664306640625,
-0.018218994140625,
0.01275634765625,
0.00859832763671875,
0.03558349609375,
-0.0299224853515625,
-0.00823974609375,
-0.01136016845703125,
-0.0187225341796875,
-0.0118408203125,
0.038055419921875,
0.0633544921875,
0.00868988037109375,
-0.0030002593994140625,
-0.0247802734375,
0.019744873046875,
-0.1031494140625,
-0.004734039306640625,
-0.01190185546875,
-0.00244140625,
0.0024242401123046875,
-0.00540924072265625,
-0.01141357421875,
0.04730224609375,
-0.04608154296875,
-0.0031833648681640625,
0.060638427734375,
-0.0141143798828125,
-0.00788116455078125,
0.004878997802734375,
-0.001220703125,
-0.0017499923706054688,
-0.0836181640625,
-0.024505615234375,
-0.045440673828125,
-0.0079193115234375,
-0.016815185546875,
-0.005290985107421875,
-0.020416259765625,
-0.0213775634765625,
-0.008148193359375,
0.03521728515625,
-0.026275634765625,
0.0040435791015625,
0.01253509521484375,
-0.00881195068359375,
-0.046600341796875,
0.01194000244140625,
-0.006702423095703125,
-0.01678466796875,
-0.0214080810546875,
-0.0218963623046875,
0.020263671875,
0.03143310546875,
-0.0167694091796875,
-0.016265869140625,
-0.00981903076171875,
0.021026611328125,
-0.035400390625,
0.0057525634765625,
-0.0021076202392578125,
0.03704833984375,
-0.0151824951171875,
-0.042510986328125,
0.0297393798828125,
0.002971649169921875,
-0.0445556640625,
0.01678466796875,
-0.052520751953125,
0.04779052734375,
-0.040679931640625,
0.06414794921875,
0.06024169921875,
-0.00769805908203125,
0.01666259765625,
-0.007015228271484375,
0.00933074951171875,
-0.01399993896484375,
-0.016815185546875,
-0.02606201171875,
-0.0273284912109375,
0.0009069442749023438,
0.03851318359375,
0.0015506744384765625,
0.067138671875,
-0.074462890625,
-0.07244873046875,
-0.040924072265625,
-0.014892578125,
-0.051239013671875,
-0.036376953125,
-0.0340576171875,
-0.07769775390625,
0.02044677734375,
-0.0236968994140625,
-0.022247314453125,
-0.013641357421875,
0.011260986328125,
0.0246124267578125,
0.0195159912109375,
-0.0158233642578125,
-0.0328369140625,
-0.01184844970703125,
-0.03643798828125,
-0.0076751708984375,
-0.01122283935546875,
-0.0236663818359375,
-0.0014476776123046875,
0.036224365234375,
-0.0223846435546875,
-0.059234619140625,
-0.04681396484375,
-0.0013723373413085938,
-0.00870513916015625,
-0.0238037109375,
-0.010040283203125,
0.023345947265625,
-0.0032672882080078125,
0.0211639404296875,
-0.0275421142578125,
-0.025421142578125,
0.0091705322265625,
-0.045806884765625,
0.0093536376953125,
-0.026397705078125,
0.00971221923828125,
-0.0208587646484375,
-0.031585693359375,
0.0229949951171875,
0.002590179443359375,
-0.02783203125,
0.007579803466796875,
-0.0168914794921875,
-0.028961181640625,
-0.0225372314453125,
0.0086517333984375,
-0.0088653564453125,
-0.0238494873046875,
-0.01146697998046875,
-0.032257080078125,
-0.0335693359375,
-0.0183868408203125,
-0.04522705078125,
0.058990478515625,
0.001811981201171875,
-0.010589599609375,
0.0179290771484375,
0.0633544921875,
-0.0083160400390625,
0.01316070556640625,
0.029388427734375,
0.0102081298828125,
-0.0078125,
-0.024383544921875,
-0.06329345703125,
-0.0357666015625,
0.04022216796875,
-0.00759124755859375,
0.00021576881408691406,
-0.01258087158203125,
-0.02154541015625,
-0.003475189208984375,
0.09246826171875,
-0.03399658203125,
-0.0037059783935546875,
0.01629638671875,
0.01224517822265625,
-0.040313720703125,
-0.0003063678741455078,
-0.088623046875,
-0.004390716552734375,
-0.10052490234375,
0.0175933837890625,
0.014404296875,
-0.032806396484375,
0.01049041748046875,
-0.038299560546875,
-0.030853271484375,
-0.039825439453125,
-0.005130767822265625,
0.04656982421875,
0.026275634765625,
-0.047637939453125,
0.01678466796875,
-0.0267333984375,
0.055908203125,
-0.039764404296875,
-0.0255584716796875,
0.00006330013275146484,
-0.08154296875,
0.041351318359375,
0.06866455078125,
-0.0347900390625,
0.031097412109375,
0.0255126953125,
-0.007747650146484375,
0.0628662109375,
-0.0010213851928710938,
0.00766754150390625,
0.032501220703125,
0.0305938720703125,
0.0254974365234375,
0.00936126708984375,
-0.0033702850341796875,
-0.027618408203125,
-0.0310211181640625,
0.001995086669921875,
-0.013397216796875,
0.0260467529296875,
0.0194854736328125,
-0.0215301513671875,
-0.044189453125,
-0.048187255859375,
-0.0164337158203125,
0.01323699951171875,
0.00463104248046875,
-0.006351470947265625,
-0.071044921875,
-0.050537109375,
0.062408447265625,
0.05084228515625,
-0.00519561767578125,
-0.0117950439453125,
0.057342529296875,
0.0087127685546875,
-0.048065185546875,
0.007122039794921875,
0.0034999847412109375,
0.00809478759765625,
-0.0081787109375,
0.034332275390625,
-0.026611328125,
-0.0132904052734375,
0.070556640625,
-0.0347900390625,
0.0217132568359375,
-0.06573486328125,
0.04913330078125,
-0.0386962890625,
-0.02459716796875,
0.0307769775390625,
-0.064697265625,
0.042144775390625,
-0.0016260147094726562,
0.0114898681640625,
0.0043487548828125,
0.023956298828125,
0.004039764404296875,
0.0008425712585449219,
-0.00656890869140625,
-0.00928497314453125,
-0.031341552734375,
0.01157379150390625,
-0.0211639404296875,
-0.0010929107666015625,
0.0269775390625,
-0.00008392333984375,
0.000057816505432128906,
0.009002685546875,
-0.0036678314208984375,
-0.0369873046875,
-0.0158538818359375,
-0.040496826171875,
-0.004550933837890625,
0.00354766845703125,
-0.026763916015625,
-0.0187530517578125,
-0.01751708984375,
0.07672119140625,
0.0261993408203125,
-0.044097900390625,
-0.0128021240234375,
-0.00507354736328125,
0.029876708984375,
0.00740814208984375,
-0.0193328857421875,
0.0203094482421875,
-0.006622314453125,
-0.016357421875,
0.01158905029296875,
-0.0118865966796875,
-0.0232391357421875,
-0.03485107421875,
-0.006877899169921875,
-0.036407470703125,
-0.006862640380859375,
0.0085906982421875,
0.036651611328125,
-0.01552581787109375,
0.0289764404296875,
-0.005863189697265625,
0.028656005859375,
0.040435791015625,
0.02862548828125,
0.01085662841796875,
0.01067352294921875,
-0.04925537109375,
0.047393798828125,
-0.00923919677734375,
-0.0170745849609375,
-0.0165863037109375,
0.01010894775390625,
0.00746917724609375,
-0.0294342041015625,
0.0150909423828125,
0.0191802978515625,
-0.005443572998046875,
-0.019378662109375,
0.02899169921875,
-0.00597381591796875,
-0.056304931640625,
-0.0159454345703125,
0.0298614501953125,
0.01110076904296875,
-0.0184478759765625,
-0.006282806396484375,
-0.0268707275390625,
-0.03497314453125,
-0.0230560302734375,
0.0312042236328125,
-0.0285186767578125,
-0.01385498046875,
-0.018798828125,
-0.0175323486328125,
-0.0246734619140625,
-0.0318603515625,
-0.01335906982421875,
-0.033905029296875,
0.023712158203125,
0.002574920654296875,
-0.0231170654296875,
-0.005748748779296875,
0.027862548828125,
-0.026123046875,
-0.00429534912109375,
0.0188446044921875,
0.0260467529296875,
0.008270263671875,
-0.016387939453125,
-0.035064697265625,
0.003963470458984375,
-0.05419921875,
-0.0220184326171875,
-0.052520751953125,
-0.038543701171875,
-0.0489501953125,
-0.00634765625,
0.006534576416015625,
0.0203704833984375,
-0.004589080810546875,
0.0008463859558105469,
-0.04705810546875,
0.00787353515625,
0.029327392578125,
0.048309326171875,
-0.00949859619140625,
-0.01018524169921875,
0.010009765625,
0.01033782958984375,
0.0075531005859375,
-0.0124969482421875,
0.0120849609375,
-0.020660400390625,
0.033721923828125,
0.0609130859375,
-0.05255126953125,
-0.0209503173828125,
-0.036895751953125,
-0.027008056640625,
0.09912109375,
-0.038909912109375,
-0.0182952880859375,
0.00978851318359375,
0.01342010498046875,
-0.01509857177734375,
0.004058837890625,
0.05810546875,
0.02264404296875,
-0.018280029296875,
-0.00821685791015625,
0.033660888671875,
0.0257568359375,
0.006435394287109375,
0.0171966552734375,
-0.018585205078125,
0.04327392578125,
-0.027618408203125,
-0.0016336441040039062,
0.0171966552734375,
0.027496337890625,
-0.006565093994140625,
0.01192474365234375,
0.0306854248046875,
0.01134490966796875,
0.0013074874877929688,
0.026397705078125,
-0.0156402587890625,
-0.048736572265625,
0.051544189453125,
0.0104827880859375,
-0.05401611328125,
0.0212249755859375,
-0.0391845703125,
0.002658843994140625,
0.07781982421875,
0.060394287109375,
-0.11102294921875,
0.01200103759765625,
0.0013570785522460938,
-0.00045228004455566406,
0.027587890625,
-0.014404296875,
-0.002170562744140625,
-0.006744384765625,
0.0546875,
-0.01221466064453125,
-0.0241851806640625,
0.017059326171875,
-0.0164031982421875,
-0.007110595703125,
-0.0038967132568359375,
0.0257110595703125,
0.009368896484375,
-0.08050537109375,
0.041229248046875,
0.0592041015625,
0.0005025863647460938,
0.002044677734375,
-0.014984130859375,
0.034423828125,
-0.03302001953125,
-0.055908203125,
0.016876220703125,
-0.0438232421875,
-0.007656097412109375,
0.026336669921875,
-0.00583648681640625,
0.0489501953125,
0.039398193359375,
-0.0126495361328125,
0.0101165771484375,
-0.0115966796875,
0.0310821533203125,
0.01264190673828125,
-0.024169921875,
-0.0051116943359375,
0.007244110107421875,
-0.03155517578125,
0.00511932373046875,
-0.023529052734375,
-0.00594329833984375,
-0.0135650634765625,
-0.042083740234375,
0.043060302734375,
-0.023956298828125,
0.00981903076171875,
0.050933837890625,
0.0012235641479492188,
-0.019287109375,
-0.00922393798828125,
0.00913238525390625,
-0.05950927734375,
-0.033843994140625,
0.0040283203125,
-0.017181396484375,
0.0153350830078125,
0.01319122314453125,
-0.067138671875,
0.07916259765625,
0.01025390625,
0.016143798828125,
-0.026275634765625,
0.0394287109375,
0.0096893310546875,
0.029693603515625,
-0.0206146240234375,
0.05682373046875,
-0.033599853515625,
0.0264434814453125,
-0.00530242919921875,
0.0168609619140625,
0.01015472412109375,
-0.02056884765625,
0.023040771484375,
0.0145263671875,
-0.069091796875,
-0.042510986328125,
-0.046142578125,
0.0146942138671875,
0.00350189208984375,
0.059906005859375,
-0.016021728515625,
0.0540771484375,
0.04302978515625,
-0.06048583984375,
0.02081298828125,
0.0135955810546875,
-0.038970947265625,
0.0124359130859375,
-0.0288238525390625,
-0.07952880859375,
-0.004878997802734375,
0.036163330078125,
-0.0531005859375,
0.002521514892578125,
-0.0009098052978515625,
0.0293426513671875,
0.0355224609375,
0.007312774658203125,
0.03253173828125,
-0.03338623046875,
-0.026153564453125,
-0.01213836669921875,
0.0458984375,
-0.0006480216979980469,
0.003978729248046875,
0.04327392578125,
0.0219268798828125,
0.00592803955078125,
-0.02105712890625,
-0.006259918212890625,
-0.0113983154296875,
-0.01102447509765625,
0.024444580078125,
0.0247802734375,
0.04998779296875,
-0.0034351348876953125,
-0.0147857666015625,
-0.005435943603515625,
0.0352783203125,
-0.010040283203125,
-0.0261077880859375,
-0.0020503997802734375,
0.0053253173828125,
0.04791259765625,
0.023223876953125,
0.08282470703125,
-0.007083892822265625,
-0.0128021240234375,
0.0233306884765625,
0.031524658203125,
0.037567138671875,
-0.001956939697265625,
0.0193634033203125,
0.0750732421875,
-0.09075927734375,
0.060546875,
0.01416015625,
-0.01416015625,
-0.0194091796875,
-0.01145172119140625,
0.01329803466796875,
-0.01023101806640625,
0.002445220947265625,
0.0189208984375,
-0.00858306884765625,
0.0177764892578125,
0.0115814208984375,
-0.00763702392578125,
0.0157470703125,
-0.0035800933837890625,
-0.011077880859375,
0.0106658935546875,
-0.0175628662109375,
-0.039337158203125,
0.027374267578125,
0.04156494140625,
-0.062225341796875,
-0.043426513671875,
0.0208282470703125,
-0.02227783203125,
0.02642822265625,
0.0030002593994140625,
0.0254058837890625,
0.019500732421875,
-0.00571441650390625,
-0.04705810546875,
0.055572509765625,
0.01849365234375,
-0.029205322265625,
0.044769287109375,
0.00083160400390625,
-0.01316070556640625,
-0.032012939453125,
-0.0143585205078125,
0.01293182373046875,
0.007904052734375,
-0.0276947021484375,
0.01055908203125,
-0.022125244140625,
-0.0204010009765625,
-0.0013608932495117188,
0.0183258056640625,
-0.02545166015625,
0.037994384765625,
0.0222015380859375,
0.02374267578125,
-0.035797119140625,
-0.01461029052734375,
0.03265380859375,
-0.03253173828125,
0.009307861328125,
0.022430419921875,
-0.09161376953125,
-0.04669189453125,
-0.052886962890625,
0.031646728515625,
0.005199432373046875,
0.08154296875,
0.00220489501953125,
0.0205078125,
-0.0300750732421875,
-0.056976318359375,
0.0165557861328125,
-0.0225982666015625,
-0.00240325927734375,
-0.00614166259765625,
-0.0293731689453125,
0.0011281967163085938,
-0.0728759765625,
0.046295166015625,
-0.00519561767578125,
0.0131378173828125,
0.053375244140625,
-0.020843505859375,
0.0009012222290039062,
0.01155853271484375,
-0.03228759765625,
-0.0235748291015625,
-0.0025539398193359375,
0.0247955322265625,
0.001888275146484375,
0.005084991455078125,
-0.0045928955078125,
-0.004840850830078125,
0.0478515625,
-0.0280914306640625,
0.0125885009765625,
-0.02545166015625,
-0.013031005859375,
-0.05926513671875,
0.01482391357421875,
-0.01385498046875,
-0.01297760009765625,
-0.0364990234375,
-0.01873779296875,
-0.01424407958984375,
0.01171875,
-0.0054931640625,
-0.004528045654296875,
0.044189453125,
0.048095703125,
0.04266357421875,
0.04150390625,
-0.024810791015625,
0.010650634765625,
0.0311431884765625,
0.011077880859375,
0.0160369873046875,
-0.034912109375,
-0.0572509765625,
-0.06182861328125,
0.0285491943359375,
0.024200439453125,
-0.028717041015625,
-0.059234619140625,
-0.0780029296875,
-0.00836181640625,
0.012176513671875,
0.01751708984375,
-0.049591064453125,
0.0260772705078125,
0.00699615478515625,
0.01245880126953125,
0.0052337646484375,
-0.0302734375,
0.0039005279541015625,
0.0136566162109375,
-0.018341064453125,
-0.051177978515625,
-0.03082275390625,
0.047119140625,
-0.045928955078125,
-0.052276611328125,
-0.001556396484375,
0.0311431884765625,
-0.040557861328125,
-0.07342529296875,
-0.052154541015625,
-0.023712158203125,
-0.04388427734375,
-0.02117919921875,
0.03704833984375,
0.02447509765625,
-0.005340576171875,
-0.03985595703125,
-0.031982421875,
0.047210693359375,
0.04071044921875,
0.0184478759765625,
-0.0046234130859375,
0.009857177734375,
-0.007091522216796875,
0.0143890380859375,
0.043060302734375,
0.0203399658203125,
-0.01024627685546875,
-0.05450439453125,
0.04705810546875,
0.00418853759765625,
-0.05059814453125,
-0.0178680419921875,
-0.01025390625,
0.01045989990234375,
0.0220947265625,
0.0117950439453125,
-0.0161895751953125,
0.018402099609375,
0.0246734619140625,
-0.03271484375,
0.035614013671875,
0.033843994140625,
-0.017425537109375,
-0.01041412353515625,
0.03717041015625,
0.012359619140625,
0.07025146484375,
0.006008148193359375,
0.056121826171875,
-0.0003402233123779297,
-0.054290771484375,
-0.0198822021484375,
0.01207733154296875,
-0.00872039794921875,
-0.00615692138671875,
0.053497314453125,
0.041259765625,
0.0165557861328125,
-0.0296783447265625,
-0.049041748046875,
-0.01474761962890625,
0.043182373046875,
-0.0152130126953125,
0.0017805099487304688,
-0.06317138671875,
-0.0184478759765625,
-0.0175018310546875,
-0.0008006095886230469,
-0.0118255615234375,
0.0183868408203125,
-0.00891876220703125,
-0.01251983642578125,
0.0413818359375,
0.0037555694580078125,
-0.028076171875,
0.02166748046875,
-0.00335693359375,
-0.02386474609375,
-0.032257080078125,
-0.0020580291748046875,
-0.0034351348876953125,
-0.034027099609375,
-0.01317596435546875,
0.045562744140625,
0.04290771484375,
-0.07489013671875,
-0.01039886474609375,
0.01523590087890625,
0.0003604888916015625,
-0.04937744140625,
-0.040924072265625,
0.00738525390625,
-0.0020999908447265625,
0.0006680488586425781,
-0.006786346435546875,
0.003726959228515625,
-0.011383056640625,
-0.01678466796875,
0.04425048828125,
-0.01202392578125,
0.007541656494140625,
-0.03912353515625,
0.0509033203125,
0.0084075927734375,
-0.022735595703125,
0.04638671875,
-0.0259552001953125,
0.0087127685546875,
-0.0106658935546875,
0.0292816162109375,
-0.0587158203125,
0.05908203125,
-0.027984619140625,
0.01302337646484375,
0.041168212890625
] |
c7f8410a3e6c63f452fef3fd187f66dcec6d5023
|
Wordpress Stackexchange
Q: Add comments from the admin panel? I'm using WordPress as an Authoring tool. Hence I do not use the front end.
Now I wanna add the functionality making internal comments. As it is now, you are only allowed to read comments from the Edit Post page, not to write them.
Got any hints or good ideas on how to make this possible?
A: This will be possible in the upcoming version WordPress 3.4. Try the Beta or just wait.
Here is a screen shot (incomplete translation to German):
|
Q: Add comments from the admin panel? I'm using WordPress as an Authoring tool. Hence I do not use the front end.
Now I wanna add the functionality making internal comments. As it is now, you are only allowed to read comments from the Edit Post page, not to write them.
Got any hints or good ideas on how to make this possible?
A: This will be possible in the upcoming version WordPress 3.4. Try the Beta or just wait.
Here is a screen shot (incomplete translation to German):
A: I use the plugin Peter's Post Notes for something similar on one of my sites.
A: If you want to leave comments on the actual post content, here is the solution I came up with a few weeks ago.
It is very similar to what toscho has posted, but works on the current stable WordPress release.
The code is set up for editor and admin capabilities, but can work for any role with a slight tweak of current_user_can
How can I allow editors to leave comments on posts that have not yet been published?
|
wordpress
|
{
"language": "en",
"length": 184,
"provenance": "stackexchange_00019.jsonl.gz:419889",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51881"
}
|
[
0.031585693359375,
-0.0291900634765625,
-0.0166168212890625,
-0.029541015625,
-0.0151519775390625,
-0.034454345703125,
0.0159912109375,
-0.00199127197265625,
0.01800537109375,
0.01149749755859375,
-0.07281494140625,
-0.0036449432373046875,
-0.0181732177734375,
0.0072174072265625,
-0.0298614501953125,
-0.048980712890625,
0.038818359375,
0.0014848709106445312,
0.0303955078125,
-0.004848480224609375,
-0.002834320068359375,
0.01427459716796875,
0.01320648193359375,
0.0160369873046875,
0.002254486083984375,
0.01526641845703125,
0.06329345703125,
-0.0157470703125,
0.024322509765625,
0.01042938232421875,
0.020233154296875,
-0.04962158203125,
-0.0011653900146484375,
0.0192413330078125,
0.0017576217651367188,
-0.0357666015625,
-0.003284454345703125,
0.014892578125,
0.039459228515625,
-0.00848388671875,
0.01168060302734375,
0.005985260009765625,
0.00804901123046875,
0.023895263671875,
-0.0209503173828125,
-0.026336669921875,
0.01442718505859375,
-0.0460205078125,
0.03857421875,
-0.0137786865234375,
-0.0148162841796875,
0.055755615234375,
0.0002913475036621094,
-0.025634765625,
0.0020542144775390625,
0.0081024169921875,
-0.0086822509765625,
-0.0025882720947265625,
0.03533935546875,
-0.0197296142578125,
-0.028900146484375,
-0.031585693359375,
0.0299835205078125,
-0.0027332305908203125,
0.0174407958984375,
-0.00579071044921875,
0.046356201171875,
0.00519561767578125,
-0.01149749755859375,
0.004150390625,
0.021026611328125,
-0.00885772705078125,
-0.0011835098266601562,
-0.031494140625,
0.00882720947265625,
-0.00963592529296875,
-0.00768280029296875,
-0.0423583984375,
0.01345062255859375,
0.01325225830078125,
0.0199737548828125,
0.01415252685546875,
-0.018829345703125,
-0.0302734375,
0.0213470458984375,
-0.0179443359375,
-0.0014295578002929688,
-0.0185699462890625,
-0.027587890625,
0.010345458984375,
-0.0152435302734375,
-0.0611572265625,
-0.0213165283203125,
0.04852294921875,
0.00926971435546875,
0.003993988037109375,
-0.01387786865234375,
0.0153961181640625,
0.005218505859375,
0.04217529296875,
-0.027099609375,
-0.0201263427734375,
0.036285400390625,
-0.048248291015625,
0.00739288330078125,
-0.001049041748046875,
-0.0408935546875,
-0.0521240234375,
0.027557373046875,
0.051055908203125,
-0.016204833984375,
-0.003452301025390625,
-0.023406982421875,
-0.055389404296875,
0.003940582275390625,
0.053863525390625,
-0.0204010009765625,
0.0217742919921875,
0.0108184814453125,
0.01800537109375,
0.0049591064453125,
0.01104736328125,
-0.0494384765625,
0.0259246826171875,
0.0019521713256835938,
-0.00981903076171875,
-0.01019287109375,
0.0202178955078125,
0.037506103515625,
-0.00905609130859375,
-0.0282135009765625,
0.039520263671875,
0.04547119140625,
-0.0049285888671875,
-0.01445770263671875,
-0.004734039306640625,
0.00966644287109375,
0.0243072509765625,
-0.0214996337890625,
0.01076507568359375,
0.01074981689453125,
-0.01702880859375,
-0.00978851318359375,
-0.00122833251953125,
-0.0161285400390625,
0.024871826171875,
0.0161895751953125,
0.0003371238708496094,
0.003902435302734375,
-0.040283203125,
-0.022003173828125,
-0.01169586181640625,
0.0131988525390625,
-0.004852294921875,
0.01358795166015625,
-0.058197021484375,
0.009002685546875,
-0.045166015625,
0.052459716796875,
-0.02899169921875,
0.0229949951171875,
0.014862060546875,
0.009063720703125,
-0.0107269287109375,
-0.032440185546875,
-0.0149383544921875,
-0.0305023193359375,
-0.0028209686279296875,
0.0254669189453125,
0.01092529296875,
0.006732940673828125,
-0.06158447265625,
0.0213775634765625,
0.002716064453125,
-0.01136016845703125,
0.030242919921875,
-0.00434112548828125,
0.0269317626953125,
-0.005672454833984375,
0.0538330078125,
0.0232696533203125,
-0.043670654296875,
0.01229095458984375,
0.00013005733489990234,
-0.0096893310546875,
-0.00943756103515625,
0.0224609375,
0.0478515625,
0.0187835693359375,
0.0391845703125,
-0.036590576171875,
-0.0174102783203125,
0.02130126953125,
0.005809783935546875,
-0.035308837890625,
-0.0183258056640625,
0.0014486312866210938,
0.03424072265625,
-0.043304443359375,
0.008392333984375,
0.003910064697265625,
0.01244354248046875,
-0.02215576171875,
0.0082855224609375,
-0.044158935546875,
0.0224761962890625,
-0.0196075439453125,
0.035247802734375,
0.05010986328125,
-0.01416015625,
-0.0279083251953125,
-0.040985107421875,
0.020355224609375,
-0.0131378173828125,
-0.06414794921875,
0.03570556640625,
-0.038665771484375,
0.049530029296875,
0.0240936279296875,
0.05145263671875,
0.026397705078125,
-0.05242919921875,
0.007175445556640625,
-0.032470703125,
0.048004150390625,
-0.0234832763671875,
-0.0055084228515625,
-0.0168609619140625,
0.06597900390625,
0.0031337738037109375,
-0.0204010009765625,
-0.0054168701171875,
0.03076171875,
0.02618408203125,
-0.0082244873046875,
0.01015472412109375,
-0.005908966064453125,
-0.07818603515625,
-0.0139617919921875,
0.0498046875,
0.03179931640625,
-0.01593017578125,
0.03192138671875,
0.061981201171875,
0.035980224609375,
-0.01421356201171875,
0.020538330078125,
0.0083160400390625,
0.01439666748046875,
0.045562744140625,
0.000072479248046875,
0.0005893707275390625,
0.0299072265625,
-0.01776123046875,
-0.0220794677734375,
0.0601806640625,
-0.00707244873046875,
-0.003787994384765625,
0.0228424072265625,
-0.01070404052734375,
0.01154327392578125,
-0.03790283203125,
-0.029693603515625,
-0.00725555419921875,
-0.007450103759765625,
-0.0180511474609375,
0.01540374755859375,
0.01235198974609375,
-0.00806427001953125,
-0.032684326171875,
0.0243377685546875,
0.032867431640625,
0.004489898681640625,
0.0231475830078125,
0.0066070556640625,
0.0147705078125,
-0.0226287841796875,
-0.007183074951171875,
0.0087432861328125,
0.01236724853515625,
-0.0102691650390625,
0.03204345703125,
-0.026885986328125,
-0.0208740234375,
0.004913330078125,
-0.01293182373046875,
-0.01108551025390625,
-0.0215301513671875,
-0.016326904296875,
-0.017303466796875,
0.019989013671875,
0.0083770751953125,
-0.012054443359375,
-0.010711669921875,
0.0191802978515625,
-0.031951904296875,
0.0161895751953125,
-0.032623291015625,
0.0169677734375,
-0.005565643310546875,
0.0521240234375,
0.0692138671875,
0.0316162109375,
-0.01331329345703125,
0.00899505615234375,
-0.028411865234375,
0.024505615234375,
0.032928466796875,
0.0157012939453125,
0.0123138427734375,
-0.050140380859375,
0.01323699951171875,
0.01641845703125,
0.006771087646484375,
0.0203399658203125,
-0.015106201171875,
0.002838134765625,
0.034576416015625,
-0.0078582763671875,
0.017333984375,
-0.02801513671875,
-0.049652099609375,
-0.07708740234375,
-0.019256591796875,
-0.045562744140625,
0.05242919921875,
-0.030914306640625,
-0.0079193115234375,
0.0103759765625,
-0.01348876953125,
-0.023223876953125,
-0.027191162109375,
-0.041595458984375,
-0.0234222412109375,
-0.00739288330078125,
-0.00017249584197998047,
0.003101348876953125,
0.06671142578125,
0.004383087158203125,
-0.054412841796875,
0.0169677734375,
-0.0262908935546875,
-0.0017862319946289062,
0.03790283203125,
0.00905609130859375,
-0.040924072265625,
0.01031494140625,
0.0037326812744140625,
-0.018310546875,
0.01248931884765625,
-0.0027256011962890625,
-0.01181793212890625,
-0.0267181396484375,
0.0224456787109375,
0.0008730888366699219,
0.01230621337890625,
0.037261962890625,
0.034027099609375,
0.0208740234375,
-0.00983428955078125,
-0.00223541259765625,
0.0433349609375,
-0.002216339111328125,
-0.0599365234375,
-0.0255584716796875,
-0.032562255859375,
0.01654052734375,
0.001155853271484375,
0.04180908203125,
0.0364990234375,
0.00992584228515625,
0.017486572265625,
-0.00876617431640625,
-0.0102996826171875,
0.00438690185546875,
-0.047088623046875,
0.01473236083984375,
-0.006328582763671875,
0.033416748046875,
0.008819580078125,
0.03839111328125,
-0.00919342041015625,
0.047149658203125,
-0.047454833984375,
-0.0221405029296875,
0.039031982421875,
-0.02716064453125,
0.007617950439453125,
-0.019439697265625,
-0.0174560546875,
0.0018758773803710938,
0.0723876953125,
-0.033477783203125,
0.0010280609130859375,
0.00589752197265625,
0.0084686279296875,
-0.036163330078125,
-0.0156402587890625,
-0.06695556640625,
0.0013971328735351562,
0.0136260986328125,
0.0205535888671875,
-0.0131378173828125,
0.0208587646484375,
-0.052642822265625,
0.0943603515625,
-0.004467010498046875,
-0.01412200927734375,
0.03057861328125,
-0.03680419921875,
0.0030040740966796875,
-0.01212310791015625,
-0.028411865234375,
-0.0009593963623046875,
-0.00787353515625,
-0.04010009765625,
-0.10107421875,
-0.0242919921875,
-0.0127410888671875,
0.075439453125,
-0.01052093505859375,
-0.0047760009765625,
-0.012054443359375,
0.056121826171875,
0.00490570068359375,
-0.01190948486328125,
-0.00861358642578125,
0.0193328857421875,
-0.056243896484375,
-0.030242919921875,
-0.024932861328125,
-0.04168701171875,
-0.021209716796875,
-0.0255126953125,
-0.0091552734375,
0.03643798828125,
-0.017730712890625,
0.005126953125,
-0.007030487060546875,
0.0033588409423828125,
-0.015838623046875,
-0.0301513671875,
-0.0282745361328125,
0.038543701171875,
-0.033416748046875,
0.0159912109375,
-0.039581298828125,
-0.035186767578125,
-0.006229400634765625,
-0.0083160400390625,
-0.00762176513671875,
0.008392333984375,
0.03363037109375,
0.0181121826171875,
-0.0007710456848144531,
-0.0286865234375,
-0.040313720703125,
0.033203125,
-0.016632080078125,
0.046630859375,
0.0248565673828125,
-0.01561737060546875,
0.06414794921875,
-0.0006170272827148438,
0.003902435302734375,
-0.0301361083984375,
0.0423583984375,
0.0009050369262695312,
-0.01346588134765625,
0.0196990966796875,
-0.0137176513671875,
0.03802490234375,
-0.01432037353515625,
-0.02783203125,
0.0088043212890625,
-0.04290771484375,
0.038909912109375,
0.00794219970703125,
0.023284912109375,
-0.043304443359375,
-0.0419921875,
0.01233673095703125,
-0.080322265625,
0.031036376953125,
0.0161895751953125,
0.003055572509765625,
0.025970458984375,
0.0165863037109375,
-0.023529052734375,
0.0249786376953125,
0.01390838623046875,
-0.010040283203125,
0.0119171142578125,
-0.004749298095703125,
-0.035369873046875,
0.00774383544921875,
-0.0254364013671875,
0.08270263671875,
-0.00457000732421875,
-0.061065673828125,
-0.004974365234375,
-0.0106048583984375,
0.0219573974609375,
0.029052734375,
0.0093536376953125,
-0.00856781005859375,
-0.040802001953125,
0.00795745849609375,
0.0142822265625,
-0.0189666748046875,
-0.0113067626953125,
-0.00970458984375,
-0.0110015869140625,
-0.00379180908203125,
-0.0128021240234375,
0.0565185546875,
0.00728607177734375,
-0.01446533203125,
0.03582763671875,
-0.0188140869140625,
0.0216064453125,
0.0048065185546875,
-0.000957489013671875,
0.0298309326171875,
0.00626373291015625,
0.03369140625,
-0.050140380859375,
0.004779815673828125,
0.0162200927734375,
-0.0195465087890625,
0.013702392578125,
0.0117645263671875,
0.035919189453125,
0.04437255859375,
-0.0272979736328125,
-0.0178680419921875,
-0.0109405517578125,
0.036163330078125,
0.050628662109375,
-0.04193115234375,
0.004730224609375,
0.012359619140625,
-0.006809234619140625,
-0.00926971435546875,
-0.01251983642578125,
0.035552978515625,
-0.0260772705078125,
0.01235198974609375,
0.020111083984375,
-0.0157318115234375,
-0.002971649169921875,
-0.0081939697265625,
-0.0284576416015625,
-0.0242462158203125,
0.00835418701171875,
-0.077880859375,
-0.03271484375,
-0.006244659423828125,
-0.0057830810546875,
0.036376953125,
0.058380126953125,
-0.0184326171875,
-0.042144775390625,
0.001399993896484375,
0.01079559326171875,
-0.035919189453125,
0.052581787109375,
-0.0280914306640625,
-0.0093231201171875,
-0.04595947265625,
-0.0693359375,
-0.04193115234375,
-0.06402587890625,
-0.050048828125,
-0.0118560791015625,
0.03265380859375,
0.0190582275390625,
0.03240966796875,
-0.00458526611328125,
-0.049713134765625,
-0.03076171875,
-0.0019397735595703125,
0.045166015625,
0.045257568359375,
-0.005535125732421875,
0.069580078125,
0.00872039794921875,
0.06439208984375,
0.0220794677734375,
0.05743408203125,
-0.0263671875,
-0.0260162353515625,
0.0196533203125,
-0.01049041748046875,
-0.0268707275390625,
-0.0181884765625,
-0.018890380859375,
0.00396728515625,
0.040863037109375,
-0.0170135498046875,
0.0004222393035888672,
-0.0257720947265625,
0.00923919677734375,
-0.033843994140625,
0.031005859375,
-0.0160675048828125,
-0.005954742431640625,
-0.00751495361328125,
0.0006089210510253906,
0.0154266357421875,
-0.014312744140625,
-0.0296783447265625,
0.00384521484375,
0.034912109375,
-0.01091766357421875,
0.00787353515625,
-0.06390380859375,
0.06610107421875,
0.07562255859375,
-0.006641387939453125,
0.04400634765625,
0.0127105712890625,
0.0071868896484375,
0.021392822265625,
0.028289794921875,
-0.018035888671875,
-0.048004150390625,
0.02398681640625,
0.01396942138671875,
-0.0268096923828125,
0.0179901123046875,
-0.0198822021484375,
0.03997802734375,
0.07196044921875,
0.08612060546875,
-0.1258544921875,
0.034820556640625,
-0.00489044189453125,
-0.007450103759765625,
0.07818603515625,
-0.0230255126953125,
-0.005756378173828125,
-0.055084228515625,
0.08917236328125,
-0.006359100341796875,
-0.0045013427734375,
0.019989013671875,
-0.0280914306640625,
-0.00849151611328125,
0.0031681060791015625,
0.0438232421875,
-0.0021381378173828125,
-0.0281982421875,
-0.0138397216796875,
0.02197265625,
-0.0215606689453125,
-0.04644775390625,
-0.004703521728515625,
0.0152587890625,
-0.002193450927734375,
-0.054473876953125,
0.0328369140625,
-0.04241943359375,
0.0301666259765625,
0.059112548828125,
-0.002048492431640625,
-0.005924224853515625,
0.052337646484375,
-0.033050537109375,
0.053466796875,
-0.00289154052734375,
-0.01154327392578125,
-0.047332763671875,
-0.060516357421875,
0.0189361572265625,
-0.01049041748046875,
-0.030731201171875,
0.02471923828125,
-0.0116729736328125,
-0.0684814453125,
0.029052734375,
0.04034423828125,
-0.0122528076171875,
-0.01666259765625,
-0.018310546875,
0.046783447265625,
-0.0421142578125,
0.0030498504638671875,
0.01003265380859375,
-0.053466796875,
0.0037097930908203125,
0.023223876953125,
-0.0256195068359375,
-0.039947509765625,
0.0361328125,
-0.0008740425109863281,
-0.05706787109375,
0.09918212890625,
-0.01403045654296875,
-0.002483367919921875,
-0.005859375,
0.045013427734375,
-0.033843994140625,
0.0228118896484375,
-0.008026123046875,
0.0657958984375,
-0.0248870849609375,
0.033172607421875,
-0.08880615234375,
-0.034393310546875,
0.0096893310546875,
0.0860595703125,
0.0509033203125,
0.01534271240234375,
-0.00762939453125,
-0.00933074951171875,
0.043914794921875,
0.0313720703125,
0.00757598876953125,
0.00809478759765625,
0.02471923828125,
-0.0123138427734375,
0.0716552734375,
0.0031414031982421875,
0.04705810546875,
-0.0190582275390625,
0.021453857421875,
0.0303955078125,
0.002811431884765625,
0.007167816162109375,
0.0184783935546875,
0.01194000244140625,
-0.0107574462890625,
0.005954742431640625,
0.01477813720703125,
-0.06072998046875,
-0.045501708984375,
0.0489501953125,
0.004306793212890625,
-0.0269317626953125,
-0.022125244140625,
-0.03680419921875,
0.02557373046875,
0.01357269287109375,
0.0268707275390625,
0.022705078125,
0.03228759765625,
0.0117034912109375,
-0.0243988037109375,
0.0058746337890625,
0.028045654296875,
-0.03350830078125,
0.0081787109375,
0.0244598388671875,
0.039031982421875,
0.0013151168823242188,
0.0031566619873046875,
-0.0011501312255859375,
0.017120361328125,
-0.01428985595703125,
0.00049591064453125,
0.0086517333984375,
-0.0041046142578125,
0.018402099609375,
-0.0200958251953125,
0.03704833984375,
0.0321044921875,
0.0179443359375,
0.00012314319610595703,
-0.0209503173828125,
-0.00745391845703125,
0.021514892578125,
0.009796142578125,
0.01290130615234375,
0.017608642578125,
-0.0269775390625,
-0.006031036376953125,
-0.006816864013671875,
0.00885009765625,
-0.006084442138671875,
-0.005588531494140625,
0.034515380859375,
0.0011157989501953125,
0.0174713134765625,
0.0251617431640625,
-0.014801025390625,
-0.0185546875,
-0.03985595703125,
-0.0230865478515625,
-0.0631103515625,
0.01312255859375,
0.03729248046875,
0.00913238525390625,
0.049713134765625,
0.0186004638671875,
-0.0089874267578125,
-0.030975341796875,
0.01064300537109375,
0.0213165283203125,
-0.046234130859375,
0.0002199411392211914,
-0.0450439453125,
0.045501708984375,
0.0443115234375,
0.01464080810546875,
0.0013513565063476562,
0.016876220703125,
0.06158447265625,
0.0091552734375,
-0.04339599609375,
0.0240325927734375,
-0.031982421875,
0.0572509765625,
0.009674072265625,
-0.003498077392578125,
0.0253143310546875,
-0.022247314453125,
-0.002796173095703125,
0.033935546875,
-0.050994873046875,
-0.003597259521484375,
0.0309906005859375,
-0.04278564453125,
0.03173828125,
0.003589630126953125,
0.00792694091796875,
0.00013494491577148438,
-0.0262451171875,
0.0125274658203125,
-0.01165771484375,
0.006160736083984375,
0.004245758056640625,
-0.059478759765625,
-0.03460693359375,
-0.037078857421875,
0.0316162109375,
0.054351806640625,
0.09619140625,
-0.0075225830078125,
0.04925537109375,
-0.038848876953125,
0.01102447509765625,
-0.04400634765625,
-0.021148681640625,
0.011444091796875,
0.0171661376953125,
-0.01097869873046875,
0.0035800933837890625,
-0.036102294921875,
0.0718994140625,
-0.0083770751953125,
0.0142669677734375,
0.0645751953125,
0.005535125732421875,
-0.007381439208984375,
-0.0181884765625,
0.02496337890625,
-0.01354217529296875,
0.0142059326171875,
-0.002780914306640625,
-0.0219573974609375,
0.0280303955078125,
0.01375579833984375,
0.02093505859375,
0.0655517578125,
-0.035369873046875,
0.047088623046875,
-0.00823211669921875,
-0.0147857666015625,
-0.046478271484375,
0.0106658935546875,
-0.0611572265625,
0.03369140625,
0.03643798828125,
-0.0204925537109375,
0.0556640625,
0.0031871795654296875,
0.0162200927734375,
0.03680419921875,
-0.03173828125,
-0.0250091552734375,
0.0173492431640625,
0.05615234375,
-0.0222320556640625,
0.033355712890625,
-0.0261688232421875,
0.007701873779296875,
0.031768798828125,
0.0201416015625,
-0.033782958984375,
-0.04364013671875,
-0.0183563232421875,
-0.01335906982421875,
-0.03472900390625,
-0.060882568359375,
-0.057342529296875,
0.0159454345703125,
0.020660400390625,
0.0243072509765625,
-0.0789794921875,
0.0287322998046875,
0.0247802734375,
0.05322265625,
0.0008726119995117188,
0.01812744140625,
0.002887725830078125,
0.01107025146484375,
-0.07513427734375,
-0.01096343994140625,
-0.027923583984375,
0.0004773139953613281,
-0.03436279296875,
0.0706787109375,
0.10400390625,
-0.0643310546875,
-0.00226593017578125,
0.0787353515625,
0.057098388671875,
0.1295166015625,
-0.01230621337890625,
-0.006381988525390625,
0.0147705078125,
0.0055084228515625,
-0.028289794921875,
-0.055572509765625,
0.0151214599609375,
-0.03399658203125,
-0.00006860494613647461,
-0.01305389404296875,
0.036285400390625,
0.052703857421875,
-0.0190277099609375,
-0.10009765625,
0.023773193359375,
-0.0297088623046875,
-0.032470703125,
-0.056365966796875,
0.0102081298828125,
-0.0250396728515625,
0.044830322265625,
0.005199432373046875,
-0.039306640625,
0.0034618377685546875,
0.04425048828125,
0.02874755859375,
0.0038433074951171875,
0.032135009765625,
0.0178680419921875,
-0.00615692138671875,
0.051788330078125,
0.04937744140625,
0.009033203125,
0.0026378631591796875,
-0.010528564453125,
0.01715087890625,
0.02294921875,
-0.0458984375,
-0.024749755859375,
-0.01282501220703125,
0.01396942138671875,
-0.0003402233123779297,
-0.053985595703125,
-0.009307861328125,
-0.0215606689453125,
0.034820556640625,
0.029388427734375,
-0.004497528076171875,
-0.0185089111328125,
0.0263519287109375,
0.0037784576416015625,
-0.033599853515625,
-0.023162841796875,
0.00414276123046875,
-0.04052734375,
-0.018280029296875,
-0.01396942138671875,
0.0012836456298828125,
-0.015777587890625,
-0.0109405517578125,
-0.02490234375,
-0.0124053955078125,
-0.00923919677734375,
-0.010986328125,
-0.004871368408203125,
-0.00919342041015625,
0.088134765625,
-0.05413818359375,
0.00011909008026123047,
0.0240020751953125,
-0.0018758773803710938,
0.0460205078125,
0.017608642578125,
-0.00498199462890625,
-0.04815673828125,
-0.0251922607421875,
0.0389404296875,
-0.0179290771484375,
0.0711669921875,
-0.035797119140625,
-0.0487060546875,
0.01488494873046875,
0.022369384765625,
-0.005565643310546875,
0.03802490234375,
0.0145721435546875,
0.00991058349609375,
-0.0272369384765625,
0.0206756591796875,
-0.017791748046875,
-0.018585205078125,
-0.03759765625,
0.0302581787109375,
-0.020355224609375,
-0.0027103424072265625,
0.0009255409240722656,
-0.004261016845703125,
-0.0031681060791015625,
0.0277099609375,
-0.0206146240234375,
-0.048248291015625,
0.01154327392578125,
0.000782012939453125,
0.0299224853515625,
0.00995635986328125
] |
196c1b9aeb0a261eb04473aeae255b96d00eef22
|
Wordpress Stackexchange
Q: Using WP Multisite for multi language site? A good option? I´m going to develop a site for a client which requires multiple languages. I have no experience with this from beforehand so I´m researching what might be the best way to do this.
The webpage will be in swedish, english and norwegian. I must have the ability to have separate content in each language, like separate news posts for each language, or separate products etc.
Would using WP multisite be a good way to achieve this? I´m thinking I can do like this:
Start a network with three sites: www.domain.se /en and /no. Develop for the first language version (swedish) and fill it with the correct content. Export the content, and import it from the other installations. Then replace the contents with the same content in the other languages.
Would this be a good way to achieve what I want, or would you suggest some other way?
Regards
A: There is the plugin Multilingual Press for exact this setup: It helps to synchronize multiple sub sites in a multi-site installation.
Running an import and an export each time you publish or update a page is not necessary.
|
Q: Using WP Multisite for multi language site? A good option? I´m going to develop a site for a client which requires multiple languages. I have no experience with this from beforehand so I´m researching what might be the best way to do this.
The webpage will be in swedish, english and norwegian. I must have the ability to have separate content in each language, like separate news posts for each language, or separate products etc.
Would using WP multisite be a good way to achieve this? I´m thinking I can do like this:
Start a network with three sites: www.domain.se /en and /no. Develop for the first language version (swedish) and fill it with the correct content. Export the content, and import it from the other installations. Then replace the contents with the same content in the other languages.
Would this be a good way to achieve what I want, or would you suggest some other way?
Regards
A: There is the plugin Multilingual Press for exact this setup: It helps to synchronize multiple sub sites in a multi-site installation.
Running an import and an export each time you publish or update a page is not necessary.
|
wordpress
|
{
"language": "en",
"length": 198,
"provenance": "stackexchange_00019.jsonl.gz:419890",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51883"
}
|
[
0.00907135009765625,
-0.034942626953125,
0.0142974853515625,
0.007965087890625,
-0.0305328369140625,
-0.02838134765625,
0.0135498046875,
-0.0186920166015625,
0.01031494140625,
0.01175689697265625,
0.0109100341796875,
-0.01012420654296875,
-0.0233306884765625,
-0.034149169921875,
-0.00469207763671875,
-0.0166473388671875,
0.0239410400390625,
0.0126190185546875,
0.0233001708984375,
0.0163421630859375,
-0.02618408203125,
0.03509521484375,
0.0074310302734375,
-0.035919189453125,
0.0300445556640625,
-0.07366943359375,
-0.0014743804931640625,
0.01320648193359375,
0.00926971435546875,
0.00458526611328125,
0.0305633544921875,
0.01233673095703125,
0.0362548828125,
-0.043731689453125,
0.0181427001953125,
-0.038330078125,
-0.007259368896484375,
-0.034881591796875,
-0.0386962890625,
0.037445068359375,
0.0022716522216796875,
-0.0004203319549560547,
0.0310821533203125,
0.068603515625,
0.01953125,
-0.057037353515625,
0.01462554931640625,
-0.0633544921875,
-0.01360321044921875,
-0.03314208984375,
0.00885772705078125,
-0.040191650390625,
0.02044677734375,
-0.03314208984375,
-0.0191497802734375,
-0.01029205322265625,
-0.00846099853515625,
0.036773681640625,
0.0240631103515625,
0.0018215179443359375,
-0.032806396484375,
0.0182342529296875,
0.0107421875,
-0.019744873046875,
-0.019927978515625,
-0.003055572509765625,
-0.017333984375,
-0.004917144775390625,
-0.050567626953125,
-0.02325439453125,
0.03668212890625,
-0.0447998046875,
0.035736083984375,
-0.055206298828125,
-0.0235137939453125,
0.02569580078125,
-0.023712158203125,
-0.0129547119140625,
0.04473876953125,
-0.055145263671875,
-0.03460693359375,
0.0038051605224609375,
-0.042266845703125,
-0.08367919921875,
0.0313720703125,
-0.03826904296875,
-0.0212249755859375,
0.01395416259765625,
-0.07220458984375,
0.0026721954345703125,
-0.03515625,
-0.00858306884765625,
-0.11376953125,
0.0275421142578125,
0.0247344970703125,
-0.0009236335754394531,
-0.039642333984375,
0.03546142578125,
-0.0254364013671875,
0.0251007080078125,
-0.01419830322265625,
-0.01305389404296875,
0.009765625,
-0.031707763671875,
0.01114654541015625,
0.01332855224609375,
0.011871337890625,
-0.00821685791015625,
0.030548095703125,
0.01593017578125,
-0.016876220703125,
0.05609130859375,
0.00945281982421875,
-0.0430908203125,
-0.017913818359375,
0.026702880859375,
0.0045318603515625,
-0.0015783309936523438,
0.017364501953125,
-0.0126953125,
-0.00827789306640625,
0.032318115234375,
-0.043060302734375,
-0.01462554931640625,
-0.0099334716796875,
-0.0267333984375,
0.023529052734375,
-0.00806427001953125,
-0.00765228271484375,
0.0143280029296875,
-0.0260772705078125,
-0.004642486572265625,
0.042022705078125,
0.04522705078125,
0.00539398193359375,
-0.0210113525390625,
0.006130218505859375,
0.04046630859375,
0.02337646484375,
-0.01175689697265625,
0.0207061767578125,
-0.01244354248046875,
0.01629638671875,
0.031707763671875,
-0.00662994384765625,
-0.002979278564453125,
0.00971221923828125,
0.035064697265625,
-0.0023441314697265625,
0.003662109375,
0.028656005859375,
-0.033203125,
0.02630615234375,
-0.029998779296875,
-0.00751495361328125,
-0.07757568359375,
-0.00977325439453125,
-0.035491943359375,
0.04315185546875,
-0.0256195068359375,
-0.025299072265625,
-0.033233642578125,
0.023162841796875,
-0.0089111328125,
-0.020416259765625,
0.032958984375,
0.0011911392211914062,
0.001682281494140625,
0.015045166015625,
-0.05194091796875,
-0.01410675048828125,
0.01404571533203125,
0.0225372314453125,
-0.0123138427734375,
0.00844573974609375,
0.0333251953125,
0.01447296142578125,
0.0269622802734375,
0.0198822021484375,
0.010284423828125,
0.0157012939453125,
-0.0071563720703125,
0.09808349609375,
-0.019561767578125,
-0.0399169921875,
0.007587432861328125,
0.01024627685546875,
0.08062744140625,
0.0183868408203125,
0.035186767578125,
0.0025920867919921875,
-0.00568389892578125,
-0.0230712890625,
0.00542449951171875,
0.0102081298828125,
0.015411376953125,
-0.041015625,
0.021881103515625,
-0.00928497314453125,
-0.045928955078125,
0.023223876953125,
-0.0112457275390625,
0.0243682861328125,
0.010284423828125,
-0.00981903076171875,
0.0177459716796875,
-0.017181396484375,
0.0065765380859375,
-0.001628875732421875,
-0.0157928466796875,
0.01319122314453125,
0.00930023193359375,
-0.0006256103515625,
-0.06927490234375,
-0.047698974609375,
0.031951904296875,
-0.0240325927734375,
0.029022216796875,
0.01519775390625,
0.00835418701171875,
0.047210693359375,
-0.018646240234375,
0.031982421875,
-0.0016126632690429688,
0.00937652587890625,
-0.0132293701171875,
-0.01181793212890625,
-0.012542724609375,
-0.00911712646484375,
0.0161285400390625,
-0.01806640625,
0.034881591796875,
0.00010293722152709961,
0.05743408203125,
0.0206298828125,
0.01439666748046875,
0.0269012451171875,
-0.0224609375,
-0.002353668212890625,
0.01226806640625,
0.038604736328125,
0.0197906494140625,
0.00884246826171875,
0.0062408447265625,
0.006793975830078125,
-0.043304443359375,
0.02496337890625,
-0.01415252685546875,
0.01496124267578125,
0.0513916015625,
-0.03729248046875,
-0.01290130615234375,
0.0189361572265625,
-0.07818603515625,
-0.041015625,
0.05780029296875,
-0.049285888671875,
-0.06219482421875,
0.036834716796875,
-0.0285797119140625,
0.0313720703125,
-0.030609130859375,
-0.031829833984375,
-0.00568389892578125,
0.0236358642578125,
-0.0175323486328125,
0.003383636474609375,
-0.01025390625,
-0.0023651123046875,
0.01224517822265625,
0.01393890380859375,
-0.08026123046875,
0.022186279296875,
0.0250244140625,
-0.004058837890625,
0.0278778076171875,
-0.018524169921875,
-0.0203704833984375,
0.0316162109375,
0.0261383056640625,
-0.0226593017578125,
0.06732177734375,
-0.0143890380859375,
-0.037994384765625,
-0.01788330078125,
-0.01557159423828125,
-0.035003662109375,
-0.0577392578125,
-0.0018377304077148438,
-0.0288238525390625,
0.01082611083984375,
-0.00719451904296875,
-0.051025390625,
0.04681396484375,
0.005985260009765625,
-0.04241943359375,
0.054656982421875,
-0.04827880859375,
0.039794921875,
-0.04461669921875,
0.02740478515625,
0.0546875,
-0.0151519775390625,
-0.0012044906616210938,
-0.0007138252258300781,
0.004932403564453125,
0.0046844482421875,
-0.002124786376953125,
-0.02105712890625,
-0.0250396728515625,
-0.08294677734375,
-0.02069091796875,
-0.0016155242919921875,
0.00482177734375,
-0.02716064453125,
-0.0298919677734375,
-0.0014286041259765625,
-0.0244598388671875,
-0.058929443359375,
-0.041015625,
-0.0147705078125,
-0.06884765625,
0.038665771484375,
0.0047760009765625,
-0.0234222412109375,
-0.0247344970703125,
0.029632568359375,
0.011199951171875,
0.010498046875,
-0.03729248046875,
-0.050018310546875,
-0.038543701171875,
-0.06573486328125,
0.004459381103515625,
0.010589599609375,
0.0136260986328125,
0.011474609375,
0.0073089599609375,
0.0030460357666015625,
-0.00305938720703125,
0.01378631591796875,
0.046966552734375,
-0.0113372802734375,
-0.041412353515625,
-0.0250701904296875,
-0.032196044921875,
0.040130615234375,
-0.00809478759765625,
0.0211029052734375,
0.0130767822265625,
0.0115966796875,
-0.00882720947265625,
0.0015611648559570312,
0.01413726806640625,
0.0278778076171875,
-0.0740966796875,
-0.01678466796875,
0.0269622802734375,
-0.045989990234375,
-0.037353515625,
0.00656890869140625,
-0.00991058349609375,
-0.0296478271484375,
-0.026153564453125,
0.01129913330078125,
-0.0179290771484375,
-0.003204345703125,
-0.0264129638671875,
0.0073699951171875,
-0.01287841796875,
0.040863037109375,
-0.025726318359375,
0.043731689453125,
-0.007213592529296875,
-0.01152801513671875,
-0.02984619140625,
0.0282745361328125,
-0.00954437255859375,
0.00507354736328125,
-0.0026149749755859375,
0.00811767578125,
-0.029937744140625,
0.043182373046875,
-0.04791259765625,
-0.0016717910766601562,
0.040252685546875,
0.003414154052734375,
0.0211639404296875,
-0.0002930164337158203,
-0.0343017578125,
-0.005229949951171875,
0.061767578125,
-0.053314208984375,
-0.0010404586791992188,
0.0203704833984375,
0.02496337890625,
-0.03216552734375,
-0.05987548828125,
-0.04779052734375,
-0.014251708984375,
0.00959014892578125,
0.016387939453125,
-0.02325439453125,
0.0211181640625,
-0.041107177734375,
0.023681640625,
0.0225677490234375,
-0.020843505859375,
0.037322998046875,
-0.01248931884765625,
0.00107574462890625,
-0.0020542144775390625,
-0.00438690185546875,
-0.01751708984375,
-0.037872314453125,
-0.0199127197265625,
-0.048858642578125,
-0.009735107421875,
-0.0203094482421875,
0.052581787109375,
0.007904052734375,
-0.03875732421875,
-0.01334381103515625,
0.0285797119140625,
-0.0260162353515625,
0.079345703125,
-0.0284423828125,
0.0134124755859375,
0.034271240234375,
0.0203399658203125,
0.00647735595703125,
0.0035495758056640625,
-0.0243988037109375,
0.0014925003051757812,
-0.01385498046875,
0.033203125,
-0.0099639892578125,
-0.025787353515625,
0.005645751953125,
-0.02056884765625,
-0.0254058837890625,
0.0016088485717773438,
-0.028564453125,
-0.0195770263671875,
-0.03350830078125,
-0.0208892822265625,
0.019622802734375,
-0.0242156982421875,
0.046966552734375,
0.044677734375,
-0.017608642578125,
0.006282806396484375,
0.0399169921875,
-0.004100799560546875,
-0.0521240234375,
-0.09771728515625,
-0.00732421875,
0.00820159912109375,
-0.029327392578125,
0.0443115234375,
0.0295562744140625,
-0.0160369873046875,
0.061370849609375,
-0.0131683349609375,
-0.015716552734375,
0.06549072265625,
-0.0312347412109375,
0.0362548828125,
-0.0325927734375,
0.0113067626953125,
0.0256195068359375,
-0.0416259765625,
0.05120849609375,
0.033172607421875,
-0.056304931640625,
0.01611328125,
0.047271728515625,
0.0111083984375,
-0.024169921875,
-0.046478271484375,
-0.0391845703125,
0.0102081298828125,
-0.0041351318359375,
0.0038623809814453125,
0.01493072509765625,
-0.004974365234375,
0.002437591552734375,
0.007598876953125,
0.006710052490234375,
0.02996826171875,
-0.006717681884765625,
0.007904052734375,
0.01300048828125,
0.031402587890625,
-0.019805908203125,
0.01107025146484375,
-0.0092315673828125,
0.04833984375,
-0.004604339599609375,
-0.038787841796875,
0.0125579833984375,
-0.01605224609375,
-0.001323699951171875,
0.04229736328125,
0.027984619140625,
0.0179290771484375,
-0.01186370849609375,
-0.0246429443359375,
0.0106964111328125,
0.057708740234375,
-0.052215576171875,
-0.038787841796875,
-0.06805419921875,
-0.01038360595703125,
-0.01309967041015625,
-0.006488800048828125,
0.06390380859375,
-0.07293701171875,
0.050384521484375,
0.009429931640625,
0.0179443359375,
0.040496826171875,
0.0026836395263671875,
0.0094146728515625,
0.0013570785522460938,
-0.01554107666015625,
0.00024390220642089844,
0.0206146240234375,
0.00603485107421875,
0.031341552734375,
0.03521728515625,
0.0247344970703125,
0.0122528076171875,
-0.00952911376953125,
-0.0241546630859375,
-0.044158935546875,
-0.01605224609375,
0.0419921875,
0.012237548828125,
-0.06488037109375,
-0.00972747802734375,
0.006557464599609375,
0.0038814544677734375,
-0.0311279296875,
-0.003040313720703125,
-0.01812744140625,
-0.04681396484375,
-0.0123291015625,
0.007659912109375,
-0.01004791259765625,
-0.01800537109375,
-0.01385498046875,
0.004405975341796875,
-0.0110931396484375,
-0.007587432861328125,
-0.07830810546875,
-0.0186767578125,
0.00226593017578125,
0.0161895751953125,
0.0115509033203125,
-0.0148468017578125,
-0.007427215576171875,
-0.018157958984375,
0.00833892822265625,
-0.01323699951171875,
0.0242462158203125,
-0.005725860595703125,
-0.033111572265625,
0.0020351409912109375,
0.005107879638671875,
-0.044952392578125,
-0.0169525146484375,
0.0092315673828125,
-0.0501708984375,
-0.0283355712890625,
-0.02252197265625,
0.0168609619140625,
0.01629638671875,
-0.012481689453125,
-0.039337158203125,
-0.031494140625,
0.0155029296875,
0.02996826171875,
-0.00011789798736572266,
-0.021331787109375,
0.065673828125,
0.00011205673217773438,
0.0555419921875,
0.0247344970703125,
0.0609130859375,
0.028961181640625,
-0.035430908203125,
0.00341796875,
-0.039703369140625,
-0.01611328125,
0.00482940673828125,
-0.009857177734375,
0.0113677978515625,
0.01410675048828125,
-0.0037899017333984375,
0.037200927734375,
-0.02099609375,
0.004734039306640625,
-0.02386474609375,
-0.0092926025390625,
-0.049591064453125,
0.0192108154296875,
0.0018520355224609375,
-0.0291748046875,
0.00885009765625,
-0.008941650390625,
0.0147552490234375,
0.01303863525390625,
-0.039215087890625,
0.0012645721435546875,
0.0286865234375,
0.026275634765625,
-0.0250396728515625,
0.00620269775390625,
-0.0006628036499023438,
0.03204345703125,
0.0247650146484375,
0.0225830078125,
0.0260162353515625,
-0.01453399658203125,
0.01861572265625,
-0.0264739990234375,
-0.020904541015625,
-0.043487548828125,
0.010467529296875,
-0.041900634765625,
-0.0040435791015625,
0.0025997161865234375,
0.06640625,
0.054107666015625,
-0.10296630859375,
-0.002338409423828125,
0.01425933837890625,
-0.028717041015625,
-0.059326171875,
-0.007144927978515625,
-0.0300445556640625,
-0.065185546875,
0.057037353515625,
-0.027496337890625,
-0.03033447265625,
0.00777435302734375,
-0.025604248046875,
-0.016693115234375,
0.024444580078125,
0.00824737548828125,
0.041229248046875,
-0.02783203125,
0.0221405029296875,
0.022430419921875,
0.0362548828125,
-0.0258026123046875,
-0.0080108642578125,
0.0104217529296875,
-0.0283355712890625,
-0.05047607421875,
0.0140228271484375,
-0.016357421875,
-0.003993988037109375,
-0.040130615234375,
-0.0003724098205566406,
-0.0191192626953125,
0.076416015625,
-0.056365966796875,
-0.0073394775390625,
0.061126708984375,
-0.01253509521484375,
-0.00395965576171875,
0.0160675048828125,
0.057952880859375,
-0.01154327392578125,
-0.051483154296875,
0.01346588134765625,
-0.05584716796875,
-0.01166534423828125,
-0.0007433891296386719,
0.0238189697265625,
0.03204345703125,
-0.006622314453125,
-0.005157470703125,
0.04473876953125,
0.03741455078125,
-0.0012083053588867188,
-0.01255035400390625,
-0.004886627197265625,
-0.09332275390625,
-0.08721923828125,
-0.000484466552734375,
-0.08197021484375,
0.0176849365234375,
-0.003253936767578125,
-0.0772705078125,
0.10870361328125,
0.006496429443359375,
0.0709228515625,
0.0220489501953125,
0.031463623046875,
-0.01751708984375,
0.002483367919921875,
-0.018402099609375,
0.0160064697265625,
0.00421142578125,
0.009124755859375,
-0.039093017578125,
0.0002841949462890625,
0.0019140243530273438,
0.030487060546875,
0.007015228271484375,
0.0172119140625,
-0.027923583984375,
0.00705718994140625,
0.036224365234375,
0.0256805419921875,
0.01019287109375,
0.026092529296875,
-0.0166778564453125,
0.034698486328125,
-0.0025691986083984375,
-0.061859130859375,
0.0157318115234375,
-0.00754547119140625,
-0.045166015625,
0.00806427001953125,
-0.0218048095703125,
-0.057373046875,
-0.0052337646484375,
0.007450103759765625,
-0.06768798828125,
0.0091705322265625,
0.0226593017578125,
0.0003807544708251953,
0.0310211181640625,
-0.01010894775390625,
-0.013763427734375,
0.0114593505859375,
0.06976318359375,
-0.02703857421875,
0.0411376953125,
-0.01251983642578125,
0.01346588134765625,
0.067626953125,
0.016357421875,
0.0279693603515625,
0.04522705078125,
0.013519287109375,
-0.008148193359375,
0.0345458984375,
0.019317626953125,
0.0255279541015625,
0.03631591796875,
-0.02557373046875,
-0.042572021484375,
0.0279388427734375,
0.027923583984375,
-0.005001068115234375,
-0.048370361328125,
0.013946533203125,
0.00299072265625,
-0.01248931884765625,
0.0241241455078125,
-0.0133209228515625,
0.00897216796875,
0.05810546875,
0.0233612060546875,
-0.00628662109375,
-0.0206146240234375,
0.01273345947265625,
0.00850677490234375,
0.024932861328125,
0.001735687255859375,
0.0112152099609375,
-0.0450439453125,
0.005451202392578125,
0.0230560302734375,
0.09100341796875,
0.0282440185546875,
0.0858154296875,
-0.031951904296875,
-0.04962158203125,
0.002986907958984375,
0.0248565673828125,
0.0026798248291015625,
-0.0341796875,
-0.019989013671875,
-0.06585693359375,
0.0101470947265625,
0.02984619140625,
0.027587890625,
0.0148468017578125,
0.0628662109375,
0.07415771484375,
-0.01230621337890625,
-0.0217132568359375,
0.0230560302734375,
-0.0125885009765625,
0.009429931640625,
-0.03759765625,
0.01522064208984375,
-0.0141143798828125,
-0.0115509033203125,
-0.0250091552734375,
0.035614013671875,
-0.0032634735107421875,
-0.01800537109375,
0.024078369140625,
-0.0020542144775390625,
-0.04541015625,
0.0296173095703125,
-0.015869140625,
0.0843505859375,
-0.0010766983032226562,
-0.0789794921875,
-0.0287933349609375,
-0.0195770263671875,
-0.0016689300537109375,
0.020904541015625,
0.040191650390625,
0.0084991455078125,
0.003002166748046875,
0.00438690185546875,
0.00965118408203125,
0.01202392578125,
-0.0167083740234375,
-0.0125579833984375,
-0.032989501953125,
0.0247955322265625,
-0.018585205078125,
-0.0225982666015625,
-0.01348114013671875,
-0.0012731552124023438,
0.047271728515625,
0.01387786865234375,
0.046905517578125,
-0.006496429443359375,
0.035247802734375,
0.019989013671875,
-0.0482177734375,
0.06427001953125,
0.005077362060546875,
0.0003247261047363281,
0.0196990966796875,
0.02069091796875,
-0.0249786376953125,
-0.0271148681640625,
0.006099700927734375,
0.014892578125,
-0.0171051025390625,
-0.01317596435546875,
-0.0275421142578125,
0.031341552734375,
0.0292510986328125,
0.041107177734375,
-0.04095458984375,
-0.020751953125,
-0.078369140625,
-0.028717041015625,
0.05218505859375,
0.0162200927734375,
-0.0311737060546875,
0.019805908203125,
-0.0222320556640625,
-0.037139892578125,
0.00659942626953125,
-0.043304443359375,
-0.01629638671875,
0.0170440673828125,
0.0214385986328125,
-0.048431396484375,
0.006771087646484375,
-0.00711822509765625,
-0.042755126953125,
0.01189422607421875,
0.04071044921875,
0.004634857177734375,
-0.0239410400390625,
0.0032520294189453125,
0.05572509765625,
0.0194091796875,
-0.0160980224609375,
0.004070281982421875,
0.059539794921875,
-0.037567138671875,
-0.00814056396484375,
0.0018815994262695312,
-0.0286712646484375,
-0.01259613037109375,
0.0084075927734375,
0.011138916015625,
-0.0060577392578125,
-0.02435302734375,
-0.05108642578125,
-0.0225982666015625,
0.01275634765625,
-0.04290771484375,
0.0067596435546875,
0.001384735107421875,
-0.041229248046875,
0.0048675537109375,
-0.0540771484375,
-0.042694091796875,
0.00024819374084472656,
0.0127105712890625,
-0.03973388671875,
-0.041290283203125,
-0.054168701171875,
-0.0116119384765625,
-0.0693359375,
0.021575927734375,
0.032958984375,
-0.015350341796875,
0.0005016326904296875,
0.00519561767578125,
0.0123291015625,
0.051666259765625,
0.00428009033203125,
-0.0226287841796875,
0.01137542724609375,
-0.01221466064453125,
-0.01202392578125,
-0.026641845703125,
0.0141143798828125,
-0.045074462890625,
-0.0218658447265625,
-0.0379638671875,
-0.0053253173828125,
0.007415771484375,
-0.063720703125,
-0.119873046875,
0.09088134765625,
-0.0389404296875,
-0.032989501953125,
-0.0355224609375,
-0.0279541015625,
0.01552581787109375,
-0.046966552734375,
-0.0249176025390625,
-0.0089874267578125,
-0.0509033203125,
0.020843505859375,
0.000469207763671875,
0.034454345703125,
0.0034847259521484375,
-0.005573272705078125,
0.006305694580078125,
0.015716552734375,
0.030731201171875,
-0.0205078125,
0.0020503997802734375,
-0.01428985595703125,
0.022796630859375,
0.02862548828125,
-0.024200439453125,
-0.038299560546875,
0.019317626953125,
0.009674072265625,
-0.01143646240234375,
-0.031646728515625,
-0.039031982421875,
-0.033538818359375,
0.0789794921875,
0.0309906005859375,
0.021820068359375,
-0.028106689453125,
0.050628662109375,
0.0229949951171875,
-0.0239715576171875,
-0.0169219970703125,
-0.0012483596801757812,
-0.0276336669921875,
-0.020538330078125,
-0.0252227783203125,
0.00008726119995117188,
0.050689697265625,
0.00045752525329589844,
-0.0025424957275390625,
0.0099945068359375,
0.020904541015625,
-0.0269775390625,
-0.034820556640625,
-0.0024471282958984375,
0.07196044921875,
-0.038116455078125,
0.0170440673828125,
-0.005748748779296875,
0.007568359375,
0.0419921875,
0.0198822021484375,
-0.0080108642578125,
0.0274658203125,
-0.044708251953125,
-0.006542205810546875,
0.007110595703125,
0.01261138916015625,
-0.01544189453125,
0.0034332275390625,
0.00408172607421875,
0.030120849609375,
-0.0019502639770507812,
0.057861328125,
0.0174560546875,
0.004764556884765625,
0.00865936279296875,
-0.040557861328125,
-0.017120361328125,
-0.029693603515625,
-0.031341552734375,
0.03997802734375,
-0.04827880859375,
0.004413604736328125,
-0.015167236328125,
-0.041778564453125,
-0.0007700920104980469,
0.004009246826171875,
0.007511138916015625,
-0.051788330078125,
0.02423095703125,
0.003559112548828125,
0.0105743408203125,
0.01157379150390625
] |
31ffd213cc6b705facb63cc7c684c2b3ba5c9ecb
|
Wordpress Stackexchange
Q: How come Featured Image isn't showing up in my Custom Post Type? I have thumbnail support added with the following in my functions.php
// Add Thumbnail Support
add_theme_support('post-thumbnails');
set_post_thumbnail_size( 140, 140, true );
And I create the custom post type with
// Create Custom Post Type for Work
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'custom_post',
array(
'thumbnail',
'labels' => array(
'name' => __( 'Custom' ),
'singular_name' => __( 'Custom' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'custom'),
'taxonomies' => array('category', 'post_tag')
)
);
}
However, when I create a new post in the Custom Post Type, the Featured Image meta box does not show. I have also tried using an array when declaring the custom post type, as follows but that didn't work either
// Add Thumbnail Support
add_theme_support('post-thumbnails', array ('post','work','custom_post'));
set_post_thumbnail_size( 140, 140, true );
What am I missing?
A: Add this parameter into your array:
'supports' => array('thumbnail'),
Edit: Milo was faster.
|
Q: How come Featured Image isn't showing up in my Custom Post Type? I have thumbnail support added with the following in my functions.php
// Add Thumbnail Support
add_theme_support('post-thumbnails');
set_post_thumbnail_size( 140, 140, true );
And I create the custom post type with
// Create Custom Post Type for Work
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'custom_post',
array(
'thumbnail',
'labels' => array(
'name' => __( 'Custom' ),
'singular_name' => __( 'Custom' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'custom'),
'taxonomies' => array('category', 'post_tag')
)
);
}
However, when I create a new post in the Custom Post Type, the Featured Image meta box does not show. I have also tried using an array when declaring the custom post type, as follows but that didn't work either
// Add Thumbnail Support
add_theme_support('post-thumbnails', array ('post','work','custom_post'));
set_post_thumbnail_size( 140, 140, true );
What am I missing?
A: Add this parameter into your array:
'supports' => array('thumbnail'),
Edit: Milo was faster.
A: try the register_post_type supports parameter:
'supports' => array( 'thumbnail' )
A: Try this it works for me.....
add_theme_support('post-thumbnails');
add_post_type_support( 'my_product', 'thumbnail' );
function create_post_type() {
register_post_type( 'my_product',
array(
'labels' => array(
'name' => __( 'Products' ),
'singular_name' => __( 'Product' )
),
'public' => true,
'has_archive' => true
)
);
}
add_action( 'init', 'create_post_type' );
|
wordpress
|
{
"language": "en",
"length": 218,
"provenance": "stackexchange_00019.jsonl.gz:419895",
"question_score": "41",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51897"
}
|
[
0.03369140625,
-0.00687408447265625,
0.006221771240234375,
-0.0164947509765625,
0.021331787109375,
-0.01088714599609375,
0.0660400390625,
-0.0302581787109375,
-0.00916290283203125,
-0.005687713623046875,
-0.0036640167236328125,
-0.01032257080078125,
-0.04693603515625,
-0.04388427734375,
0.00778961181640625,
-0.025726318359375,
0.053680419921875,
-0.0313720703125,
0.037078857421875,
-0.0012006759643554688,
0.016448974609375,
0.0391845703125,
0.0186309814453125,
0.06512451171875,
0.0186614990234375,
-0.049835205078125,
0.043853759765625,
-0.03387451171875,
-0.0018367767333984375,
-0.01076507568359375,
0.01383209228515625,
0.025360107421875,
0.01285552978515625,
0.0211639404296875,
-0.00971221923828125,
0.046783447265625,
0.04095458984375,
-0.0012502670288085938,
-0.003032684326171875,
0.0301971435546875,
0.01666259765625,
0.0013513565063476562,
0.02996826171875,
-0.0310821533203125,
-0.003574371337890625,
-0.0232696533203125,
0.01189422607421875,
-0.0291290283203125,
0.00719451904296875,
-0.0193023681640625,
-0.005626678466796875,
0.019775390625,
0.0178985595703125,
-0.0556640625,
-0.005771636962890625,
-0.00750732421875,
-0.043670654296875,
0.03515625,
0.041412353515625,
-0.02142333984375,
-0.032073974609375,
-0.031768798828125,
0.020965576171875,
-0.0146636962890625,
-0.00267791748046875,
0.014373779296875,
-0.0187835693359375,
0.005046844482421875,
-0.02276611328125,
-0.004192352294921875,
0.01006317138671875,
-0.04608154296875,
0.009552001953125,
-0.01178741455078125,
-0.0011587142944335938,
0.01214599609375,
-0.0246734619140625,
-0.01552581787109375,
0.0270843505859375,
-0.004428863525390625,
0.01476287841796875,
-0.024261474609375,
0.015899658203125,
0.0184478759765625,
0.01079559326171875,
0.052642822265625,
-0.007259368896484375,
-0.0325927734375,
-0.0012197494506835938,
-0.0010156631469726562,
-0.0004887580871582031,
-0.060638427734375,
-0.041748046875,
0.07989501953125,
0.047607421875,
-0.04547119140625,
0.06842041015625,
0.04522705078125,
0.0039825439453125,
0.0008296966552734375,
0.01082611083984375,
-0.05902099609375,
0.046722412109375,
-0.036102294921875,
0.02423095703125,
0.00264739990234375,
-0.043060302734375,
-0.03155517578125,
0.041839599609375,
0.048065185546875,
0.003597259521484375,
-0.0025348663330078125,
0.0242462158203125,
-0.0062713623046875,
-0.036041259765625,
-0.000499725341796875,
-0.00555419921875,
-0.0010976791381835938,
0.007602691650390625,
-0.003368377685546875,
0.030487060546875,
0.04217529296875,
0.03289794921875,
-0.0439453125,
0.02984619140625,
0.033172607421875,
-0.037261962890625,
-0.06304931640625,
0.0064239501953125,
0.046966552734375,
-0.0302276611328125,
-0.0082855224609375,
0.043701171875,
0.0193634033203125,
0.0091094970703125,
-0.0304718017578125,
0.016876220703125,
-0.0498046875,
-0.034820556640625,
0.0288848876953125,
-0.045135498046875,
-0.015228271484375,
0.039947509765625,
-0.055938720703125,
0.019256591796875,
0.01319122314453125,
0.00518035888671875,
0.0197296142578125,
-0.00001615285873413086,
-0.051422119140625,
0.0400390625,
-0.058837890625,
0.04339599609375,
0.025177001953125,
-0.0268707275390625,
0.006923675537109375,
0.054718017578125,
-0.021453857421875,
-0.042083740234375,
-0.051910400390625,
0.0382080078125,
-0.008514404296875,
-0.0165557861328125,
-0.0198516845703125,
-0.037261962890625,
0.006500244140625,
-0.055145263671875,
0.0135650634765625,
0.029937744140625,
0.0202484130859375,
0.0207977294921875,
0.0035839080810546875,
0.0236968994140625,
-0.00411224365234375,
-0.01556396484375,
-0.00975799560546875,
0.019561767578125,
0.0237274169921875,
0.0209808349609375,
0.04754638671875,
-0.00988006591796875,
-0.033966064453125,
0.060089111328125,
-0.040283203125,
-0.021759033203125,
0.00656890869140625,
0.0028591156005859375,
0.0193939208984375,
0.01027679443359375,
0.0167694091796875,
-0.0098114013671875,
0.0143890380859375,
-0.04156494140625,
0.0160369873046875,
0.0190277099609375,
-0.01265716552734375,
-0.03729248046875,
-0.03985595703125,
-0.002689361572265625,
0.00963592529296875,
0.00734710693359375,
-0.001880645751953125,
0.0189056396484375,
-0.0014867782592773438,
-0.0257568359375,
0.023040771484375,
-0.02386474609375,
0.0396728515625,
-0.0272369384765625,
0.00843048095703125,
0.02545166015625,
-0.0024509429931640625,
-0.0297698974609375,
-0.008148193359375,
-0.0006651878356933594,
0.017120361328125,
-0.00994873046875,
0.02154541015625,
-0.0196990966796875,
0.048553466796875,
-0.035369873046875,
-0.0445556640625,
-0.04364013671875,
0.01453399658203125,
0.05322265625,
0.042144775390625,
-0.045013427734375,
0.0023345947265625,
-0.005733489990234375,
0.03192138671875,
-0.09332275390625,
0.0555419921875,
-0.032440185546875,
-0.04229736328125,
-0.0254974365234375,
-0.004444122314453125,
0.021697998046875,
-0.069580078125,
0.0207977294921875,
0.053009033203125,
0.019256591796875,
0.041534423828125,
0.005474090576171875,
0.0248565673828125,
0.0838623046875,
0.04046630859375,
0.01910400390625,
-0.00400543212890625,
0.003711700439453125,
0.0023937225341796875,
0.017974853515625,
-0.03387451171875,
0.01904296875,
-0.06304931640625,
0.034576416015625,
0.0235137939453125,
-0.017242431640625,
0.0057373046875,
-0.01128387451171875,
0.01513671875,
-0.006870269775390625,
0.040985107421875,
0.0190582275390625,
-0.0013790130615234375,
0.01788330078125,
0.049346923828125,
0.0467529296875,
0.043426513671875,
-0.039886474609375,
0.039825439453125,
-0.0017175674438476562,
0.0149688720703125,
0.0014514923095703125,
0.011962890625,
-0.01404571533203125,
0.006649017333984375,
-0.046875,
0.02520751953125,
0.0257415771484375,
-0.0045623779296875,
-0.012542724609375,
0.0038318634033203125,
-0.047821044921875,
0.01078033447265625,
-0.005279541015625,
-0.0618896484375,
0.0181121826171875,
0.0712890625,
0.0361328125,
0.0019178390502929688,
0.01995849609375,
0.02032470703125,
-0.007904052734375,
0.059356689453125,
-0.005107879638671875,
-0.02203369140625,
0.0009374618530273438,
-0.06329345703125,
0.059326171875,
-0.0411376953125,
0.092041015625,
0.07958984375,
-0.03472900390625,
0.043609619140625,
0.007110595703125,
-0.0218353271484375,
-0.0265350341796875,
0.050537109375,
0.01189422607421875,
-0.05523681640625,
0.0002906322479248047,
0.0236053466796875,
0.0171051025390625,
0.0288543701171875,
-0.01314544677734375,
-0.021697998046875,
0.0038051605224609375,
0.0243682861328125,
-0.0292510986328125,
-0.0243377685546875,
0.0004439353942871094,
-0.054168701171875,
-0.039794921875,
-0.0251617431640625,
-0.043731689453125,
0.0152587890625,
-0.01482391357421875,
-0.004375457763671875,
-0.0501708984375,
-0.0232391357421875,
-0.007732391357421875,
-0.0665283203125,
-0.035675048828125,
-0.0266876220703125,
0.0131072998046875,
0.01361846923828125,
0.01241302490234375,
0.0665283203125,
0.0179290771484375,
-0.05181884765625,
0.0106658935546875,
0.0268402099609375,
-0.0211181640625,
0.0270843505859375,
0.0101776123046875,
-0.00325775146484375,
-0.006317138671875,
-0.0014562606811523438,
0.0284271240234375,
0.049835205078125,
-0.04364013671875,
0.0010395050048828125,
-0.042236328125,
-0.040374755859375,
-0.032501220703125,
0.05792236328125,
0.0616455078125,
-0.016326904296875,
0.039825439453125,
-0.04888916015625,
-0.0203857421875,
-0.0390625,
-0.046722412109375,
-0.0007266998291015625,
0.01155853271484375,
0.03204345703125,
-0.0294952392578125,
0.05279541015625,
-0.0023250579833984375,
0.0010843276977539062,
0.0248260498046875,
-0.0328369140625,
0.05914306640625,
0.000858306884765625,
-0.00859832763671875,
-0.043548583984375,
-0.0159759521484375,
-0.01678466796875,
0.07568359375,
0.0102081298828125,
0.037017822265625,
-0.0199432373046875,
0.042877197265625,
-0.058074951171875,
-0.06158447265625,
0.048797607421875,
-0.0322265625,
0.005687713623046875,
-0.01468658447265625,
-0.0274810791015625,
0.0219879150390625,
0.09307861328125,
-0.05108642578125,
-0.0222320556640625,
-0.015045166015625,
0.007434844970703125,
0.00815582275390625,
-0.01922607421875,
-0.020965576171875,
-0.01157379150390625,
-0.09454345703125,
0.0017080307006835938,
0.01097869873046875,
-0.05181884765625,
0.0009722709655761719,
-0.013946533203125,
-0.07586669921875,
-0.034820556640625,
0.0155029296875,
0.00013113021850585938,
0.00457000732421875,
0.0264434814453125,
-0.007747650146484375,
0.0218658447265625,
-0.00018322467803955078,
-0.036102294921875,
-0.11968994140625,
-0.01338958740234375,
-0.0208587646484375,
0.08544921875,
-0.033538818359375,
0.02838134765625,
-0.0660400390625,
0.031341552734375,
0.01233673095703125,
0.0135040283203125,
0.004734039306640625,
-0.01131439208984375,
0.015655517578125,
0.0271148681640625,
0.01134490966796875,
-0.004589080810546875,
-0.022308349609375,
-0.0406494140625,
-0.03045654296875,
-0.02301025390625,
-0.01168060302734375,
0.006702423095703125,
0.0130462646484375,
-0.01270294189453125,
-0.00777435302734375,
-0.019622802734375,
0.006988525390625,
0.03851318359375,
0.016265869140625,
-0.00160980224609375,
-0.048431396484375,
-0.0161285400390625,
0.0611572265625,
-0.0054473876953125,
-0.0093841552734375,
0.008026123046875,
0.09478759765625,
0.00792694091796875,
-0.023590087890625,
-0.0994873046875,
0.0028076171875,
0.0458984375,
0.01221466064453125,
0.01361083984375,
0.014129638671875,
-0.0219268798828125,
0.0029125213623046875,
0.0225830078125,
-0.01055145263671875,
-0.00525665283203125,
0.049102783203125,
-0.003650665283203125,
-0.0164794921875,
0.00415802001953125,
-0.030609130859375,
0.024566650390625,
0.00676727294921875,
0.006015777587890625,
-0.024322509765625,
0.0018739700317382812,
0.0305023193359375,
-0.0163726806640625,
0.010162353515625,
-0.0372314453125,
-0.00797271728515625,
0.00018477439880371094,
0.012451171875,
0.07073974609375,
0.0198974609375,
-0.0009355545043945312,
0.0206756591796875,
-0.003528594970703125,
0.005405426025390625,
0.0150909423828125,
-0.0198822021484375,
0.01201629638671875,
0.025665283203125,
0.0230255126953125,
0.01030731201171875,
0.0186614990234375,
0.010955810546875,
-0.00010275840759277344,
-0.0087432861328125,
-0.026336669921875,
-0.06341552734375,
0.0093841552734375,
0.0166015625,
0.0020198822021484375,
-0.01409149169921875,
0.04296875,
0.04852294921875,
-0.00713348388671875,
-0.027130126953125,
-0.029937744140625,
0.020721435546875,
-0.05950927734375,
0.002407073974609375,
0.0094146728515625,
-0.015960693359375,
0.00960540771484375,
0.036468505859375,
-0.001674652099609375,
0.0160369873046875,
-0.005504608154296875,
0.03021240234375,
0.02227783203125,
0.032440185546875,
0.01076507568359375,
0.0195465087890625,
-0.0413818359375,
0.045074462890625,
-0.0244140625,
-0.0212860107421875,
-0.0233154296875,
-0.00772857666015625,
0.04022216796875,
-0.038818359375,
0.0006518363952636719,
0.03619384765625,
-0.0031585693359375,
-0.0092926025390625,
-0.0167236328125,
-0.0457763671875,
-0.06695556640625,
0.0184783935546875,
0.031890869140625,
0.014984130859375,
-0.0299835205078125,
-0.058624267578125,
0.0245819091796875,
-0.0413818359375,
0.0377197265625,
-0.048370361328125,
-0.0011663436889648438,
0.0264129638671875,
0.008514404296875,
-0.0174407958984375,
-0.01058197021484375,
-0.02142333984375,
0.023468017578125,
-0.019744873046875,
-0.0074920654296875,
-0.0188446044921875,
0.037261962890625,
-0.06475830078125,
0.0265350341796875,
-0.006992340087890625,
0.0008726119995117188,
-0.02178955078125,
0.035491943359375,
0.019439697265625,
0.0228271484375,
-0.019195556640625,
0.01264190673828125,
-0.0140228271484375,
0.0019044876098632812,
0.06756591796875,
-0.005496978759765625,
-0.01198577880859375,
-0.06591796875,
0.01305389404296875,
0.01052093505859375,
-0.015716552734375,
-0.02362060546875,
-0.022064208984375,
0.035308837890625,
0.034942626953125,
0.0518798828125,
-0.0200042724609375,
-0.0018167495727539062,
0.027252197265625,
0.034088134765625,
-0.0131683349609375,
-0.03192138671875,
0.005031585693359375,
-0.01190185546875,
-0.0234375,
-0.036773681640625,
0.01119232177734375,
0.025909423828125,
-0.0225067138671875,
0.0251007080078125,
0.0755615234375,
0.015838623046875,
-0.0167236328125,
-0.01287841796875,
-0.0088958740234375,
-0.032562255859375,
0.05926513671875,
0.010589599609375,
0.0099334716796875,
-0.02288818359375,
-0.033599853515625,
0.007541656494140625,
0.0181121826171875,
-0.006610870361328125,
0.022552490234375,
-0.0279998779296875,
-0.0013828277587890625,
0.05401611328125,
-0.016326904296875,
0.0157318115234375,
0.06640625,
0.00698089599609375,
0.050018310546875,
0.01079559326171875,
-0.00018894672393798828,
0.01358795166015625,
0.0074310302734375,
-0.050323486328125,
-0.024444580078125,
0.03466796875,
0.01180267333984375,
-0.00281524658203125,
0.0302276611328125,
0.001861572265625,
0.015106201171875,
0.0137481689453125,
0.04266357421875,
-0.02349853515625,
0.020111083984375,
0.00749969482421875,
-0.01293182373046875,
0.055908203125,
-0.0173187255859375,
0.0251007080078125,
0.031646728515625,
0.04156494140625,
-0.004314422607421875,
-0.0220184326171875,
0.00585174560546875,
-0.0013723373413085938,
-0.018218994140625,
0.013763427734375,
-0.0207366943359375,
0.012939453125,
-0.039215087890625,
-0.002681732177734375,
0.0283966064453125,
-0.01442718505859375,
0.01476287841796875,
0.041259765625,
-0.052276611328125,
-0.0053253173828125,
-0.02691650390625,
-0.01439666748046875,
-0.0280914306640625,
-0.00646209716796875,
0.08447265625,
0.0002562999725341797,
0.01386260986328125,
0.04254150390625,
-0.00823211669921875,
0.0433349609375,
-0.0031490325927734375,
-0.044647216796875,
0.0183258056640625,
-0.0126800537109375,
0.0251922607421875,
0.028656005859375,
-0.0279693603515625,
0.0173187255859375,
-0.0175933837890625,
-0.005462646484375,
-0.00334930419921875,
-0.0033664703369140625,
0.06744384765625,
-0.019439697265625,
-0.02093505859375,
0.0221710205078125,
0.03790283203125,
-0.01157379150390625,
0.0025691986083984375,
-0.0006351470947265625,
-0.053314208984375,
-0.01160430908203125,
-0.0079803466796875,
-0.0197906494140625,
0.018463134765625,
0.004634857177734375,
-0.04345703125,
0.0821533203125,
-0.0244293212890625,
0.01517486572265625,
0.007396697998046875,
0.042144775390625,
0.003108978271484375,
0.0297698974609375,
-0.00583648681640625,
-0.002658843994140625,
-0.05810546875,
0.01148223876953125,
-0.04339599609375,
0.025146484375,
-0.01558685302734375,
0.013336181640625,
0.0277862548828125,
0.0164337158203125,
-0.04132080078125,
0.006015777587890625,
0.06622314453125,
0.04278564453125,
0.0135650634765625,
0.0235595703125,
-0.022064208984375,
-0.0117340087890625,
0.020843505859375,
-0.0027370452880859375,
0.028961181640625,
0.00646209716796875,
-0.051605224609375,
0.0008230209350585938,
0.0162811279296875,
0.031524658203125,
0.00923919677734375,
0.00479888916015625,
-0.039093017578125,
0.01528167724609375,
0.052520751953125,
-0.0362548828125,
0.0091400146484375,
0.0248870849609375,
0.04266357421875,
-0.00811004638671875,
-0.029388427734375,
-0.004673004150390625,
0.04046630859375,
0.0202484130859375,
0.041473388671875,
-0.01556396484375,
0.02093505859375,
0.024749755859375,
-0.026336669921875,
0.0124359130859375,
0.041717529296875,
-0.039825439453125,
0.01021575927734375,
0.0131988525390625,
0.01161956787109375,
-0.048187255859375,
0.01261138916015625,
0.059112548828125,
0.0313720703125,
-0.041534423828125,
-0.032928466796875,
0.00568389892578125,
0.024627685546875,
0.00411224365234375,
-0.00608062744140625,
0.00007671117782592773,
-0.017547607421875,
0.041900634765625,
-0.068359375,
0.0029697418212890625,
0.0445556640625,
0.036590576171875,
-0.0194244384765625,
-0.033935546875,
-0.041412353515625,
-0.012664794921875,
-0.03558349609375,
-0.006366729736328125,
0.026336669921875,
0.06414794921875,
0.021148681640625,
0.05670166015625,
-0.0014190673828125,
-0.013641357421875,
-0.0176239013671875,
0.0308380126953125,
0.0008988380432128906,
0.0182037353515625,
-0.0304107666015625,
-0.0176849365234375,
0.0174713134765625,
0.03851318359375,
0.01263427734375,
-0.007328033447265625,
0.0220947265625,
0.0017223358154296875,
-0.05328369140625,
-0.007587432861328125,
0.0482177734375,
-0.0196990966796875,
-0.02606201171875,
-0.050750732421875,
0.0283050537109375,
0.03753662109375,
0.005329132080078125,
0.02960205078125,
-0.021820068359375,
0.047821044921875,
-0.009674072265625,
0.03509521484375,
-0.004268646240234375,
-0.0188446044921875,
0.031707763671875,
-0.01450347900390625,
0.09027099609375,
0.01345062255859375,
-0.042999267578125,
-0.00797271728515625,
-0.007053375244140625,
-0.051300048828125,
0.0269927978515625,
0.031890869140625,
-0.0273284912109375,
0.01151275634765625,
0.0325927734375,
-0.006999969482421875,
0.012664794921875,
-0.007205963134765625,
0.01995849609375,
0.00872039794921875,
0.02105712890625,
0.0223388671875,
-0.048095703125,
-0.02838134765625,
-0.0014743804931640625,
0.028961181640625,
-0.0333251953125,
0.075927734375,
-0.0169525146484375,
0.006931304931640625,
-0.01015472412109375,
0.0193023681640625,
-0.0174102783203125,
-0.01861572265625,
0.032318115234375,
0.006805419921875,
0.012420654296875,
-0.015777587890625,
-0.00347900390625,
-0.0032863616943359375,
0.04217529296875,
-0.0377197265625,
-0.039459228515625,
0.02935791015625,
0.0255126953125,
0.004909515380859375,
-0.00927734375,
-0.04254150390625,
-0.0301513671875,
-0.0692138671875,
-0.0292816162109375,
0.0280609130859375,
-0.01739501953125,
-0.0025463104248046875,
0.020294189453125,
0.0288238525390625,
-0.0009102821350097656,
0.045074462890625,
-0.02679443359375,
0.09271240234375,
0.04058837890625,
-0.0239105224609375,
-0.047698974609375,
-0.01557159423828125,
-0.01177215576171875,
-0.0192413330078125,
0.00995635986328125,
0.0430908203125,
0.0002570152282714844,
-0.022735595703125,
0.05889892578125,
0.0053558349609375,
0.013641357421875,
-0.056854248046875,
-0.0225372314453125,
0.055694580078125,
-0.002567291259765625,
0.006282806396484375,
0.0290374755859375,
-0.0059967041015625,
-0.040283203125,
-0.005306243896484375,
0.00783538818359375,
-0.006946563720703125,
0.006103515625,
-0.0246429443359375,
-0.00661468505859375,
0.056640625,
0.027984619140625,
-0.057586669921875,
0.0328369140625,
-0.005435943603515625,
0.01204681396484375,
0.03759765625,
-0.03387451171875,
0.0261993408203125,
0.06561279296875,
-0.0232086181640625,
-0.01029205322265625,
-0.00029468536376953125,
-0.0214691162109375,
-0.01325225830078125,
0.01934814453125,
0.0265655517578125,
-0.0308380126953125,
-0.0206756591796875,
0.044219970703125,
0.006725311279296875,
0.0794677734375,
-0.00015246868133544922,
-0.0433349609375,
-0.0205230712890625,
0.0035839080810546875,
-0.005123138427734375,
-0.031341552734375,
0.033660888671875,
-0.081298828125,
-0.03558349609375,
-0.020477294921875,
0.0159912109375,
0.02459716796875,
-0.02252197265625,
-0.062347412109375,
0.045654296875,
-0.01509857177734375,
-0.02178955078125,
-0.06683349609375,
0.005374908447265625,
0.0028057098388671875,
0.034759521484375,
-0.00431060791015625,
-0.0196990966796875,
-0.0295257568359375,
0.0237884521484375,
-0.0027446746826171875,
-0.024017333984375,
0.07757568359375,
-0.030792236328125,
-0.0014848709106445312,
-0.01690673828125,
0.0172576904296875,
-0.034454345703125,
0.036407470703125,
-0.01404571533203125,
0.0311279296875,
0.04571533203125,
-0.042388916015625,
-0.058135986328125,
-0.03131103515625,
-0.036468505859375,
-0.0231170654296875,
-0.04339599609375,
0.0023937225341796875,
-0.0125579833984375,
0.04864501953125,
0.0004367828369140625,
-0.0006642341613769531,
-0.0119171142578125,
0.01453399658203125,
-0.04571533203125,
-0.052490234375,
-0.0282745361328125,
0.019134521484375,
-0.08514404296875,
-0.025390625,
0.037139892578125,
0.007617950439453125,
0.00389862060546875,
-0.00829315185546875,
-0.0140533447265625,
-0.01377105712890625,
-0.0009388923645019531,
0.0031948089599609375,
-0.0543212890625,
0.03265380859375,
0.051849365234375,
-0.043670654296875,
-0.020538330078125,
-0.0028095245361328125,
-0.0101318359375,
0.00815582275390625,
-0.034759521484375,
-0.0238800048828125,
0.024932861328125,
-0.0018491744995117188,
0.0211181640625,
0.0020656585693359375,
-0.033843994140625,
-0.0215606689453125,
0.040924072265625,
-0.0018281936645507812,
0.0023288726806640625,
-0.006984710693359375,
0.00041985511779785156,
0.0125579833984375,
0.01165008544921875,
0.0067138671875,
0.01146697998046875,
-0.006011962890625,
-0.023345947265625,
-0.02081298828125,
0.01270294189453125,
-0.01641845703125,
0.002216339111328125,
-0.00504302978515625,
0.007228851318359375,
0.01177215576171875,
-0.0123748779296875,
-0.02117919921875,
0.0032939910888671875,
-0.0197601318359375,
-0.006744384765625,
-0.021209716796875,
0.00197601318359375
] |
3159ac9826107e224dbc4530c43e7913a7539b95
|
Wordpress Stackexchange
Q: qTranslate get content by language How do you get the content by id and by specific language?
I need to display two specific language content in a page, regardless of the session's language.
So far, this is my progress: this works fine for getting the content by id of the active language:
<?php $id=47; $post = get_page($id); $content = apply_filters('the_content', $post->post_content); echo $content; ?>
How to apply a specific language to the filter?
Thanks for the help. Sziro
A: You must use the qTranslate native functions to do your job. Use qtrans_use, that is the function that do all the job in qTranslate. It's defined in qtranslate_core.php, line 747
function qtrans_use($lang, $text, $show_available=false)
Use it on the raw content of the post!
Try this code:
<?php
$id=47; $post = get_page($id);
$content = qtrans_use('en', $post->post_content,false);
echo $content;
?>
In this example, it will return the English version of your text! Substitute it with the desired language identifier to translate into another language!
|
Q: qTranslate get content by language How do you get the content by id and by specific language?
I need to display two specific language content in a page, regardless of the session's language.
So far, this is my progress: this works fine for getting the content by id of the active language:
<?php $id=47; $post = get_page($id); $content = apply_filters('the_content', $post->post_content); echo $content; ?>
How to apply a specific language to the filter?
Thanks for the help. Sziro
A: You must use the qTranslate native functions to do your job. Use qtrans_use, that is the function that do all the job in qTranslate. It's defined in qtranslate_core.php, line 747
function qtrans_use($lang, $text, $show_available=false)
Use it on the raw content of the post!
Try this code:
<?php
$id=47; $post = get_page($id);
$content = qtrans_use('en', $post->post_content,false);
echo $content;
?>
In this example, it will return the English version of your text! Substitute it with the desired language identifier to translate into another language!
|
wordpress
|
{
"language": "en",
"length": 162,
"provenance": "stackexchange_00019.jsonl.gz:419908",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51946"
}
|
[
-0.0074310302734375,
-0.007236480712890625,
0.02557373046875,
0.043121337890625,
-0.009674072265625,
-0.025482177734375,
0.0491943359375,
-0.03466796875,
0.0273590087890625,
0.040008544921875,
-0.020111083984375,
-0.0269622802734375,
0.01070404052734375,
-0.01531982421875,
-0.0408935546875,
-0.0236053466796875,
0.0250396728515625,
-0.008697509765625,
0.01922607421875,
-0.01202392578125,
-0.0312042236328125,
-0.009735107421875,
0.0445556640625,
-0.0182952880859375,
0.03350830078125,
-0.0631103515625,
0.07464599609375,
-0.0211029052734375,
-0.0053558349609375,
-0.031951904296875,
0.0222015380859375,
0.026702880859375,
0.0271453857421875,
-0.0067901611328125,
-0.0031757354736328125,
-0.0294342041015625,
-0.01229095458984375,
-0.0142364501953125,
-0.03936767578125,
0.0350341796875,
0.00931549072265625,
-0.00511932373046875,
-0.0171356201171875,
0.05517578125,
-0.0226898193359375,
-0.045196533203125,
0.004100799560546875,
-0.02685546875,
0.00316619873046875,
0.06488037109375,
0.03155517578125,
0.01016998291015625,
0.022369384765625,
0.00824737548828125,
0.00846099853515625,
-0.007965087890625,
-0.031890869140625,
0.031890869140625,
0.035369873046875,
-0.0157623291015625,
-0.033172607421875,
-0.002185821533203125,
0.0101776123046875,
-0.0012407302856445312,
-0.01445770263671875,
0.0006608963012695312,
0.024627685546875,
0.00482177734375,
-0.05950927734375,
-0.035552978515625,
0.052642822265625,
-0.0209808349609375,
0.035888671875,
-0.0280914306640625,
-0.035064697265625,
0.006282806396484375,
-0.0267486572265625,
-0.0323486328125,
0.024871826171875,
-0.03936767578125,
0.0176239013671875,
0.021087646484375,
-0.00567626953125,
-0.0290069580078125,
0.0168304443359375,
-0.0184783935546875,
-0.01959228515625,
-0.01544952392578125,
-0.05096435546875,
-0.045257568359375,
-0.024078369140625,
-0.0333251953125,
-0.07373046875,
-0.004474639892578125,
0.00027871131896972656,
-0.045623779296875,
0.01100921630859375,
0.03594970703125,
-0.0267791748046875,
0.013671875,
-0.0063934326171875,
-0.04449462890625,
0.07177734375,
-0.0472412109375,
0.032318115234375,
-0.033843994140625,
-0.0112457275390625,
0.013641357421875,
0.0672607421875,
0.045135498046875,
-0.014190673828125,
0.084716796875,
-0.0068359375,
-0.01235198974609375,
-0.022979736328125,
0.04339599609375,
-0.022552490234375,
-0.005016326904296875,
-0.0022182464599609375,
0.0176544189453125,
0.0007171630859375,
0.004718780517578125,
0.0242462158203125,
-0.025238037109375,
0.0266876220703125,
0.0068359375,
-0.0241241455078125,
-0.01548004150390625,
0.00955963134765625,
0.0071868896484375,
-0.0194091796875,
-0.0026226043701171875,
0.05828857421875,
0.033294677734375,
-0.0045318603515625,
-0.00675201416015625,
-0.0032196044921875,
0.0298919677734375,
0.0303497314453125,
-0.019805908203125,
0.017578125,
-0.002391815185546875,
0.046905517578125,
0.031951904296875,
-0.050323486328125,
0.0042724609375,
0.02117919921875,
0.0199127197265625,
-0.036651611328125,
-0.080810546875,
0.031982421875,
-0.02593994140625,
0.03753662109375,
0.007293701171875,
-0.039764404296875,
-0.01629638671875,
0.02093505859375,
-0.0333251953125,
-0.0177001953125,
-0.051055908203125,
-0.0047607421875,
-0.0307464599609375,
-0.02081298828125,
0.01371002197265625,
-0.0042724609375,
0.01519775390625,
0.01959228515625,
0.0042877197265625,
0.016815185546875,
0.02716064453125,
0.0159454345703125,
0.003997802734375,
-0.0251617431640625,
-0.01593017578125,
-0.01776123046875,
-0.005504608154296875,
-0.03399658203125,
0.033355712890625,
0.002437591552734375,
0.011932373046875,
0.01690673828125,
-0.0301055908203125,
0.0256805419921875,
0.03558349609375,
-0.038818359375,
0.01499176025390625,
0.01340484619140625,
0.069580078125,
0.032806396484375,
0.01025390625,
-0.0156402587890625,
-0.0258331298828125,
-0.061126708984375,
-0.00249481201171875,
-0.012847900390625,
0.0138397216796875,
-0.0208587646484375,
0.019866943359375,
-0.0017213821411132812,
-0.0006814002990722656,
0.0552978515625,
-0.041778564453125,
0.0275115966796875,
0.0165252685546875,
-0.06109619140625,
-0.0021419525146484375,
-0.026275634765625,
-0.007404327392578125,
0.007274627685546875,
0.0041351318359375,
0.0199127197265625,
0.00823974609375,
-0.0232696533203125,
-0.036102294921875,
-0.03253173828125,
0.0291900634765625,
-0.0248260498046875,
0.00487518310546875,
0.00894927978515625,
0.00568389892578125,
0.0242919921875,
-0.0345458984375,
0.00634002685546875,
-0.0032806396484375,
0.0209197998046875,
0.01386260986328125,
-0.010955810546875,
0.000018358230590820312,
0.0399169921875,
0.0017852783203125,
0.037078857421875,
0.01898193359375,
0.0129852294921875,
0.01209259033203125,
-0.0179901123046875,
0.017181396484375,
0.0199737548828125,
-0.028594970703125,
-0.007049560546875,
0.0288848876953125,
0.048248291015625,
0.030364990234375,
0.0202484130859375,
-0.01366424560546875,
0.07025146484375,
-0.022796630859375,
0.0177154541015625,
-0.0311126708984375,
0.01116180419921875,
0.07000732421875,
-0.0043487548828125,
0.0066375732421875,
-0.001316070556640625,
-0.065185546875,
0.0104217529296875,
0.041748046875,
-0.033660888671875,
-0.0123291015625,
0.0087738037109375,
-0.01226043701171875,
0.0034332275390625,
-0.040008544921875,
-0.019866943359375,
-0.01107025146484375,
0.019073486328125,
0.003154754638671875,
0.01256561279296875,
-0.0016431808471679688,
-0.0196533203125,
0.00212860107421875,
0.0136566162109375,
0.0019445419311523438,
0.0216064453125,
0.0181732177734375,
-0.051849365234375,
-0.01248931884765625,
0.0189971923828125,
-0.011474609375,
0.018402099609375,
0.0017385482788085938,
0.031585693359375,
0.0697021484375,
0.0157318115234375,
-0.016448974609375,
0.02618408203125,
-0.01003265380859375,
-0.035980224609375,
-0.01532745361328125,
0.000004947185516357422,
-0.00543212890625,
-0.003513336181640625,
0.07489013671875,
0.005130767822265625,
0.03997802734375,
0.0168914794921875,
0.01788330078125,
0.0745849609375,
-0.031829833984375,
0.033660888671875,
-0.018707275390625,
0.057769775390625,
0.055419921875,
-0.0178985595703125,
-0.002414703369140625,
0.0217742919921875,
-0.0064849853515625,
0.037689208984375,
-0.00533294677734375,
0.01082611083984375,
0.045806884765625,
-0.054595947265625,
0.0328369140625,
0.005706787109375,
0.024993896484375,
-0.050811767578125,
-0.06268310546875,
-0.041046142578125,
-0.021209716796875,
-0.1405029296875,
-0.070068359375,
0.01934814453125,
-0.0255584716796875,
-0.01404571533203125,
0.017974853515625,
-0.0208740234375,
-0.0084075927734375,
0.032012939453125,
-0.01336669921875,
0.0036411285400390625,
0.00031280517578125,
-0.04266357421875,
-0.00830841064453125,
-0.042816162109375,
0.0189056396484375,
-0.0158843994140625,
-0.0009074211120605469,
0.01488494873046875,
-0.0394287109375,
-0.0040283203125,
-0.0229339599609375,
0.0237884521484375,
0.07958984375,
-0.0198974609375,
-0.0089263916015625,
0.005321502685546875,
-0.044342041015625,
-0.0018978118896484375,
0.00009703636169433594,
0.00734710693359375,
0.01071929931640625,
0.003978729248046875,
0.006557464599609375,
-0.0018138885498046875,
0.058349609375,
0.059906005859375,
-0.0654296875,
-0.0212554931640625,
0.08148193359375,
0.0234832763671875,
-0.0039215087890625,
-0.033050537109375,
-0.01177978515625,
-0.05133056640625,
0.01715087890625,
0.05792236328125,
-0.01384735107421875,
-0.03314208984375,
0.00864410400390625,
-0.0088958740234375,
-0.005710601806640625,
0.0308380126953125,
-0.037078857421875,
0.042510986328125,
-0.00028777122497558594,
-0.0019626617431640625,
0.000014483928680419922,
0.023712158203125,
-0.001888275146484375,
0.00972747802734375,
0.016693115234375,
0.03411865234375,
0.006389617919921875,
-0.002521514892578125,
0.004779815673828125,
-0.048828125,
0.05670166015625,
0.0118560791015625,
0.00226593017578125,
0.00502777099609375,
-0.0472412109375,
0.00827789306640625,
0.08245849609375,
-0.0199737548828125,
-0.00748443603515625,
-0.0428466796875,
0.001232147216796875,
-0.0185089111328125,
-0.029205322265625,
-0.0181121826171875,
0.00922393798828125,
-0.033599853515625,
-0.006591796875,
-0.0240631103515625,
-0.0014791488647460938,
-0.0131683349609375,
0.000133514404296875,
0.01161956787109375,
-0.029022216796875,
0.05535888671875,
-0.0134429931640625,
-0.00543975830078125,
0.0179443359375,
-0.0162506103515625,
0.00513458251953125,
-0.05950927734375,
0.0207061767578125,
-0.049774169921875,
0.0002617835998535156,
-0.01378631591796875,
0.0255584716796875,
0.01506805419921875,
-0.028106689453125,
-0.02008056640625,
0.02874755859375,
0.01555633544921875,
0.050537109375,
-0.0290679931640625,
-0.0187530517578125,
0.047698974609375,
-0.0134124755859375,
-0.010009765625,
-0.00605010986328125,
-0.0198211669921875,
0.0196380615234375,
0.0014333724975585938,
0.083251953125,
-0.0195770263671875,
-0.0024471282958984375,
-0.0016603469848632812,
-0.035858154296875,
-0.08514404296875,
-0.0122528076171875,
-0.00775909423828125,
-0.01497650146484375,
-0.0012292861938476562,
-0.0164642333984375,
-0.0158538818359375,
-0.0792236328125,
0.0731201171875,
0.0413818359375,
-0.006336212158203125,
-0.021453857421875,
0.053375244140625,
0.006877899169921875,
-0.0670166015625,
-0.052520751953125,
0.00485992431640625,
0.04034423828125,
0.0028514862060546875,
0.06610107421875,
0.0303192138671875,
-0.04156494140625,
0.1307373046875,
0.02740478515625,
-0.0018749237060546875,
0.035491943359375,
0.0204620361328125,
-0.00007957220077514648,
-0.0223388671875,
0.02423095703125,
-0.01324462890625,
-0.032623291015625,
0.033782958984375,
-0.01837158203125,
-0.006565093994140625,
0.009002685546875,
0.0290069580078125,
-0.035064697265625,
0.039825439453125,
-0.00435638427734375,
-0.04803466796875,
0.034027099609375,
0.01291656494140625,
-0.0301361083984375,
-0.0199127197265625,
0.01308441162109375,
-0.016571044921875,
0.01094818115234375,
0.0231170654296875,
0.08380126953125,
0.035919189453125,
0.021148681640625,
0.049896240234375,
0.04296875,
-0.004009246826171875,
0.04107666015625,
-0.0135040283203125,
0.02423095703125,
-0.00496673583984375,
-0.042999267578125,
0.03814697265625,
-0.00836944580078125,
-0.005435943603515625,
0.054718017578125,
0.0286102294921875,
-0.00917816162109375,
0.0016279220581054688,
-0.01513671875,
0.00815582275390625,
0.059356689453125,
0.01464080810546875,
-0.00865936279296875,
-0.0100250244140625,
-0.0176239013671875,
-0.0028018951416015625,
-0.04150390625,
0.086181640625,
-0.0755615234375,
0.03692626953125,
0.00809478759765625,
-0.0038661956787109375,
0.039398193359375,
0.01508331298828125,
0.03192138671875,
-0.029205322265625,
-0.0204315185546875,
0.01020050048828125,
0.007648468017578125,
-0.0053558349609375,
0.030120849609375,
0.0295257568359375,
0.03497314453125,
-0.023651123046875,
-0.01267242431640625,
0.0027713775634765625,
-0.04693603515625,
-0.006252288818359375,
0.035858154296875,
0.04681396484375,
-0.0228424072265625,
-0.00910186767578125,
-0.0253143310546875,
-0.01806640625,
0.004863739013671875,
0.00730133056640625,
0.027496337890625,
-0.01806640625,
-0.01276397705078125,
0.04864501953125,
-0.027862548828125,
-0.0159759521484375,
-0.0072021484375,
0.050750732421875,
-0.034271240234375,
-0.03570556640625,
-0.012176513671875,
0.024139404296875,
-0.00809478759765625,
0.026458740234375,
0.01528167724609375,
0.0055999755859375,
0.0269775390625,
0.0070037841796875,
-0.037384033203125,
0.0155029296875,
0.0208282470703125,
0.016998291015625,
-0.01800537109375,
0.00632476806640625,
-0.02215576171875,
-0.038726806640625,
-0.012969970703125,
-0.01306915283203125,
-0.040496826171875,
-0.01324462890625,
-0.0117340087890625,
0.01702880859375,
0.004241943359375,
0.0190887451171875,
0.004932403564453125,
-0.02545166015625,
0.046966552734375,
0.0169677734375,
0.0340576171875,
0.0000940561294555664,
0.0732421875,
-0.02838134765625,
0.0445556640625,
0.0201873779296875,
0.054718017578125,
-0.025360107421875,
-0.0167083740234375,
-0.006591796875,
-0.0197296142578125,
0.003681182861328125,
0.016143798828125,
-0.01332855224609375,
-0.032073974609375,
0.01120758056640625,
0.01065826416015625,
0.009124755859375,
-0.02545166015625,
0.0007696151733398438,
-0.0163116455078125,
0.00807952880859375,
-0.035491943359375,
-0.0019311904907226562,
0.0257720947265625,
-0.051116943359375,
-0.026214599609375,
0.0062408447265625,
0.0245819091796875,
-0.00801849365234375,
-0.037078857421875,
-0.00958251953125,
0.04742431640625,
0.03497314453125,
-0.00798797607421875,
0.052978515625,
0.0253448486328125,
0.0638427734375,
0.0355224609375,
0.04150390625,
0.0264129638671875,
0.003185272216796875,
0.011749267578125,
0.007205963134765625,
0.01520538330078125,
-0.0219879150390625,
0.000736236572265625,
-0.0204620361328125,
-0.0096588134765625,
-0.0025806427001953125,
0.057647705078125,
0.0380859375,
-0.07763671875,
0.00859832763671875,
0.0234375,
-0.005115509033203125,
-0.05670166015625,
-0.0110626220703125,
-0.04132080078125,
-0.03857421875,
0.056365966796875,
-0.00899505615234375,
-0.036956787109375,
0.0142669677734375,
0.01427459716796875,
-0.023223876953125,
-0.017059326171875,
0.0256805419921875,
0.017486572265625,
0.025543212890625,
-0.005786895751953125,
-0.0079803466796875,
0.011749267578125,
-0.046875,
-0.0120086669921875,
0.005901336669921875,
-0.0106353759765625,
-0.0736083984375,
0.01171875,
-0.0221710205078125,
0.034759521484375,
0.0021419525146484375,
-0.01245880126953125,
-0.00017893314361572266,
0.06402587890625,
-0.0443115234375,
0.01432037353515625,
0.043853759765625,
-0.0265045166015625,
0.001903533935546875,
0.0107269287109375,
0.01052093505859375,
0.01186370849609375,
-0.036956787109375,
0.0016717910766601562,
-0.0440673828125,
0.00908660888671875,
-0.00844573974609375,
-0.049560546875,
0.0286407470703125,
-0.02850341796875,
0.0045623779296875,
0.0286407470703125,
0.0218353271484375,
-0.004299163818359375,
0.002002716064453125,
0.026947021484375,
-0.049591064453125,
-0.03436279296875,
0.01690673828125,
-0.032562255859375,
-0.025299072265625,
0.00836181640625,
-0.062744140625,
0.041229248046875,
0.0196380615234375,
0.0270538330078125,
-0.01367950439453125,
0.010772705078125,
-0.014892578125,
-0.025115966796875,
-0.029571533203125,
0.040740966796875,
0.00591278076171875,
0.010498046875,
-0.05096435546875,
-0.01120758056640625,
-0.003631591796875,
0.031463623046875,
0.007701873779296875,
0.00267791748046875,
-0.02972412109375,
-0.0244293212890625,
-0.010223388671875,
0.06903076171875,
0.02935791015625,
0.006977081298828125,
-0.00836944580078125,
0.048431396484375,
0.05426025390625,
-0.10064697265625,
-0.001071929931640625,
-0.003482818603515625,
0.003124237060546875,
0.0201263427734375,
0.0158538818359375,
-0.009063720703125,
0.04510498046875,
0.01148223876953125,
-0.0537109375,
0.02398681640625,
0.03033447265625,
-0.01200103759765625,
0.0256805419921875,
0.0011339187622070312,
0.0616455078125,
-0.0662841796875,
-0.0116424560546875,
-0.025115966796875,
0.058746337890625,
0.03558349609375,
0.0692138671875,
0.04937744140625,
0.035369873046875,
0.07757568359375,
-0.0093231201171875,
0.046234130859375,
-0.0171051025390625,
-0.01751708984375,
0.046234130859375,
0.040069580078125,
0.03912353515625,
0.0114898681640625,
0.0391845703125,
-0.0240936279296875,
0.03521728515625,
-0.048126220703125,
-0.0294342041015625,
0.0114898681640625,
-0.024169921875,
0.006740570068359375,
0.007114410400390625,
0.005374908447265625,
0.0139617919921875,
0.0266265869140625,
0.0137481689453125,
-0.007038116455078125,
0.01116180419921875,
0.023895263671875,
-0.002773284912109375,
-0.01503753662109375,
-0.0048980712890625,
0.037109375,
-0.07025146484375,
0.04864501953125,
0.055450439453125,
0.0650634765625,
-0.02215576171875,
0.1044921875,
-0.001972198486328125,
-0.02447509765625,
0.035064697265625,
0.003021240234375,
-0.024383544921875,
-0.021881103515625,
-0.003070831298828125,
-0.053192138671875,
-0.009979248046875,
0.016510009765625,
0.005126953125,
-0.06793212890625,
0.0159454345703125,
0.038116455078125,
-0.0181427001953125,
-0.03826904296875,
-0.025726318359375,
-0.0013055801391601562,
0.019134521484375,
-0.046417236328125,
0.01416778564453125,
-0.01349639892578125,
-0.0186614990234375,
-0.0028820037841796875,
0.0107879638671875,
0.00876617431640625,
-0.005924224853515625,
0.08551025390625,
-0.002956390380859375,
-0.022857666015625,
0.0026760101318359375,
-0.04229736328125,
0.07855224609375,
0.004650115966796875,
-0.046417236328125,
0.03277587890625,
-0.048431396484375,
-0.07403564453125,
0.03302001953125,
0.04779052734375,
0.01500701904296875,
-0.013275146484375,
0.006206512451171875,
0.006114959716796875,
0.00563812255859375,
-0.028564453125,
0.041107177734375,
0.036468505859375,
0.0034770965576171875,
0.0318603515625,
-0.0023059844970703125,
-0.027679443359375,
0.006687164306640625,
0.06207275390625,
0.01476287841796875,
-0.006870269775390625,
0.011810302734375,
0.043975830078125,
-0.037200927734375,
0.0029239654541015625,
-0.03173828125,
-0.031280517578125,
0.05108642578125,
0.03387451171875,
-0.00170135498046875,
-0.0229644775390625,
-0.005062103271484375,
0.0230255126953125,
0.0137939453125,
-0.0120391845703125,
0.0149993896484375,
-0.03240966796875,
0.00899505615234375,
0.00870513916015625,
0.003978729248046875,
-0.043487548828125,
-0.031005859375,
-0.07318115234375,
-0.0285186767578125,
0.05767822265625,
0.048675537109375,
0.0138702392578125,
0.006603240966796875,
-0.03765869140625,
-0.03424072265625,
0.0281524658203125,
-0.0312042236328125,
0.0063934326171875,
0.024871826171875,
-0.0262298583984375,
-0.0248870849609375,
0.004016876220703125,
-0.01096343994140625,
0.00301361083984375,
0.022308349609375,
0.03765869140625,
0.00859832763671875,
0.0226898193359375,
-0.002368927001953125,
-0.016510009765625,
0.0298614501953125,
-0.015869140625,
0.0013065338134765625,
0.01041412353515625,
0.0087432861328125,
-0.0209808349609375,
-0.013671875,
-0.00420379638671875,
-0.006504058837890625,
-0.0048065185546875,
0.0193328857421875,
0.019012451171875,
0.005615234375,
-0.00911712646484375,
0.00762176513671875,
-0.0126953125,
-0.022308349609375,
-0.01467132568359375,
-0.005084991455078125,
-0.01235198974609375,
0.0189361572265625,
-0.059295654296875,
0.04010009765625,
0.00501251220703125,
0.0214691162109375,
-0.066650390625,
0.016754150390625,
-0.0186004638671875,
-0.0265655517578125,
-0.0072479248046875,
-0.0013370513916015625,
0.0030975341796875,
0.01163482666015625,
-0.01219940185546875,
0.0390625,
0.0018491744995117188,
0.0640869140625,
-0.00858306884765625,
-0.01904296875,
0.042205810546875,
-0.02471923828125,
-0.02093505859375,
-0.043182373046875,
0.0271453857421875,
-0.0751953125,
-0.025421142578125,
-0.0101470947265625,
0.0024433135986328125,
0.0188446044921875,
-0.0282440185546875,
-0.083740234375,
0.0618896484375,
-0.020233154296875,
-0.033538818359375,
-0.0269317626953125,
0.02276611328125,
0.00807952880859375,
-0.035430908203125,
-0.01849365234375,
-0.0294036865234375,
-0.0096282958984375,
0.0035152435302734375,
0.001354217529296875,
0.039581298828125,
0.0433349609375,
0.0100555419921875,
-0.02105712890625,
-0.03009033203125,
-0.031402587890625,
-0.0159759521484375,
-0.005092620849609375,
-0.0194244384765625,
0.0160369873046875,
-0.01251983642578125,
-0.06390380859375,
-0.052642822265625,
0.0151214599609375,
0.07781982421875,
-0.0198211669921875,
-0.06805419921875,
0.00921630859375,
-0.00360870361328125,
0.041656494140625,
0.01326751708984375,
0.0010614395141601562,
-0.038543701171875,
0.060302734375,
0.0143280029296875,
-0.0260467529296875,
0.004238128662109375,
0.0081634521484375,
-0.0255126953125,
-0.028839111328125,
-0.00531768798828125,
-0.01485443115234375,
0.0250701904296875,
0.005245208740234375,
-0.0283050537109375,
0.00452423095703125,
-0.003936767578125,
-0.01222991943359375,
-0.035125732421875,
0.012176513671875,
0.08154296875,
-0.0426025390625,
0.0021343231201171875,
0.023681640625,
-0.01110076904296875,
0.04486083984375,
0.0191802978515625,
-0.002410888671875,
0.004413604736328125,
0.0281524658203125,
0.00569915771484375,
0.035919189453125,
-0.021881103515625,
0.048614501953125,
-0.0018281936645507812,
-0.0391845703125,
0.0328369140625,
0.0247650146484375,
0.043792724609375,
-0.0182037353515625,
-0.0226593017578125,
0.0303192138671875,
-0.018035888671875,
-0.01129150390625,
0.004364013671875,
-0.004779815673828125,
0.01395416259765625,
-0.03326416015625,
0.006481170654296875,
-0.01324462890625,
-0.02874755859375,
0.007419586181640625,
-0.00732421875,
-0.0264129638671875,
-0.0321044921875,
0.01751708984375,
-0.010528564453125,
-0.032501220703125,
0.01910400390625
] |
0eee709e9468ce562bd291e9da8ac0b5e02f8296
|
Wordpress Stackexchange
Q: Disable the post save process completely I need a way to disable the save process completely using an action/filter. Something that works (for e.g.:) in the query, posts_clauses or wp_insert_post/save_post/update_post hooks.
So far I only tried to return '';, which gives me tons of errors for missing values for post object parts in the admin UI.
This should happen "silently", so no errors get thrown when php_error/WP_DEBUG and such are set to TRUE/On.
Btw: I'm not asking for how to disable the autosave feature.
A: function disable_save( $maybe_empty, $postarr ) {
$maybe_empty = true;
return $maybe_empty;
}
add_filter( 'wp_insert_post_empty_content', 'disable_save', 999999, 2 );
Because wp_insert_post_empty_content is set to true, WordPress thinks there is no title and no content and stops updating the post.
EDIT: An even shorter variant would be:
add_filter( 'wp_insert_post_empty_content', '__return_true', PHP_INT_MAX -1, 2 );
|
Q: Disable the post save process completely I need a way to disable the save process completely using an action/filter. Something that works (for e.g.:) in the query, posts_clauses or wp_insert_post/save_post/update_post hooks.
So far I only tried to return '';, which gives me tons of errors for missing values for post object parts in the admin UI.
This should happen "silently", so no errors get thrown when php_error/WP_DEBUG and such are set to TRUE/On.
Btw: I'm not asking for how to disable the autosave feature.
A: function disable_save( $maybe_empty, $postarr ) {
$maybe_empty = true;
return $maybe_empty;
}
add_filter( 'wp_insert_post_empty_content', 'disable_save', 999999, 2 );
Because wp_insert_post_empty_content is set to true, WordPress thinks there is no title and no content and stops updating the post.
EDIT: An even shorter variant would be:
add_filter( 'wp_insert_post_empty_content', '__return_true', PHP_INT_MAX -1, 2 );
A: The reason you get notices for stopping inserts with the wp_insert_post_empty_content filter as mentioned in your comment at the https://wordpress.stackexchange.com/a/51980/31794 answer, is that: For post-new.php the auto-draft process needs to get a $post->ID through get_default_post_to_edit() and wp_insert_post(), and use that ID from the $post return.
i.e. The 'Add New Post' pages actually creates and gets a new 'post record' every time.
Sadly wp_insert_post() return 0 if you stop the save process instead of an expected post ID. In other words, you can't stop 'Auto drafts' with the 'wp_insert_post_empty_content' filter. And should you use the filter, you sadly must let "auto-drafts pass through to avoid the PHP Notice. It's a pretty bad bug.
The only way I have found left to stop creating new auto-draft records pointlessly and go around this bug is, to extend the wpdb class with a db.php Drop-in plugin:
class wpdb_ext extends wpdb
{
function insert($table, $data, $format = null) {
if (isset($data['post_status']) && $data['post_status'] === "auto-draft" && ($pa = (int)$data['post_author'])
&& ($id = $this->get_var("SELECT ID FROM $table WHERE post_status = 'auto-draft' AND post_author = $pa LIMIT 1"))){
//fake insert id and return id of existing auto-draft as base for New post page.
return $this->insert_id = (int)$id;
}
return parent::insert($table, $data, $format = null);//else do actual insert
}
}
$wpdb = new wpdb_ext(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);//overload wpdb
This keeps only one auto-draft per author, and avoids pointless new auto-draft(s) records wasting/skipping id increments for nothing.
|
wordpress
|
{
"language": "en",
"length": 377,
"provenance": "stackexchange_00019.jsonl.gz:419915",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51971"
}
|
[
0.08087158203125,
0.0009794235229492188,
0.031494140625,
-0.006641387939453125,
0.01335906982421875,
-0.03656005859375,
0.07611083984375,
-0.048370361328125,
0.032958984375,
0.005268096923828125,
-0.02099609375,
-0.038818359375,
0.048583984375,
-0.050140380859375,
0.021331787109375,
-0.0085601806640625,
0.025787353515625,
-0.020172119140625,
0.0170745849609375,
-0.026214599609375,
0.01125335693359375,
-0.0166778564453125,
0.03564453125,
0.003711700439453125,
0.0200958251953125,
0.03802490234375,
0.032196044921875,
-0.0191192626953125,
0.0252838134765625,
0.0031528472900390625,
0.0235748291015625,
-0.0443115234375,
0.00984954833984375,
0.027801513671875,
-0.036865234375,
-0.026153564453125,
-0.00820159912109375,
0.0166168212890625,
0.0134735107421875,
-0.0021724700927734375,
0.0282135009765625,
-0.0219573974609375,
-0.0284881591796875,
-0.01343536376953125,
-0.030731201171875,
0.002422332763671875,
0.0196685791015625,
-0.0081329345703125,
0.042205810546875,
-0.01175689697265625,
-0.010894775390625,
0.03448486328125,
0.00867462158203125,
-0.0286407470703125,
-0.0210113525390625,
-0.01374053955078125,
-0.02374267578125,
0.0135040283203125,
0.045989990234375,
0.038848876953125,
-0.0260772705078125,
-0.0330810546875,
-0.01216888427734375,
-0.07806396484375,
0.03790283203125,
-0.011199951171875,
0.0079803466796875,
0.0369873046875,
-0.0877685546875,
0.042633056640625,
0.068115234375,
-0.0806884765625,
0.0005435943603515625,
0.0003306865692138672,
0.005970001220703125,
-0.0042877197265625,
0.0191802978515625,
0.01317596435546875,
-0.0009679794311523438,
0.01934814453125,
0.01184844970703125,
-0.00600433349609375,
0.0176239013671875,
-0.027587890625,
0.005252838134765625,
-0.003467559814453125,
-0.006404876708984375,
-0.0026226043701171875,
-0.0260772705078125,
-0.0311279296875,
-0.0182342529296875,
-0.00933837890625,
-0.0362548828125,
-0.016571044921875,
0.001861572265625,
-0.044464111328125,
0.0090789794921875,
0.01702880859375,
-0.0104522705078125,
-0.009307861328125,
0.01273345947265625,
-0.0343017578125,
0.0221405029296875,
-0.0199737548828125,
0.00539398193359375,
0.044769287109375,
-0.00653839111328125,
-0.0701904296875,
0.003665924072265625,
0.020782470703125,
0.000007450580596923828,
-0.034423828125,
-0.01251983642578125,
0.004947662353515625,
-0.033966064453125,
0.0081634521484375,
-0.05023193359375,
0.037078857421875,
0.006351470947265625,
0.05291748046875,
0.0025787353515625,
0.021453857421875,
-0.038177490234375,
0.0160675048828125,
0.01503753662109375,
-0.0010328292846679688,
-0.00731658935546875,
0.01363372802734375,
0.0293426513671875,
-0.00815582275390625,
-0.051483154296875,
0.0016117095947265625,
0.12744140625,
0.06707763671875,
0.054718017578125,
-0.01910400390625,
-0.0298919677734375,
-0.02294921875,
-0.0108642578125,
0.00244140625,
0.0204925537109375,
-0.04095458984375,
0.00012731552124023438,
0.0129241943359375,
-0.0005431175231933594,
0.003391265869140625,
0.01329803466796875,
0.03912353515625,
0.01250457763671875,
-0.027801513671875,
-0.008392333984375,
0.0031642913818359375,
0.02496337890625,
0.0212860107421875,
-0.01410675048828125,
-0.0252838134765625,
0.014404296875,
-0.0252227783203125,
-0.0042266845703125,
-0.048431396484375,
0.004619598388671875,
0.0015544891357421875,
0.018524169921875,
-0.01154327392578125,
-0.046661376953125,
-0.003948211669921875,
-0.00911712646484375,
-0.00399017333984375,
0.01543426513671875,
0.01715087890625,
-0.021942138671875,
0.01001739501953125,
0.0150146484375,
-0.01184844970703125,
-0.01358795166015625,
0.0023345947265625,
0.0164337158203125,
-0.051666259765625,
0.011199951171875,
0.0307769775390625,
-0.0300750732421875,
-0.0259246826171875,
0.00594329833984375,
-0.0121307373046875,
-0.039215087890625,
0.042449951171875,
0.011016845703125,
0.040496826171875,
-0.01142120361328125,
0.008941650390625,
0.0079498291015625,
0.036834716796875,
-0.0214691162109375,
0.0002353191375732422,
0.032928466796875,
-0.040802001953125,
-0.043426513671875,
-0.046356201171875,
0.00760650634765625,
0.013153076171875,
0.02593994140625,
0.003421783447265625,
-0.02630615234375,
-0.019256591796875,
-0.1302490234375,
-0.0259857177734375,
-0.02734375,
0.0296783447265625,
-0.047119140625,
0.03118896484375,
0.044403076171875,
0.0007152557373046875,
-0.051177978515625,
0.0296173095703125,
0.001216888427734375,
-0.0369873046875,
-0.0306396484375,
0.0139923095703125,
-0.0052947998046875,
0.036956787109375,
-0.0191497802734375,
0.007808685302734375,
-0.00920867919921875,
-0.0234527587890625,
0.0587158203125,
-0.03729248046875,
0.0022449493408203125,
-0.0294036865234375,
0.045623779296875,
-0.0302276611328125,
-0.0080718994140625,
0.05780029296875,
0.00921630859375,
-0.01442718505859375,
-0.048858642578125,
-0.01255035400390625,
-0.057525634765625,
-0.07080078125,
-0.021942138671875,
0.0843505859375,
0.0294342041015625,
0.0164337158203125,
-0.0157012939453125,
0.0267486572265625,
0.01690673828125,
-0.051055908203125,
-0.00714874267578125,
0.0204010009765625,
0.027130126953125,
0.050384521484375,
-0.00888824462890625,
0.00791168212890625,
0.0268707275390625,
-0.05328369140625,
0.0264892578125,
0.03912353515625,
-0.03143310546875,
0.001949310302734375,
0.0168914794921875,
-0.0136871337890625,
-0.0034236907958984375,
-0.032012939453125,
0.0223236083984375,
-0.039794921875,
0.0257720947265625,
0.01222991943359375,
0.028717041015625,
0.0248260498046875,
-0.0252838134765625,
0.022430419921875,
0.01013946533203125,
-0.04779052734375,
-0.0026531219482421875,
0.036285400390625,
0.0372314453125,
-0.02880859375,
-0.052764892578125,
0.0038967132568359375,
-0.005641937255859375,
0.017120361328125,
-0.03485107421875,
0.00688934326171875,
0.0289306640625,
-0.00778961181640625,
0.0131988525390625,
-0.072265625,
0.027069091796875,
-0.051177978515625,
-0.055450439453125,
-0.033111572265625,
-0.00824737548828125,
0.0152130126953125,
-0.040374755859375,
0.0104217529296875,
0.02923583984375,
-0.009765625,
-0.0233612060546875,
-0.043701171875,
0.021087646484375,
-0.0258026123046875,
0.063720703125,
0.06976318359375,
-0.005901336669921875,
0.014739990234375,
0.0236663818359375,
-0.0042572021484375,
0.00829315185546875,
0.0213165283203125,
0.007183074951171875,
0.02789306640625,
-0.0809326171875,
0.0011539459228515625,
0.0272674560546875,
0.0682373046875,
-0.01169586181640625,
-0.031097412109375,
0.01123809814453125,
0.041778564453125,
-0.016754150390625,
-0.0279693603515625,
-0.0254058837890625,
-0.040802001953125,
-0.0296478271484375,
0.020172119140625,
-0.0275115966796875,
0.0031795501708984375,
0.04583740234375,
0.006378173828125,
-0.04534912109375,
-0.008087158203125,
-0.016876220703125,
-0.0186614990234375,
0.0005474090576171875,
0.0271148681640625,
-0.0036640167236328125,
-0.004486083984375,
0.01241302490234375,
0.143798828125,
0.0269012451171875,
-0.06829833984375,
-0.0092010498046875,
-0.04437255859375,
-0.052978515625,
0.022125244140625,
-0.0289764404296875,
0.00859832763671875,
0.030731201171875,
-0.000591278076171875,
-0.037689208984375,
-0.005535125732421875,
0.0309295654296875,
-0.034271240234375,
0.01006317138671875,
-0.0202484130859375,
0.009521484375,
0.03680419921875,
-0.006885528564453125,
0.011871337890625,
0.035614013671875,
-0.034454345703125,
-0.0535888671875,
-0.0273284912109375,
-0.09063720703125,
0.0004911422729492188,
0.06500244140625,
0.0121307373046875,
-0.00569915771484375,
-0.008087158203125,
-0.01343536376953125,
-0.01377105712890625,
0.003551483154296875,
-0.0190582275390625,
0.0243072509765625,
0.0035762786865234375,
0.011077880859375,
0.005275726318359375,
0.049072265625,
-0.0033321380615234375,
0.0318603515625,
0.0232696533203125,
0.0202484130859375,
0.0154876708984375,
-0.034271240234375,
-0.027313232421875,
-0.035980224609375,
0.024871826171875,
-0.061798095703125,
0.01557159423828125,
-0.060546875,
0.0050506591796875,
-0.03729248046875,
0.04833984375,
-0.0085296630859375,
-0.006072998046875,
-0.034820556640625,
-0.0033092498779296875,
-0.007427215576171875,
-0.06634521484375,
-0.005126953125,
-0.0018167495727539062,
0.00102996826171875,
0.00785064697265625,
-0.02972412109375,
0.006282806396484375,
-0.0109405517578125,
-0.07379150390625,
0.0203704833984375,
-0.026641845703125,
0.03662109375,
-0.059906005859375,
0.006999969482421875,
0.0208587646484375,
-0.0193328857421875,
-0.0097198486328125,
-0.0364990234375,
-0.0227203369140625,
-0.10711669921875,
-0.01076507568359375,
-0.013519287109375,
0.041534423828125,
-0.0282135009765625,
0.048370361328125,
-0.023956298828125,
0.04095458984375,
0.02581787109375,
0.0200347900390625,
0.032501220703125,
0.006656646728515625,
0.014129638671875,
-0.01058197021484375,
0.03472900390625,
-0.043243408203125,
-0.0225067138671875,
-0.00807952880859375,
0.008514404296875,
0.03106689453125,
-0.0433349609375,
-0.027191162109375,
-0.01690673828125,
-0.0237579345703125,
-0.044158935546875,
-0.033233642578125,
-0.050445556640625,
-0.007755279541015625,
-0.03326416015625,
-0.00763702392578125,
-0.03472900390625,
-0.0653076171875,
0.056976318359375,
-0.0008192062377929688,
0.0142364501953125,
-0.01123046875,
0.103515625,
0.01349639892578125,
-0.01259613037109375,
-0.01947021484375,
0.01052093505859375,
0.013702392578125,
-0.0179290771484375,
0.0120697021484375,
-0.01262664794921875,
-0.0168914794921875,
0.0236663818359375,
-0.0244293212890625,
-0.0011272430419921875,
-0.05413818359375,
0.067626953125,
-0.019927978515625,
-0.0013141632080078125,
0.005435943603515625,
-0.0465087890625,
0.062408447265625,
0.0643310546875,
-0.00661468505859375,
-0.0235748291015625,
-0.0223541259765625,
0.0418701171875,
-0.01247406005859375,
0.0016469955444335938,
-0.0517578125,
-0.019134521484375,
0.0129241943359375,
0.014434814453125,
0.00005042552947998047,
0.017730712890625,
-0.0013332366943359375,
-0.002422332763671875,
0.013031005859375,
-0.016204833984375,
-0.0033016204833984375,
0.0265350341796875,
-0.0057830810546875,
0.0296478271484375,
-0.0045013427734375,
-0.0181884765625,
-0.0302276611328125,
0.0008068084716796875,
-0.024169921875,
-0.0155792236328125,
-0.053253173828125,
-0.0291900634765625,
0.01132965087890625,
0.05108642578125,
0.01430511474609375,
-0.0070648193359375,
0.022369384765625,
0.0234375,
-0.00597381591796875,
0.00421905517578125,
0.0026760101318359375,
0.0146026611328125,
-0.034515380859375,
0.0017309188842773438,
0.037933349609375,
-0.035858154296875,
0.007549285888671875,
-0.0017557144165039062,
0.04583740234375,
-0.0274505615234375,
-0.0209197998046875,
0.04150390625,
0.0474853515625,
0.01493072509765625,
0.017791748046875,
0.0090789794921875,
0.00057220458984375,
-0.00079345703125,
0.005146026611328125,
-0.0298004150390625,
-0.005016326904296875,
0.0110626220703125,
0.0108489990234375,
-0.018829345703125,
-0.032012939453125,
0.048492431640625,
-0.008636474609375,
0.006237030029296875,
0.04046630859375,
0.037750244140625,
-0.040618896484375,
-0.0121002197265625,
-0.001659393310546875,
-0.0003345012664794922,
-0.036163330078125,
0.01702880859375,
-0.0160064697265625,
-0.0008473396301269531,
-0.019134521484375,
0.03302001953125,
-0.0323486328125,
-0.03521728515625,
-0.0151519775390625,
-0.01007080078125,
-0.05047607421875,
-0.007244110107421875,
0.0236968994140625,
0.037994384765625,
-0.0330810546875,
-0.0300750732421875,
0.04241943359375,
-0.0264434814453125,
0.02923583984375,
-0.016876220703125,
0.0038013458251953125,
0.055877685546875,
0.02618408203125,
0.040557861328125,
0.004100799560546875,
0.002323150634765625,
-0.0256805419921875,
-0.054412841796875,
-0.048858642578125,
-0.0225372314453125,
-0.031707763671875,
-0.048248291015625,
0.0003390312194824219,
-0.0012598037719726562,
0.0207672119140625,
-0.0137176513671875,
-0.02288818359375,
0.0004169940948486328,
-0.002471923828125,
-0.0098114013671875,
0.0225372314453125,
-0.0307464599609375,
0.10528564453125,
-0.0184173583984375,
0.055419921875,
-0.00196075439453125,
0.041107177734375,
-0.020111083984375,
-0.006618499755859375,
0.0034923553466796875,
-0.04205322265625,
-0.0232391357421875,
-0.0145111083984375,
-0.00760650634765625,
0.036102294921875,
0.042510986328125,
-0.00299835205078125,
-0.0017452239990234375,
-0.01140594482421875,
0.01001739501953125,
-0.024383544921875,
0.0017042160034179688,
-0.0038700103759765625,
-0.0129547119140625,
0.013671875,
-0.0283660888671875,
-0.045654296875,
-0.006366729736328125,
-0.0218505859375,
0.04827880859375,
-0.002216339111328125,
0.008270263671875,
-0.0103759765625,
0.00513458251953125,
-0.0052032470703125,
-0.0002930164337158203,
0.020721435546875,
0.043701171875,
-0.016632080078125,
0.05035400390625,
0.01160430908203125,
0.02862548828125,
-0.0176239013671875,
-0.0281524658203125,
0.057464599609375,
0.0212554931640625,
-0.025115966796875,
0.027191162109375,
-0.0247802734375,
0.03558349609375,
0.07171630859375,
0.092529296875,
-0.0870361328125,
0.0185089111328125,
0.045654296875,
-0.0158233642578125,
0.0306243896484375,
-0.0269317626953125,
0.0072784423828125,
-0.027313232421875,
0.0418701171875,
-0.021697998046875,
-0.034576416015625,
-0.0124359130859375,
-0.040374755859375,
-0.01380157470703125,
-0.0157012939453125,
0.0233001708984375,
0.006591796875,
-0.030975341796875,
0.0227813720703125,
0.0322265625,
0.004482269287109375,
-0.0321044921875,
0.0016717910766601562,
-0.01142120361328125,
-0.042449951171875,
-0.09857177734375,
-0.021331787109375,
-0.005001068115234375,
-0.01087188720703125,
0.0328369140625,
-0.0173797607421875,
0.0247344970703125,
0.05426025390625,
-0.017822265625,
0.0200347900390625,
0.01316070556640625,
-0.029388427734375,
-0.08697509765625,
-0.0294952392578125,
0.018768310546875,
0.036163330078125,
-0.0265350341796875,
0.0491943359375,
-0.0172271728515625,
-0.0438232421875,
0.0028362274169921875,
0.01495361328125,
0.06512451171875,
-0.0013103485107421875,
-0.039306640625,
0.027557373046875,
-0.036224365234375,
-0.021209716796875,
-0.035552978515625,
0.019866943359375,
-0.0246124267578125,
0.007740020751953125,
-0.036773681640625,
-0.0105743408203125,
-0.027923583984375,
-0.0653076171875,
-0.053955078125,
0.1605224609375,
0.01275634765625,
0.027801513671875,
0.008880615234375,
0.060638427734375,
-0.0487060546875,
0.042388916015625,
-0.0709228515625,
0.0576171875,
0.01171875,
0.070068359375,
-0.05902099609375,
-0.0031566619873046875,
0.00913238525390625,
0.0225372314453125,
0.042388916015625,
-0.0039825439453125,
-0.01023101806640625,
-0.0178070068359375,
0.038787841796875,
0.0273590087890625,
0.0008082389831542969,
0.0216064453125,
-0.0212249755859375,
0.0411376953125,
0.035919189453125,
-0.07244873046875,
0.0255584716796875,
-0.011993408203125,
-0.030548095703125,
0.0012187957763671875,
0.004955291748046875,
0.009185791015625,
-0.0126495361328125,
-0.01605224609375,
0.00623321533203125,
-0.016021728515625,
-0.0086212158203125,
-0.0032863616943359375,
0.0117950439453125,
0.00540924072265625,
0.033233642578125,
-0.0767822265625,
-0.0159759521484375,
-0.029510498046875,
0.04412841796875,
0.0191497802734375,
-0.0240020751953125,
0.0516357421875,
0.01202392578125,
0.01023101806640625,
0.0069122314453125,
-0.0110931396484375,
0.0006709098815917969,
0.0182952880859375,
0.01407623291015625,
0.0158233642578125,
0.0245208740234375,
-0.01136016845703125,
0.03009033203125,
0.026123046875,
0.00644683837890625,
-0.0241546630859375,
-0.0313720703125,
0.02239990234375,
0.0033588409423828125,
-0.01287078857421875,
-0.025665283203125,
-0.006092071533203125,
-0.0222015380859375,
0.0203704833984375,
-0.0269622802734375,
-0.01190948486328125,
0.015228271484375,
0.011444091796875,
0.004608154296875,
0.035400390625,
-0.01123809814453125,
-0.01434326171875,
-0.01092529296875,
-0.0301971435546875,
0.01244354248046875,
0.03472900390625,
0.032196044921875,
0.004428863525390625,
-0.0186767578125,
-0.0024280548095703125,
-0.0301055908203125,
0.044342041015625,
0.007579803466796875,
0.0369873046875,
-0.051544189453125,
-0.037353515625,
0.0171051025390625,
0.03680419921875,
0.00945281982421875,
0.046966552734375,
0.09765625,
0.07354736328125,
-0.055908203125,
-0.017974853515625,
0.048095703125,
-0.034027099609375,
-0.03228759765625,
-0.0198974609375,
-0.004482269287109375,
0.048492431640625,
0.017791748046875,
0.0082244873046875,
0.023193359375,
0.046905517578125,
-0.0186309814453125,
0.02294921875,
-0.0028438568115234375,
-0.01300811767578125,
0.004589080810546875,
0.0027217864990234375,
0.012054443359375,
0.01396942138671875,
-0.03509521484375,
-0.007648468017578125,
-0.030853271484375,
-0.0102386474609375,
0.004608154296875,
0.00798797607421875,
-0.0207672119140625,
0.058929443359375,
-0.007781982421875,
0.0198211669921875,
-0.00795745849609375,
-0.0389404296875,
0.0221099853515625,
-0.0140228271484375,
0.0027675628662109375,
0.013519287109375,
-0.069580078125,
-0.031646728515625,
-0.0234527587890625,
0.027069091796875,
0.004528045654296875,
0.0928955078125,
-0.00811767578125,
-0.004146575927734375,
-0.010223388671875,
0.01343536376953125,
-0.026885986328125,
-0.00565338134765625,
-0.041412353515625,
-0.0105438232421875,
0.031982421875,
0.01313018798828125,
-0.0187225341796875,
0.023406982421875,
0.0204315185546875,
-0.020172119140625,
0.022613525390625,
-0.027252197265625,
0.0176239013671875,
-0.0179290771484375,
-0.0013141632080078125,
-0.044219970703125,
0.0021877288818359375,
-0.0218658447265625,
-0.0110015869140625,
0.0103302001953125,
-0.048065185546875,
-0.02044677734375,
0.020751953125,
0.004459381103515625,
-0.030609130859375,
0.03173828125,
-0.035247802734375,
0.033966064453125,
0.0340576171875,
-0.01517486572265625,
0.0006508827209472656,
-0.0141754150390625,
-0.020538330078125,
-0.02435302734375,
0.034210205078125,
-0.05206298828125,
0.01445770263671875,
-0.060211181640625,
-0.050567626953125,
0.0160675048828125,
0.0233001708984375,
-0.002239227294921875,
0.004436492919921875,
-0.01302337646484375,
-0.0168304443359375,
-0.005096435546875,
-0.004108428955078125,
-0.00891876220703125,
-0.0279083251953125,
-0.0256500244140625,
0.0166015625,
-0.040618896484375,
-0.047882080078125,
-0.04522705078125,
-0.017974853515625,
0.041290283203125,
-0.0003921985626220703,
-0.0245208740234375,
0.01387786865234375,
-0.03936767578125,
0.01200103759765625,
-0.0051422119140625,
-0.01389312744140625,
0.00021016597747802734,
0.039825439453125,
-0.001949310302734375,
-0.03814697265625,
-0.0197601318359375,
0.052337646484375,
-0.0241241455078125,
0.004657745361328125,
0.05108642578125,
-0.0089263916015625,
-0.0283050537109375,
-0.0156097412109375,
-0.01558685302734375,
0.02911376953125,
-0.01214599609375,
-0.0226593017578125,
-0.0220184326171875,
0.02850341796875,
0.018798828125,
-0.0070648193359375,
-0.004833221435546875,
0.0193023681640625,
-0.016571044921875,
-0.053253173828125,
0.024078369140625,
0.0266876220703125,
-0.025848388671875,
-0.048248291015625,
-0.00511932373046875,
-0.01143646240234375,
-0.0233306884765625,
-0.01218414306640625,
-0.005458831787109375,
-0.0253753662109375,
0.02557373046875,
0.01238250732421875,
-0.0274810791015625,
-4.172325134277344e-7,
0.017242431640625,
-0.0053863525390625,
0.037750244140625,
0.003467559814453125,
0.01313018798828125,
-0.031463623046875,
0.002582550048828125,
-0.024322509765625,
-0.0211334228515625,
-0.00958251953125,
0.0013713836669921875,
0.0218505859375,
0.0550537109375,
-0.0194091796875,
0.023468017578125,
0.005767822265625,
-0.0426025390625,
-0.0228729248046875,
0.00861358642578125,
-0.0196685791015625,
0.004055023193359375,
0.0899658203125,
0.047119140625,
0.02447509765625,
-0.035003662109375,
0.0231475830078125,
-0.0187225341796875,
-0.0012359619140625,
0.018890380859375,
-0.0115814208984375,
-0.0035686492919921875,
0.00832366943359375,
0.004856109619140625,
0.02911376953125,
-0.00372314453125,
-0.007904052734375,
0.023651123046875,
-0.036956787109375,
0.0093231201171875,
-0.023651123046875,
-0.01425933837890625,
0.01763916015625,
0.0202484130859375,
-0.0298614501953125,
-0.02484130859375,
0.01552581787109375,
-0.0178680419921875,
-0.0272979736328125,
0.01544952392578125,
-0.01354217529296875,
0.048126220703125,
-0.0430908203125,
0.01528167724609375,
-0.00556182861328125,
-0.0149078369140625,
-0.033172607421875,
0.0202484130859375,
-0.01268768310546875,
-0.0006208419799804688,
0.0153045654296875,
-0.0013370513916015625,
-0.0189056396484375,
0.0029773712158203125,
0.002593994140625,
0.0308074951171875,
-0.005710601806640625,
-0.0264434814453125,
-0.0189208984375,
0.00592041015625,
-0.0151519775390625,
-0.004009246826171875,
0.0254058837890625,
-0.0278472900390625,
0.01363372802734375,
0.033233642578125,
0.00789642333984375,
-0.006748199462890625,
0.01441192626953125,
-0.0243682861328125,
0.00910186767578125,
-0.005611419677734375
] |
a4cda85bca4fae83cabb87d662cd49068c0e5274
|
Wordpress Stackexchange
Q: How to display data from custom table in wordpress database? I want to retrieve data from custom table, that I've made inside the wordpress database and display it in a wordpress page , like posts
Thanks in advance
A: Here is an example code that will get the data and then display it:
global $wpdb;
// this adds the prefix which is set by the user upon instillation of wordpress
$table_name = $wpdb->prefix . "your_table_name";
// this will get the data from your table
$retrieve_data = $wpdb->get_results( "SELECT * FROM $table_name" );
?>
<ul>
foreach ($retrieve_data as $retrieved_data){ ?>
<li><?php echo $retrieved_data->column_name;?></li>
<li><?php echo $retrieved_data->another_column_name;?></li>
<li><?php echo $retrieved_data->as_many_columns_as_you_have;?></li>
<?php
}
?>
</ul>
<?php
It's good practice to use unique names for variables and functions, so you may want to add a unique prefix to all your variables or functions IE: ($prefix_table_name where "prefix" would be something unique such as the abbreviation of your theme or plugin.)
Reference - wpdb - codex
|
Q: How to display data from custom table in wordpress database? I want to retrieve data from custom table, that I've made inside the wordpress database and display it in a wordpress page , like posts
Thanks in advance
A: Here is an example code that will get the data and then display it:
global $wpdb;
// this adds the prefix which is set by the user upon instillation of wordpress
$table_name = $wpdb->prefix . "your_table_name";
// this will get the data from your table
$retrieve_data = $wpdb->get_results( "SELECT * FROM $table_name" );
?>
<ul>
foreach ($retrieve_data as $retrieved_data){ ?>
<li><?php echo $retrieved_data->column_name;?></li>
<li><?php echo $retrieved_data->another_column_name;?></li>
<li><?php echo $retrieved_data->as_many_columns_as_you_have;?></li>
<?php
}
?>
</ul>
<?php
It's good practice to use unique names for variables and functions, so you may want to add a unique prefix to all your variables or functions IE: ($prefix_table_name where "prefix" would be something unique such as the abbreviation of your theme or plugin.)
Reference - wpdb - codex
A: Please try this code for display all the records from database in wordpress. For this firstly need to create a file.php inside your selected wordpress folder and then use this file as a template. And this code will work perfectly Thank you all.
<?php /* Template Name: your template name */ ?>
<?php get_header(); ?>
<table border="1">
<tr>
<th>ID</th>
<th>FULL NAME</th>
<th>BRANCH NAME</th>
<th>E-MAIL ID</th>
<th>Mobile Number</th>
<th>Course</th>
<th>Address</th>
<th>City</th>
<th>Zip Code</th>
</tr>
<?php
global $wpdb;
$result = $wpdb->get_results( "SELECT * FROM wp_example");
foreach ( $result as $print ) { ?>
<tr>
<td> <?php echo $print->id; ?> </td>
<td><?php echo $print->firstname; ?> </td>
<td> <?php echo $print->branch ; ?> </td>
<td> <?php echo $print->email; ?> </td>
<td><?php echo $print->mobile; ?> </td>
<td> <?php echo $print->course; ?> </td>
<td> <?php echo $print->address; ?> </td>
<td><?php echo $print->city; ?> </td>
<td> <?php echo $print->zip ; ?> </td>
</tr>
<?php }
?>
</table>
<?php get_header(); ?>
A: Sounds like you're looking for $wpdb. You'll need to write all your own functions and such. I strongly recommend sticking to the established naming conventions (stuff like the_blah and get_blah, maybe with a prefix) for ease of readability and for consistency.
A: Modification of @Kirill Fuchs's answer. If you use this code on shortcode this may create a problem. It may display the outputs in wrong order. To avoid the I used return instead of echo. Try to do this on shortcode this way:
add_shortcode('custom_db', function(){
global $wpdb;
$table_name = $wpdb->prefix . 'liveshoutbox';
// this will get the data from your table
$retrieve_data = $wpdb->get_results( "SELECT * FROM $table_name" );
foreach ($retrieve_data as $retrieved_data){
$f_name = $retrieved_data->column_name;
$f_text = $retrieved_data->another_column_name;
}
$output = '<div class="wrap">
<h2>Table of clients.</h2>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
</tr>
<tr>
<td>'. $f_name .'</td>
<td>'. $f_text .'</td>
</tr>
</table>
</div>';
return $output;
} );
|
wordpress
|
{
"language": "en",
"length": 467,
"provenance": "stackexchange_00019.jsonl.gz:419920",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51984"
}
|
[
0.0189208984375,
0.0146026611328125,
-0.03619384765625,
-0.0233001708984375,
0.0338134765625,
-0.0309906005859375,
0.033966064453125,
-0.007083892822265625,
-0.0041961669921875,
0.0268402099609375,
-0.012847900390625,
0.0027942657470703125,
-0.0389404296875,
-0.034423828125,
-0.01407623291015625,
-0.0374755859375,
0.049285888671875,
0.00884246826171875,
0.06982421875,
0.00952911376953125,
0.0184173583984375,
0.03509521484375,
0.0034637451171875,
0.031463623046875,
0.0333251953125,
-0.0268096923828125,
0.0550537109375,
-0.0018634796142578125,
0.050140380859375,
0.0098419189453125,
0.03826904296875,
-0.051025390625,
0.00939178466796875,
0.029144287109375,
-0.0206756591796875,
0.01558685302734375,
0.032501220703125,
0.006275177001953125,
0.01280975341796875,
0.042388916015625,
0.024932861328125,
-0.01061248779296875,
-0.0032444000244140625,
0.003818511962890625,
-0.02276611328125,
-0.04632568359375,
0.037261962890625,
-0.01580810546875,
-0.018096923828125,
0.03369140625,
0.01995849609375,
0.01560211181640625,
0.011077880859375,
0.03369140625,
0.00318145751953125,
0.0287017822265625,
-0.01093292236328125,
-0.0302886962890625,
0.00804901123046875,
0.034271240234375,
0.002819061279296875,
0.018463134765625,
0.007228851318359375,
-0.0056610107421875,
0.01458740234375,
-0.001506805419921875,
0.1036376953125,
0.00826263427734375,
-0.016143798828125,
-0.01230621337890625,
0.0211029052734375,
0.0214691162109375,
-0.029510498046875,
-0.0020046234130859375,
-0.0382080078125,
-0.00023829936981201172,
0.009368896484375,
-0.03363037109375,
0.003894805908203125,
0.0183258056640625,
-0.001506805419921875,
-0.01727294921875,
0.00289154052734375,
0.0026416778564453125,
-0.0069122314453125,
0.0198516845703125,
-0.0196685791015625,
-0.015899658203125,
0.0140228271484375,
0.0108489990234375,
-0.00809478759765625,
-0.00669097900390625,
0.0038318634033203125,
0.0379638671875,
-0.0185089111328125,
-0.0146636962890625,
-0.0171356201171875,
0.039276123046875,
-0.0648193359375,
0.004520416259765625,
-0.01044464111328125,
-0.0088043212890625,
0.0282135009765625,
-0.048370361328125,
-0.00490570068359375,
0.0169677734375,
0.0009374618530273438,
-0.013153076171875,
0.014190673828125,
0.03363037109375,
-0.0010204315185546875,
-0.01020050048828125,
-0.05352783203125,
-0.048370361328125,
-0.028045654296875,
0.0269622802734375,
-0.0546875,
-0.02642822265625,
-0.003936767578125,
-0.044647216796875,
-0.005733489990234375,
0.0272979736328125,
-0.06927490234375,
-0.040618896484375,
0.00044274330139160156,
-0.04278564453125,
-0.005992889404296875,
0.037750244140625,
-0.0546875,
0.01482391357421875,
-0.0179595947265625,
0.0170745849609375,
0.06549072265625,
0.0635986328125,
0.01087188720703125,
-0.002506256103515625,
0.036895751953125,
0.032318115234375,
0.018768310546875,
0.0274200439453125,
-0.0208892822265625,
-0.014984130859375,
0.0174560546875,
-0.0178375244140625,
-0.0340576171875,
0.005611419677734375,
0.0160675048828125,
0.01535797119140625,
-0.0213775634765625,
-0.034088134765625,
-0.03973388671875,
0.03515625,
0.0019407272338867188,
0.01094818115234375,
0.0032958984375,
0.01558685302734375,
-0.026397705078125,
0.0081329345703125,
-0.0089874267578125,
0.0227508544921875,
0.052337646484375,
-0.022216796875,
-0.031463623046875,
0.030364990234375,
-0.0257720947265625,
0.025726318359375,
-0.01593017578125,
-0.00823974609375,
0.028717041015625,
0.0168609619140625,
-0.0095977783203125,
-0.0238189697265625,
0.049713134765625,
0.00897979736328125,
-0.00582122802734375,
0.0281219482421875,
-0.03485107421875,
-0.0258636474609375,
0.047607421875,
0.027984619140625,
0.001811981201171875,
-0.01096343994140625,
0.0263671875,
0.00472259521484375,
-0.048492431640625,
0.033660888671875,
0.0064849853515625,
0.06866455078125,
0.0123291015625,
0.0303802490234375,
-0.0016050338745117188,
-0.0022125244140625,
-0.04022216796875,
0.032684326171875,
-0.0138702392578125,
-0.031005859375,
-0.01593017578125,
-0.01175689697265625,
-0.019378662109375,
0.013641357421875,
-0.00868988037109375,
-0.0003094673156738281,
0.0133819580078125,
-0.02264404296875,
-0.05889892578125,
0.0187225341796875,
-0.032867431640625,
0.040618896484375,
-0.0006470680236816406,
0.0007429122924804688,
0.027740478515625,
-0.0007753372192382812,
-0.02520751953125,
-0.00949859619140625,
-0.034149169921875,
0.01739501953125,
-0.029266357421875,
0.019317626953125,
0.0035686492919921875,
0.01947021484375,
0.004047393798828125,
-0.043609619140625,
-0.0124359130859375,
-0.0220947265625,
-0.00925445556640625,
-0.06427001953125,
0.0100250244140625,
-0.0272064208984375,
0.01523590087890625,
-0.0330810546875,
0.038543701171875,
0.004322052001953125,
0.01003265380859375,
0.0506591796875,
0.0017452239990234375,
-0.020172119140625,
0.006938934326171875,
-0.0499267578125,
0.0158233642578125,
0.032440185546875,
0.03875732421875,
-0.00563812255859375,
-0.020416259765625,
-0.0161895751953125,
0.033477783203125,
-0.029815673828125,
-0.008453369140625,
-0.0032634735107421875,
0.0200347900390625,
0.05975341796875,
-0.0313720703125,
0.001415252685546875,
0.0165252685546875,
-0.0095977783203125,
-0.000331878662109375,
0.033233642578125,
-0.0308685302734375,
0.0298004150390625,
0.0087432861328125,
-0.003498077392578125,
-0.02587890625,
0.01666259765625,
0.04522705078125,
-0.011322021484375,
-0.0107574462890625,
0.0262298583984375,
0.0219268798828125,
0.030517578125,
-0.043701171875,
0.034576416015625,
0.0247344970703125,
0.0262451171875,
-0.014678955078125,
-0.017974853515625,
0.001483917236328125,
-0.01551055908203125,
-0.0289764404296875,
0.0167388916015625,
-0.0003790855407714844,
-0.0243072509765625,
0.0125274658203125,
0.057281494140625,
-0.0257720947265625,
-0.01055908203125,
-0.00592041015625,
-0.0555419921875,
-0.02410888671875,
0.0211944580078125,
-0.0303955078125,
0.000012874603271484375,
0.0106201171875,
0.0887451171875,
0.0021610260009765625,
0.04022216796875,
-0.04937744140625,
0.0253448486328125,
0.0124969482421875,
-0.052581787109375,
0.0284271240234375,
-0.04144287109375,
0.04046630859375,
0.07855224609375,
-0.006168365478515625,
0.01178741455078125,
-0.0020751953125,
-0.02362060546875,
-0.007335662841796875,
0.005413055419921875,
-0.0152587890625,
-0.030181884765625,
-0.029998779296875,
0.024932861328125,
0.0458984375,
0.11285400390625,
-0.0022563934326171875,
-0.04376220703125,
-0.00390625,
0.0797119140625,
-0.032867431640625,
-0.08245849609375,
-0.012420654296875,
-0.00911712646484375,
-0.010894775390625,
-0.0283966064453125,
-0.0019683837890625,
0.0112762451171875,
-0.052032470703125,
-0.0014896392822265625,
0.035797119140625,
-0.0343017578125,
-0.0194549560546875,
-0.019775390625,
-0.05224609375,
-0.01419830322265625,
0.0208587646484375,
0.01080322265625,
-0.016571044921875,
0.040924072265625,
-0.0132904052734375,
-0.026885986328125,
-0.031829833984375,
0.0148162841796875,
-0.0029144287109375,
-0.042083740234375,
0.0283203125,
-0.0404052734375,
0.032012939453125,
-0.004055023193359375,
0.0263519287109375,
0.03082275390625,
-0.00901031494140625,
-0.0185546875,
0.030670166015625,
0.0120697021484375,
0.05029296875,
-0.01200103759765625,
-0.0419921875,
0.043121337890625,
0.0396728515625,
-0.0288238525390625,
0.0008044242858886719,
0.018646240234375,
0.002185821533203125,
-0.04681396484375,
-0.024505615234375,
-0.035400390625,
-0.030059814453125,
0.05084228515625,
0.025909423828125,
0.032562255859375,
-0.00736236572265625,
-0.01727294921875,
0.0284576416015625,
0.0190582275390625,
0.056121826171875,
0.004955291748046875,
0.0180206298828125,
-0.0252838134765625,
0.036895751953125,
0.032318115234375,
0.019866943359375,
0.035614013671875,
-0.0426025390625,
0.003692626953125,
-0.09381103515625,
0.05108642578125,
-0.004894256591796875,
0.0164031982421875,
-0.0171051025390625,
-0.041473388671875,
0.032623291015625,
0.127685546875,
-0.0394287109375,
-0.0111846923828125,
0.0195159912109375,
0.031402587890625,
-0.045440673828125,
-0.026397705078125,
-0.041656494140625,
-0.0120849609375,
-0.07196044921875,
-0.00891876220703125,
-0.0159759521484375,
-0.03729248046875,
-0.0042724609375,
-0.001556396484375,
-0.046356201171875,
-0.037017822265625,
0.02398681640625,
-0.037811279296875,
-0.002712249755859375,
0.02178955078125,
-0.0262451171875,
0.0033817291259765625,
0.0035495758056640625,
-0.046234130859375,
-0.036468505859375,
-0.00677490234375,
-0.00664520263671875,
0.01091766357421875,
0.04571533203125,
-0.047607421875,
0.01181793212890625,
0.036712646484375,
0.016082763671875,
0.033721923828125,
0.0009660720825195312,
0.005855560302734375,
0.003826141357421875,
-0.034759521484375,
0.00934600830078125,
-0.044677734375,
-0.0173797607421875,
-0.0732421875,
0.0006437301635742188,
-0.0020809173583984375,
-0.026824951171875,
0.051361083984375,
-0.0498046875,
0.021636962890625,
0.020751953125,
-0.0195159912109375,
-0.0032634735107421875,
0.043243408203125,
-0.030792236328125,
0.0164947509765625,
-0.0269927978515625,
-0.0004200935363769531,
0.0246429443359375,
0.0106201171875,
-0.0187835693359375,
0.0240478515625,
0.0182037353515625,
0.012359619140625,
-0.03497314453125,
-0.08843994140625,
0.016876220703125,
0.04681396484375,
0.00841522216796875,
0.03253173828125,
0.022216796875,
-0.0233306884765625,
0.048858642578125,
0.031036376953125,
-0.004558563232421875,
0.01129150390625,
0.0186004638671875,
0.0117950439453125,
-0.020843505859375,
0.01247406005859375,
0.009735107421875,
-0.0116119384765625,
0.054534912109375,
-0.01503753662109375,
-0.0300750732421875,
-0.0023822784423828125,
0.06597900390625,
-0.021209716796875,
0.004009246826171875,
-0.06341552734375,
-0.03228759765625,
0.01160430908203125,
-0.054473876953125,
0.0311279296875,
-0.0162353515625,
0.01326751708984375,
-0.004756927490234375,
-0.003917694091796875,
0.01508331298828125,
0.0081024169921875,
0.03582763671875,
-0.00024020671844482422,
0.037994384765625,
0.0232696533203125,
0.01439666748046875,
-0.037322998046875,
-0.0228729248046875,
0.07708740234375,
-0.00247955322265625,
-0.04241943359375,
0.017120361328125,
-0.028594970703125,
0.0350341796875,
0.0235748291015625,
-0.00909423828125,
0.00409698486328125,
0.034088134765625,
-0.0167694091796875,
0.03558349609375,
0.0080413818359375,
0.0104827880859375,
-0.00762939453125,
0.0250091552734375,
0.0092315673828125,
-0.0026226043701171875,
-0.01239776611328125,
0.07049560546875,
-0.0010805130004882812,
0.037017822265625,
-0.0220794677734375,
0.0255889892578125,
0.0034637451171875,
0.0458984375,
0.00835418701171875,
-0.01415252685546875,
-0.01395416259765625,
0.023895263671875,
-0.0198974609375,
-0.032440185546875,
0.0067138671875,
-0.00881195068359375,
0.0482177734375,
-0.0210113525390625,
-0.043609619140625,
0.05584716796875,
-0.054840087890625,
-0.02105712890625,
0.040863037109375,
0.009674072265625,
-0.03369140625,
-0.05657958984375,
-0.0115814208984375,
0.061492919921875,
0.022857666015625,
-0.01023101806640625,
0.005767822265625,
-0.0306854248046875,
0.053131103515625,
-0.0638427734375,
0.04937744140625,
-0.01371002197265625,
-0.019134521484375,
-0.0208892822265625,
-0.020477294921875,
-0.0276641845703125,
-0.0211181640625,
-0.0067901611328125,
0.005321502685546875,
0.005382537841796875,
-0.00673675537109375,
-0.04571533203125,
0.00720977783203125,
-0.0288848876953125,
0.006519317626953125,
-0.046661376953125,
0.00565338134765625,
0.0799560546875,
0.06396484375,
-0.0311737060546875,
-0.0162811279296875,
0.01010894775390625,
0.0053863525390625,
0.035858154296875,
-0.0307464599609375,
-0.0174407958984375,
-0.032867431640625,
-0.016326904296875,
-0.00467681884765625,
-0.013641357421875,
-0.00743865966796875,
-0.026519775390625,
0.021240234375,
0.01100921630859375,
-0.031951904296875,
0.007701873779296875,
0.052490234375,
0.008087158203125,
0.0465087890625,
0.030792236328125,
0.03399658203125,
-0.0207672119140625,
-0.03240966796875,
0.040496826171875,
-0.064697265625,
-0.0517578125,
-0.0216522216796875,
-0.0426025390625,
-0.00811767578125,
-0.02935791015625,
-0.01334381103515625,
0.03533935546875,
-0.02166748046875,
-0.0027713775634765625,
-0.01427459716796875,
0.002132415771484375,
-0.0667724609375,
0.005035400390625,
-0.00330352783203125,
-0.021148681640625,
-0.0031452178955078125,
-0.0144500732421875,
-0.0361328125,
0.051422119140625,
-0.014801025390625,
0.0276641845703125,
0.0121917724609375,
-0.06268310546875,
0.07843017578125,
0.09381103515625,
0.0294036865234375,
0.06280517578125,
0.0220489501953125,
0.0278472900390625,
0.0229949951171875,
0.01419830322265625,
-0.021392822265625,
-0.031005859375,
0.048492431640625,
0.003185272216796875,
-0.030487060546875,
0.028106689453125,
-0.0294189453125,
0.00632476806640625,
0.03057861328125,
0.0533447265625,
-0.060546875,
0.0045166015625,
0.0007872581481933594,
-0.0255584716796875,
-0.007373809814453125,
0.0225830078125,
-0.03546142578125,
-0.039215087890625,
-0.008575439453125,
0.0214996337890625,
-0.0221710205078125,
-0.00983428955078125,
0.021636962890625,
0.01480865478515625,
-0.020782470703125,
0.06103515625,
-0.009429931640625,
0.01464080810546875,
-0.037445068359375,
-0.006702423095703125,
-0.006534576416015625,
0.008819580078125,
0.0004734992980957031,
0.01136016845703125,
-0.025115966796875,
-0.05487060546875,
-0.00782012939453125,
-0.0362548828125,
-0.0194244384765625,
0.0017137527465820312,
0.0270843505859375,
0.02423095703125,
0.03741455078125,
0.00450897216796875,
-0.00687408447265625,
0.0139923095703125,
-0.0085296630859375,
0.03448486328125,
-0.017333984375,
-0.031829833984375,
0.0146942138671875,
-0.038116455078125,
-0.003582000732421875,
-0.0306243896484375,
0.023223876953125,
-0.0140533447265625,
-0.00537109375,
0.0888671875,
-0.0004608631134033203,
-0.0394287109375,
0.007045745849609375,
-0.012298583984375,
-0.0018558502197265625,
-0.004375457763671875,
0.045745849609375,
-0.0533447265625,
-0.01861572265625,
0.0213623046875,
-0.025177001953125,
-0.036865234375,
-0.0037097930908203125,
-0.05780029296875,
0.03619384765625,
-0.00836944580078125,
0.0177154541015625,
-0.0006866455078125,
0.0136566162109375,
-0.0009431838989257812,
-0.0141143798828125,
-0.040435791015625,
0.03497314453125,
-0.01552581787109375,
0.0662841796875,
-0.05279541015625,
-0.005855560302734375,
0.0259552001953125,
0.049591064453125,
0.037750244140625,
0.01290130615234375,
-0.0018177032470703125,
-0.005950927734375,
0.0166473388671875,
0.00984954833984375,
-0.037628173828125,
0.02392578125,
0.007038116455078125,
0.08502197265625,
0.061370849609375,
-0.04644775390625,
0.0300445556640625,
0.019378662109375,
-0.0228424072265625,
0.03399658203125,
0.039031982421875,
0.044036865234375,
0.0211181640625,
-0.00780487060546875,
-0.02301025390625,
0.00658416748046875,
0.035980224609375,
-0.035430908203125,
-0.022003173828125,
0.0772705078125,
0.050537109375,
-0.052490234375,
-0.038482666015625,
-0.045135498046875,
0.039276123046875,
0.0200958251953125,
0.03546142578125,
0.031524658203125,
0.0136566162109375,
0.01837158203125,
0.045562744140625,
0.02130126953125,
0.027923583984375,
0.00911712646484375,
0.061676025390625,
0.02984619140625,
0.01064300537109375,
-0.047454833984375,
-0.00284576416015625,
0.03472900390625,
0.079833984375,
-0.052337646484375,
-0.02532958984375,
0.022308349609375,
0.001495361328125,
-0.0234375,
-0.01123046875,
-0.01267242431640625,
0.02227783203125,
0.0272064208984375,
-0.007762908935546875,
0.00902557373046875,
0.00011432170867919922,
0.02484130859375,
-0.01160430908203125,
0.00276947021484375,
-0.03424072265625,
-0.00775909423828125,
-0.01383209228515625,
-0.00002956390380859375,
0.0307769775390625,
0.0227508544921875,
0.0006055831909179688,
0.029510498046875,
0.016204833984375,
0.00666046142578125,
-0.0225372314453125,
-0.00685882568359375,
-0.00374603271484375,
0.04071044921875,
-0.034271240234375,
0.0012960433959960938,
-0.003948211669921875,
0.0380859375,
0.016754150390625,
-0.002658843994140625,
0.01318359375,
-0.01537322998046875,
-0.0274200439453125,
-0.018035888671875,
-0.00304412841796875,
-0.03253173828125,
-0.020355224609375,
-0.05670166015625,
0.00539398193359375,
-0.006923675537109375,
0.00415802001953125,
0.001804351806640625,
0.0195770263671875,
0.00019407272338867188,
-0.03497314453125,
0.042633056640625,
-0.0179290771484375,
-0.031982421875,
0.0311279296875,
-0.06268310546875,
0.0806884765625,
-0.0341796875,
-0.08197021484375,
-0.03167724609375,
-0.0099639892578125,
-0.0310821533203125,
0.036651611328125,
0.055511474609375,
0.025970458984375,
-0.02496337890625,
-0.0040740966796875,
-0.01045989990234375,
0.0146331787109375,
-0.02093505859375,
0.023956298828125,
0.0099029541015625,
-0.0025787353515625,
-0.0012540817260742188,
-0.0330810546875,
-0.01308441162109375,
0.0098876953125,
0.02294921875,
-0.01422882080078125,
0.04486083984375,
-0.0066680908203125,
0.0087738037109375,
-0.018310546875,
0.0216217041015625,
-0.032379150390625,
-0.0228271484375,
0.049224853515625,
0.0104827880859375,
0.006717681884765625,
-0.0183258056640625,
-0.01352691650390625,
-0.00585174560546875,
0.0511474609375,
-0.039215087890625,
-0.01290130615234375,
-0.01910400390625,
0.03363037109375,
-0.0220947265625,
0.0309906005859375,
-0.0057830810546875,
-0.00823211669921875,
0.00795745849609375,
0.0014734268188476562,
0.032745361328125,
0.07330322265625,
0.0282135009765625,
0.0006036758422851562,
0.030303955078125,
-0.026458740234375,
0.030426025390625,
-0.00788116455078125,
0.06719970703125,
0.04254150390625,
-0.0020599365234375,
-0.046600341796875,
-0.0302734375,
-0.03082275390625,
-0.0227203369140625,
-0.005695343017578125,
0.03228759765625,
-0.0213623046875,
-0.045501708984375,
0.0259857177734375,
0.0306549072265625,
0.05279541015625,
-0.00366973876953125,
0.02593994140625,
0.0208892822265625,
0.0067901611328125,
0.0103607177734375,
-0.035614013671875,
-0.022552490234375,
-0.0277862548828125,
-0.0261383056640625,
0.0237579345703125,
-0.018310546875,
-0.0193023681640625,
-0.06524658203125,
-0.0093994140625,
0.018768310546875,
0.0022754669189453125,
-0.043792724609375,
-0.0197906494140625,
-0.004360198974609375,
0.04681396484375,
-0.0223388671875,
-0.0041351318359375,
0.018096923828125,
0.0694580078125,
-0.00713348388671875,
-0.031982421875,
0.0118865966796875,
0.0185089111328125,
-0.0017843246459960938,
0.0222625732421875,
0.018951416015625,
-0.0274658203125,
0.000286102294921875,
0.03582763671875,
0.026123046875,
0.068603515625,
-0.0027942657470703125,
-0.0086517333984375,
0.0172119140625,
-0.016326904296875,
-0.052032470703125,
-0.1016845703125,
0.04833984375,
-0.1302490234375,
-0.01861572265625,
0.022674560546875,
0.0095367431640625,
0.02825927734375,
-0.026153564453125,
-0.04864501953125,
0.042327880859375,
0.002803802490234375,
-0.03961181640625,
-0.0277252197265625,
-0.0270538330078125,
-0.01445770263671875,
0.0299835205078125,
0.001674652099609375,
-0.039764404296875,
-0.04864501953125,
0.0210418701171875,
0.02813720703125,
-0.0123748779296875,
0.041015625,
0.0140380859375,
-0.08367919921875,
0.0093231201171875,
-0.01678466796875,
0.01348114013671875,
-0.0182952880859375,
0.023834228515625,
-0.004108428955078125,
0.01194000244140625,
-0.01507568359375,
-0.0030918121337890625,
-0.0104522705078125,
-0.034515380859375,
0.004077911376953125,
-0.0499267578125,
-0.02264404296875,
-0.0243988037109375,
0.033050537109375,
0.059661865234375,
0.0160064697265625,
-0.0306549072265625,
-0.031463623046875,
-0.039459228515625,
-0.031646728515625,
-0.0316162109375,
0.022674560546875,
-0.095703125,
-0.01904296875,
0.03173828125,
-0.0240631103515625,
0.033843994140625,
0.00301361083984375,
-0.037567138671875,
0.0136260986328125,
0.01537322998046875,
0.012420654296875,
-0.09356689453125,
0.01324462890625,
0.0340576171875,
-0.044036865234375,
-0.04437255859375,
-0.00499725341796875,
0.0073089599609375,
-0.0220184326171875,
-0.04071044921875,
-0.01399993896484375,
-0.0058746337890625,
0.0025653839111328125,
0.005939483642578125,
0.003528594970703125,
-0.005138397216796875,
0.0035533905029296875,
-0.0200958251953125,
-0.01354217529296875,
0.0035343170166015625,
-0.0179901123046875,
-0.002857208251953125,
0.01094818115234375,
0.0098876953125,
-0.007049560546875,
0.066162109375,
-0.01445770263671875,
0.005893707275390625,
-0.033935546875,
0.035125732421875,
-0.0243988037109375,
0.003772735595703125,
-0.00811767578125,
0.0078125,
0.0036716461181640625,
-0.0213623046875,
0.01751708984375,
-0.01451873779296875,
0.0133209228515625,
-0.0137939453125,
-0.007965087890625,
0.0172576904296875
] |
6a2b843f8d6df37dd19e2ba7f0460d201ee8a547
|
Wordpress Stackexchange
Q: How to have syntax highlighting in wordpress.com blogs? Is there a way I could install some plugin or have syntax highlighting for my wordpress.com blog or do I need to install WP on my own server to be able to install a plugin to do that?
A: WordPress.com uses Alex Gorbatchev’s SyntaxHighlighter so all you need to do is use the right shortcode ex:
[code language="css"]
#button {
font-weight: bold;
border: 2px solid #fff;
}
[/code]
which gives you something like this:
it has more features and you can see a list of supported languages at http://en.support.wordpress.com/code/posting-source-code/
|
Q: How to have syntax highlighting in wordpress.com blogs? Is there a way I could install some plugin or have syntax highlighting for my wordpress.com blog or do I need to install WP on my own server to be able to install a plugin to do that?
A: WordPress.com uses Alex Gorbatchev’s SyntaxHighlighter so all you need to do is use the right shortcode ex:
[code language="css"]
#button {
font-weight: bold;
border: 2px solid #fff;
}
[/code]
which gives you something like this:
it has more features and you can see a list of supported languages at http://en.support.wordpress.com/code/posting-source-code/
A: There is a plugin call "SyntaxHighlighter" really nice and easy. I am using on my blog. here is the link http://wordpress.org/extend/plugins/syntaxhighlighter/
|
wordpress
|
{
"language": "en",
"length": 120,
"provenance": "stackexchange_00019.jsonl.gz:419928",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52019"
}
|
[
0.0199737548828125,
-0.0203704833984375,
0.006237030029296875,
-0.009185791015625,
-0.0245819091796875,
-0.0030841827392578125,
-0.00943756103515625,
-0.0161895751953125,
-0.0008091926574707031,
0.003459930419921875,
-0.03643798828125,
0.0030841827392578125,
-0.045074462890625,
-0.015594482421875,
-0.00007992982864379883,
-0.0426025390625,
0.038543701171875,
-0.0175323486328125,
0.038543701171875,
-0.0022869110107421875,
-0.01149749755859375,
0.0240631103515625,
0.028778076171875,
0.0294189453125,
0.05078125,
-0.03741455078125,
0.109619140625,
-0.035614013671875,
0.046142578125,
-0.01244354248046875,
0.04168701171875,
-0.0484619140625,
0.023681640625,
0.055389404296875,
-0.06658935546875,
-0.032196044921875,
0.01367950439453125,
0.00124359130859375,
-0.0215606689453125,
0.0531005859375,
0.004016876220703125,
-0.0103912353515625,
0.0265655517578125,
0.0298004150390625,
0.0025157928466796875,
-0.035552978515625,
0.008026123046875,
-0.0660400390625,
0.001926422119140625,
-0.0853271484375,
0.01131439208984375,
0.0338134765625,
0.05718994140625,
-0.04296875,
-0.0163116455078125,
0.0260772705078125,
0.01273345947265625,
0.026641845703125,
0.004222869873046875,
0.003448486328125,
-0.01361846923828125,
0.03631591796875,
0.002368927001953125,
0.01422119140625,
0.00675201416015625,
0.00855255126953125,
0.0114898681640625,
0.0183868408203125,
-0.0290069580078125,
0.018646240234375,
0.0161895751953125,
-0.049560546875,
-0.0143280029296875,
-0.006053924560546875,
-0.0273590087890625,
0.01097869873046875,
-0.000033736228942871094,
-0.0085601806640625,
0.0198516845703125,
0.0172119140625,
0.056854248046875,
-0.00865936279296875,
0.040771484375,
-0.0245513916015625,
0.01934814453125,
0.003421783447265625,
0.010986328125,
-0.01922607421875,
-0.02783203125,
-0.051300048828125,
-0.01045989990234375,
0.0115966796875,
-0.0914306640625,
-0.01174163818359375,
-0.002208709716796875,
-0.0333251953125,
-0.0214996337890625,
-0.00042176246643066406,
0.0184783935546875,
0.0291595458984375,
-0.003662109375,
-0.036163330078125,
0.044891357421875,
-0.021240234375,
-0.0242156982421875,
0.01751708984375,
0.0218963623046875,
0.06005859375,
0.02825927734375,
0.0270538330078125,
0.0087127685546875,
-0.0279388427734375,
-0.0146484375,
-0.0004146099090576172,
-0.03863525390625,
0.00577545166015625,
-0.04449462890625,
0.01336669921875,
-0.002872467041015625,
0.01288604736328125,
0.0018281936645507812,
0.027313232421875,
-0.030853271484375,
0.035186767578125,
-0.0521240234375,
-0.048248291015625,
0.0278472900390625,
-0.01161956787109375,
-0.0009570121765136719,
0.00441741943359375,
-0.0180206298828125,
0.021759033203125,
0.03656005859375,
0.020172119140625,
-0.00798797607421875,
-0.0030269622802734375,
0.040618896484375,
0.01018524169921875,
-0.0167999267578125,
-0.014312744140625,
0.021392822265625,
0.0024662017822265625,
-0.010284423828125,
-0.0255279541015625,
0.03826904296875,
0.0196075439453125,
0.02288818359375,
0.01788330078125,
0.0015058517456054688,
-0.047271728515625,
0.07696533203125,
-0.0177459716796875,
0.04254150390625,
0.006816864013671875,
-0.0232391357421875,
-0.02783203125,
0.009552001953125,
-0.023284912109375,
0.00762176513671875,
-0.047698974609375,
0.00681304931640625,
0.0035686492919921875,
0.0272674560546875,
0.03643798828125,
0.007678985595703125,
-0.0008220672607421875,
-0.0084228515625,
0.004138946533203125,
0.0286865234375,
-0.0355224609375,
0.0096282958984375,
-0.00130462646484375,
0.059051513671875,
0.016204833984375,
-0.00148773193359375,
0.027252197265625,
0.026702880859375,
0.0159912109375,
0.01019287109375,
-0.002315521240234375,
-0.00745391845703125,
-0.013824462890625,
0.0655517578125,
-0.028900146484375,
-0.035003662109375,
0.017974853515625,
0.016571044921875,
0.07733154296875,
0.00690460205078125,
0.0265045166015625,
0.00771331787109375,
0.0007691383361816406,
-0.015869140625,
0.035308837890625,
-0.013214111328125,
-0.0253753662109375,
-0.01007843017578125,
0.0211029052734375,
-0.013916015625,
-0.0240020751953125,
0.0136566162109375,
0.0120391845703125,
-0.007572174072265625,
0.04052734375,
-0.03436279296875,
0.0223236083984375,
-0.022125244140625,
0.01209259033203125,
0.040618896484375,
-0.01047515869140625,
-0.0200042724609375,
0.0008792877197265625,
0.019073486328125,
-0.05328369140625,
-0.04248046875,
0.0631103515625,
-0.00988006591796875,
0.058319091796875,
0.035125732421875,
0.0079193115234375,
0.05889892578125,
-0.022705078125,
0.05181884765625,
-0.0064239501953125,
-0.0232696533203125,
-0.0304107666015625,
-0.007358551025390625,
-0.01416778564453125,
-0.031890869140625,
-0.00005352497100830078,
0.0006704330444335938,
0.0430908203125,
-0.01317596435546875,
0.031494140625,
-0.0260162353515625,
-0.022003173828125,
-0.00955963134765625,
-0.00841522216796875,
0.029754638671875,
0.040069580078125,
0.055267333984375,
0.037384033203125,
-0.01251220703125,
-0.06805419921875,
0.0841064453125,
-0.0148162841796875,
0.0229034423828125,
-0.051666259765625,
-0.00894927978515625,
0.041015625,
-0.0207672119140625,
0.00672149658203125,
0.0093994140625,
-0.0289764404296875,
0.007694244384765625,
0.03570556640625,
-0.004611968994140625,
0.0099334716796875,
-0.01416778564453125,
0.0058441162109375,
-0.003749847412109375,
-0.003276824951171875,
-0.0162506103515625,
-0.0201873779296875,
0.053802490234375,
-0.0258941650390625,
0.057281494140625,
0.031524658203125,
-0.0076904296875,
-0.0286407470703125,
0.0023021697998046875,
0.0283050537109375,
0.01470947265625,
0.037933349609375,
-0.01270294189453125,
0.05194091796875,
0.0206756591796875,
-0.029937744140625,
0.0269775390625,
0.02740478515625,
0.01088714599609375,
0.04925537109375,
-0.01512908935546875,
-0.026641845703125,
0.01474761962890625,
-0.03143310546875,
-0.01560211181640625,
0.01190185546875,
-0.00312042236328125,
-0.039794921875,
0.0096435546875,
0.0014867782592773438,
-0.04443359375,
0.03753662109375,
-0.004047393798828125,
-0.031982421875,
0.04534912109375,
-0.044403076171875,
0.051788330078125,
-0.0096435546875,
0.050018310546875,
0.06500244140625,
0.0243377685546875,
-0.006397247314453125,
0.007472991943359375,
-0.00933074951171875,
0.0180511474609375,
0.0015306472778320312,
-0.0106658935546875,
-0.01059722900390625,
-0.023406982421875,
0.039581298828125,
0.0080413818359375,
-0.005584716796875,
-0.01238250732421875,
-0.04791259765625,
-0.044769287109375,
0.005199432373046875,
-0.11676025390625,
-0.06903076171875,
0.01557159423828125,
-0.0950927734375,
0.013519287109375,
-0.007190704345703125,
-0.0452880859375,
-0.0279388427734375,
0.060546875,
0.0009546279907226562,
-0.03387451171875,
-0.040985107421875,
-0.0258026123046875,
-0.06817626953125,
-0.05401611328125,
-0.0160064697265625,
0.00995635986328125,
-0.0007781982421875,
0.0032825469970703125,
0.0134124755859375,
-0.003826141357421875,
-0.044158935546875,
-0.009796142578125,
0.033172607421875,
0.0089263916015625,
0.0301666259765625,
0.036163330078125,
-0.038116455078125,
-0.04852294921875,
0.0098724365234375,
-0.00568389892578125,
-0.0014600753784179688,
-0.0185394287109375,
-0.005084991455078125,
-0.023712158203125,
0.01038360595703125,
0.007389068603515625,
-0.038482666015625,
0.00043845176696777344,
0.040985107421875,
-0.0194854736328125,
-0.03131103515625,
-0.01425933837890625,
0.02386474609375,
-0.0249176025390625,
-0.0171966552734375,
0.01398468017578125,
-0.041168212890625,
-0.01222991943359375,
-0.00943756103515625,
0.034881591796875,
0.034515380859375,
0.00441741943359375,
-0.0000921487808227539,
0.0338134765625,
0.0180206298828125,
0.00983428955078125,
-0.03436279296875,
-0.00402069091796875,
-0.0167999267578125,
0.0233306884765625,
-0.01081085205078125,
0.00439453125,
-0.031280517578125,
0.0572509765625,
-0.0283355712890625,
-0.01062774658203125,
0.0120697021484375,
-0.05364990234375,
0.0238037109375,
-0.048065185546875,
-0.00797271728515625,
-0.04034423828125,
0.054718017578125,
-0.05389404296875,
0.00386810302734375,
0.031036376953125,
0.012542724609375,
-0.0169219970703125,
-0.00952911376953125,
-0.081787109375,
-0.01300811767578125,
-0.0672607421875,
0.0181427001953125,
0.0147552490234375,
-0.024993896484375,
-0.01438140869140625,
0.0006041526794433594,
-0.062744140625,
-0.01708984375,
0.03125,
-0.01242828369140625,
-0.0022144317626953125,
0.0151519775390625,
-0.01531982421875,
-0.0021724700927734375,
-0.01219940185546875,
-0.0212554931640625,
-0.0831298828125,
0.0007109642028808594,
-0.045684814453125,
0.06451416015625,
0.03497314453125,
-0.039794921875,
-0.0220489501953125,
0.0302581787109375,
-0.0247344970703125,
0.00927734375,
-0.00817108154296875,
0.045684814453125,
-0.0172882080078125,
0.01070404052734375,
-0.01483917236328125,
-0.0027790069580078125,
-0.001819610595703125,
0.032257080078125,
-0.03851318359375,
0.0587158203125,
0.003391265869140625,
-0.022552490234375,
0.055755615234375,
-0.05029296875,
0.0158843994140625,
-0.0181427001953125,
-0.0015354156494140625,
0.027496337890625,
-0.0216064453125,
0.0129241943359375,
-0.0231475830078125,
0.01285552978515625,
0.0302581787109375,
-0.0172119140625,
0.003871917724609375,
0.0078125,
0.07208251953125,
0.021484375,
-0.0033092498779296875,
-0.031585693359375,
0.02679443359375,
0.04364013671875,
0.034912109375,
0.03436279296875,
0.0259552001953125,
-0.052154541015625,
0.064208984375,
0.055023193359375,
0.006397247314453125,
-0.020721435546875,
0.0195770263671875,
0.018585205078125,
-0.006649017333984375,
0.0203857421875,
0.031097412109375,
0.00907135009765625,
-0.0019435882568359375,
0.01153564453125,
-0.03839111328125,
-0.0019989013671875,
0.035400390625,
0.006683349609375,
0.0020656585693359375,
-0.0198516845703125,
-0.05718994140625,
0.02423095703125,
-0.0046844482421875,
0.016082763671875,
-0.007568359375,
0.0123443603515625,
0.0225677490234375,
0.01534271240234375,
-0.03729248046875,
0.044036865234375,
0.0218048095703125,
0.04620361328125,
-0.00627899169921875,
0.0258636474609375,
-0.0345458984375,
-0.00850677490234375,
-0.018341064453125,
0.0634765625,
0.01148223876953125,
-0.06402587890625,
0.007801055908203125,
0.0020961761474609375,
0.0106353759765625,
-0.00571441650390625,
0.0025691986083984375,
0.040924072265625,
-0.0118560791015625,
-0.0275421142578125,
-0.018035888671875,
-0.0200958251953125,
-0.032562255859375,
-0.051300048828125,
-0.027252197265625,
0.005420684814453125,
-0.0255126953125,
-0.004268646240234375,
0.0239410400390625,
-0.06640625,
0.0202789306640625,
0.0238189697265625,
-0.034027099609375,
0.0015010833740234375,
0.0003483295440673828,
0.017181396484375,
0.007617950439453125,
0.030029296875,
-0.04595947265625,
0.058837890625,
-0.0240325927734375,
-0.0016956329345703125,
0.01486968994140625,
0.0382080078125,
-0.02471923828125,
-0.0208282470703125,
0.01352691650390625,
-0.039276123046875,
-0.0230560302734375,
-0.0233612060546875,
0.007602691650390625,
0.0271453857421875,
-0.016815185546875,
-0.0147857666015625,
0.0110931396484375,
0.061004638671875,
-0.0106201171875,
0.0030994415283203125,
-0.00032329559326171875,
0.029266357421875,
0.0022525787353515625,
-0.022857666015625,
0.030059814453125,
0.00908660888671875,
0.01328277587890625,
0.0008339881896972656,
-0.03424072265625,
-0.026611328125,
-0.017242431640625,
-0.01207733154296875,
-0.007343292236328125,
0.066162109375,
-0.020050048828125,
0.01480865478515625,
-0.0175018310546875,
-0.0123748779296875,
-0.026123046875,
0.004268646240234375,
0.037841796875,
0.0004432201385498047,
-0.057830810546875,
-0.0064697265625,
-0.0265960693359375,
-0.0078887939453125,
0.00405120849609375,
-0.01641845703125,
-0.038055419921875,
-0.010711669921875,
0.00809478759765625,
0.021270751953125,
-0.00962066650390625,
0.0011138916015625,
-0.053314208984375,
0.029327392578125,
0.03265380859375,
0.08001708984375,
-0.003223419189453125,
0.0179290771484375,
0.01172637939453125,
0.035858154296875,
0.0249481201171875,
0.0266876220703125,
-0.005237579345703125,
-0.04095458984375,
0.0294952392578125,
-0.0438232421875,
-0.03131103515625,
-0.037384033203125,
0.0092010498046875,
0.02093505859375,
0.02716064453125,
-0.00286102294921875,
0.032135009765625,
0.00841522216796875,
0.0174713134765625,
-0.0027561187744140625,
-0.06048583984375,
-0.01287841796875,
0.0206451416015625,
-0.0013446807861328125,
-0.007640838623046875,
0.047393798828125,
-0.016265869140625,
-0.005489349365234375,
0.0128021240234375,
-0.004566192626953125,
0.0121307373046875,
0.004558563232421875,
0.0207977294921875,
-0.0109100341796875,
-0.0198974609375,
0.0030059814453125,
0.0202178955078125,
0.0181732177734375,
0.0253753662109375,
-0.02215576171875,
-0.0333251953125,
-0.03173828125,
-0.01096343994140625,
-0.000629425048828125,
-0.0146484375,
0.0123291015625,
0.0220947265625,
-0.0043487548828125,
0.0294952392578125,
0.048583984375,
0.07568359375,
-0.0999755859375,
0.01458740234375,
0.03326416015625,
-0.0297393798828125,
0.01033782958984375,
-0.029632568359375,
0.00417327880859375,
-0.051544189453125,
0.032196044921875,
0.048614501953125,
-0.0286712646484375,
-0.004856109619140625,
0.01018524169921875,
-0.0225677490234375,
0.01169586181640625,
0.0450439453125,
0.0330810546875,
-0.06427001953125,
0.0255279541015625,
0.03558349609375,
-0.006805419921875,
-0.01358795166015625,
-0.0042724609375,
0.01515960693359375,
-0.03643798828125,
-0.049530029296875,
0.023681640625,
-0.040496826171875,
-0.0113067626953125,
0.01129913330078125,
-0.007137298583984375,
-0.0030422210693359375,
0.056854248046875,
-0.0350341796875,
0.0186920166015625,
0.0179901123046875,
0.0032958984375,
0.016693115234375,
-0.01140594482421875,
0.01456451416015625,
0.01232147216796875,
-0.0237884521484375,
0.00273895263671875,
-0.020782470703125,
-0.007221221923828125,
-0.0032520294189453125,
0.0274505615234375,
0.0728759765625,
-0.01456451416015625,
-0.0236053466796875,
0.0196075439453125,
0.01149749755859375,
0.01514434814453125,
-0.032928466796875,
0.003368377685546875,
-0.0367431640625,
0.0218505859375,
-0.0287322998046875,
0.03912353515625,
-0.006378173828125,
-0.034637451171875,
-0.06494140625,
0.057159423828125,
0.052734375,
0.005649566650390625,
0.00890350341796875,
0.01953125,
-0.051239013671875,
-0.0225830078125,
-0.005687713623046875,
0.039520263671875,
-0.0083770751953125,
-0.0095672607421875,
-0.054107666015625,
-0.000023305416107177734,
-0.0189056396484375,
0.044586181640625,
0.041656494140625,
0.0008726119995117188,
0.0105743408203125,
-0.0279998779296875,
0.03167724609375,
0.0423583984375,
0.0066375732421875,
0.00463104248046875,
-0.0011472702026367188,
0.0299224853515625,
-0.00753021240234375,
-0.0281829833984375,
0.036773681640625,
-0.04193115234375,
-0.045928955078125,
0.0157623291015625,
0.017578125,
0.0193023681640625,
-0.0014247894287109375,
-0.00241851806640625,
0.025390625,
0.0018329620361328125,
-0.0210723876953125,
0.00518035888671875,
0.01381683349609375,
0.039093017578125,
0.025177001953125,
-0.028106689453125,
-0.00910186767578125,
-0.0295867919921875,
0.0440673828125,
-0.0015850067138671875,
0.0377197265625,
-0.04345703125,
0.0123748779296875,
0.025177001953125,
-0.031280517578125,
0.0074462890625,
0.04412841796875,
-0.057525634765625,
0.0157623291015625,
0.01284027099609375,
0.023681640625,
-0.01519775390625,
-0.0179290771484375,
0.0147247314453125,
0.028167724609375,
-0.00717926025390625,
-0.0151214599609375,
0.0017309188842773438,
-0.002544403076171875,
-0.0193023681640625,
-0.0364990234375,
-0.00989532470703125,
-0.013885498046875,
0.0128936767578125,
-0.00823211669921875,
-0.01885986328125,
0.00855255126953125,
0.01422119140625,
0.0083770751953125,
-0.01251220703125,
0.01558685302734375,
-0.028564453125,
0.0034084320068359375,
-0.00893402099609375,
-0.0144195556640625,
0.01372528076171875,
-0.003314971923828125,
0.024658203125,
-0.044769287109375,
0.0050506591796875,
-0.0168609619140625,
0.01277923583984375,
0.01580810546875,
0.0113983154296875,
-0.0189361572265625,
0.0247802734375,
0.0208740234375,
0.033111572265625,
0.0179595947265625,
0.01161956787109375,
0.03314208984375,
0.0380859375,
-0.03802490234375,
-0.0012331008911132812,
0.03973388671875,
-0.01593017578125,
-0.01433563232421875,
-0.035919189453125,
0.0290069580078125,
0.036407470703125,
0.0151214599609375,
0.01551055908203125,
0.0091094970703125,
0.0440673828125,
-0.0345458984375,
0.01983642578125,
0.006931304931640625,
-0.01071929931640625,
0.0141754150390625,
0.006622314453125,
-0.0097808837890625,
0.0009737014770507812,
-0.0230255126953125,
0.004558563232421875,
-0.0341796875,
-0.04034423828125,
0.0252227783203125,
0.04193115234375,
0.0069580078125,
0.0002961158752441406,
-0.001354217529296875,
-0.023345947265625,
0.03094482421875,
0.002529144287109375,
0.01873779296875,
0.0131072998046875,
0.00290679931640625,
-0.005374908447265625,
-0.10296630859375,
-0.073486328125,
-0.061676025390625,
0.0714111328125,
0.01216888427734375,
0.0298919677734375,
0.00829315185546875,
0.038299560546875,
-0.041656494140625,
0.023284912109375,
-0.029296875,
-0.0235443115234375,
-0.01384735107421875,
0.023406982421875,
0.033477783203125,
-0.0100555419921875,
-0.043182373046875,
0.06390380859375,
0.0007410049438476562,
0.025482177734375,
0.052001953125,
-0.0294189453125,
0.00252532958984375,
-0.00007975101470947266,
0.038848876953125,
-0.015777587890625,
-0.058807373046875,
-0.05999755859375,
0.0020542144775390625,
0.0189666748046875,
0.01181793212890625,
-0.006561279296875,
0.0384521484375,
0.0059051513671875,
-0.0283050537109375,
0.040008544921875,
-0.035980224609375,
0.03857421875,
0.020294189453125,
0.0236053466796875,
-0.00237274169921875,
0.0311126708984375,
-0.0180511474609375,
-0.01151275634765625,
0.025909423828125,
-0.004810333251953125,
0.0258026123046875,
-0.08447265625,
0.049774169921875,
0.0670166015625,
0.0853271484375,
0.008514404296875,
0.019866943359375,
0.026031494140625,
-0.0230560302734375,
0.0003795623779296875,
0.04541015625,
-0.0149078369140625,
0.0215301513671875,
-0.0149383544921875,
-0.006839752197265625,
0.037109375,
-0.033416748046875,
-0.0058441162109375,
-0.02130126953125,
0.0215301513671875,
-0.039031982421875,
0.032806396484375,
-0.0645751953125,
-0.0236968994140625,
0.036041259765625,
-0.021881103515625,
-0.0142669677734375,
-0.00437164306640625,
0.00818634033203125,
-0.019195556640625,
-0.051513671875,
-0.0279693603515625,
0.048309326171875,
-0.043701171875,
0.04412841796875,
0.0372314453125,
-0.04052734375,
0.00910186767578125,
0.056640625,
0.0401611328125,
0.102783203125,
-0.003055572509765625,
0.00004369020462036133,
0.037322998046875,
-0.0092620849609375,
-0.03448486328125,
-0.1004638671875,
0.0213470458984375,
-0.1107177734375,
-0.017852783203125,
0.00457763671875,
-0.0262298583984375,
-0.022247314453125,
-0.07666015625,
-0.140380859375,
0.0299530029296875,
-0.018646240234375,
-0.06671142578125,
-0.029327392578125,
-0.01313018798828125,
0.0073699951171875,
0.0134124755859375,
-0.00919342041015625,
-0.03179931640625,
-0.06414794921875,
0.005168914794921875,
-0.0025577545166015625,
-0.0014705657958984375,
0.0008893013000488281,
-0.034027099609375,
-0.026123046875,
0.0054931640625,
0.034759521484375,
-0.007404327392578125,
0.0276031494140625,
-0.028045654296875,
0.039337158203125,
0.0304107666015625,
-0.024383544921875,
0.0012845993041992188,
0.0145416259765625,
-0.01320648193359375,
-0.005298614501953125,
-0.042388916015625,
0.0041656494140625,
-0.0150604248046875,
0.03936767578125,
-0.003940582275390625,
-0.0009694099426269531,
-0.007755279541015625,
-0.006404876708984375,
0.0033588409423828125,
-0.01129913330078125,
-0.0213775634765625,
-0.003955841064453125,
-0.03509521484375,
-0.00931549072265625,
-0.032440185546875,
0.01494598388671875,
0.006702423095703125,
-0.002941131591796875,
-0.0089874267578125,
-0.031829833984375,
-0.005535125732421875,
0.010040283203125,
-0.0447998046875,
-0.049346923828125,
0.09356689453125,
-0.01444244384765625,
0.0745849609375,
0.0176239013671875,
0.025482177734375,
0.10845947265625,
0.1046142578125,
0.0177001953125,
0.035858154296875,
-0.02606201171875,
0.034088134765625,
0.0229034423828125,
-0.0088958740234375,
-0.0295257568359375,
0.00653839111328125,
-0.01422882080078125,
0.0000889897346496582,
0.005298614501953125,
0.016082763671875,
-0.0031795501708984375,
-0.017486572265625,
-0.0078125,
0.0374755859375,
-0.01335906982421875,
-0.0411376953125,
-0.0180816650390625,
0.0167083740234375,
-0.0340576171875,
0.00037360191345214844,
-0.0007410049438476562,
-0.0260467529296875,
0.0114898681640625,
-0.00856781005859375,
0.01885986328125,
-0.04632568359375,
0.01531219482421875,
-0.0009102821350097656,
0.01183319091796875,
0.03155517578125
] |
d4c4725f55c0048c66c9b8b3548ef50a5fdd4fb8
|
Wordpress Stackexchange
Q: Upload file to remote storage I am looking to overwrite the existing upload functionality to save the file on a remote storage service. The remote storage has an HTTP interface that allow me to post file and return an addressable URL back. The reason for doing this is that the remote storage service has large amount of space and is automatically replicated for high-availability.
I have already figured out how to send files across. However, I am not sure which hook/function I should use to overwrite the existing behavior.
A: Two options:
*
*Hook into 'wp_handle_upload', a filter provided by the function wp_handle_upload() in wp-admin/includes/file.php:
apply_filters(
'wp_handle_upload',
array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload'
)
Replace the new file URI with your remote URI.
*The function wp_insert_attachment() in wp-includes/post.php offers two actions:
do_action('edit_attachment', $post_ID);
do_action('add_attachment', $post_ID);
You can get the attachment data by $post_ID and change any value here.
|
Q: Upload file to remote storage I am looking to overwrite the existing upload functionality to save the file on a remote storage service. The remote storage has an HTTP interface that allow me to post file and return an addressable URL back. The reason for doing this is that the remote storage service has large amount of space and is automatically replicated for high-availability.
I have already figured out how to send files across. However, I am not sure which hook/function I should use to overwrite the existing behavior.
A: Two options:
*
*Hook into 'wp_handle_upload', a filter provided by the function wp_handle_upload() in wp-admin/includes/file.php:
apply_filters(
'wp_handle_upload',
array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload'
)
Replace the new file URI with your remote URI.
*The function wp_insert_attachment() in wp-includes/post.php offers two actions:
do_action('edit_attachment', $post_ID);
do_action('add_attachment', $post_ID);
You can get the attachment data by $post_ID and change any value here.
|
wordpress
|
{
"language": "en",
"length": 155,
"provenance": "stackexchange_00019.jsonl.gz:419935",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52042"
}
|
[
0.04852294921875,
-0.0101318359375,
0.00997161865234375,
-0.0198822021484375,
0.0098114013671875,
-0.0213165283203125,
0.05767822265625,
-0.018218994140625,
0.0085601806640625,
-0.003559112548828125,
0.006183624267578125,
-0.0299224853515625,
-0.0005855560302734375,
-0.04803466796875,
0.031890869140625,
-0.023712158203125,
0.055816650390625,
-0.03717041015625,
0.036834716796875,
0.0017566680908203125,
-0.00536346435546875,
0.039215087890625,
0.0635986328125,
0.0030040740966796875,
0.0025310516357421875,
0.033966064453125,
-0.00865936279296875,
0.00010913610458374023,
-0.0214385986328125,
-0.01212310791015625,
0.0008950233459472656,
-0.0034427642822265625,
0.01959228515625,
0.0157928466796875,
-0.03204345703125,
-0.05035400390625,
0.02044677734375,
-0.005290985107421875,
-0.01459503173828125,
0.032073974609375,
0.0399169921875,
-0.0189361572265625,
0.0157928466796875,
0.00914764404296875,
0.007080078125,
-0.0251922607421875,
0.038299560546875,
-0.04498291015625,
0.0198516845703125,
0.0498046875,
0.0003161430358886719,
0.00885009765625,
-0.0084991455078125,
0.0357666015625,
0.0011281967163085938,
-0.004085540771484375,
-0.035369873046875,
0.043182373046875,
0.033477783203125,
-0.0267333984375,
-0.0384521484375,
0.0018835067749023438,
0.0160675048828125,
0.0157928466796875,
-0.01177978515625,
0.0134124755859375,
0.01204681396484375,
0.008697509765625,
-0.05792236328125,
-0.035491943359375,
0.032745361328125,
-0.039459228515625,
-0.0125885009765625,
0.00824737548828125,
-0.014129638671875,
0.00933074951171875,
0.0196533203125,
0.008575439453125,
-0.001705169677734375,
0.0218963623046875,
0.0048828125,
-0.0020580291748046875,
0.04217529296875,
-0.035247802734375,
0.005756378173828125,
-0.021759033203125,
-0.0179595947265625,
-0.00595855712890625,
-0.0205230712890625,
0.00955963134765625,
-0.00952911376953125,
-0.020538330078125,
-0.028350830078125,
0.038421630859375,
-0.00010675191879272461,
-0.0171051025390625,
-0.046112060546875,
-0.05670166015625,
0.00928497314453125,
0.01168060302734375,
0.02862548828125,
-0.035186767578125,
0.0214385986328125,
0.006847381591796875,
-0.0007410049438476562,
0.006488800048828125,
0.016754150390625,
-0.08941650390625,
-0.007049560546875,
0.0117340087890625,
-0.0274200439453125,
0.06805419921875,
0.0159912109375,
0.0062255859375,
-0.014373779296875,
0.005908966064453125,
-0.01271820068359375,
0.040740966796875,
-0.005126953125,
0.04144287109375,
-0.0147552490234375,
-0.00396728515625,
-0.0516357421875,
0.02734375,
0.020599365234375,
-0.007671356201171875,
-0.019287109375,
0.037567138671875,
0.005184173583984375,
0.03021240234375,
-0.033294677734375,
0.0006437301635742188,
0.060791015625,
0.01422119140625,
0.005580902099609375,
-0.0131378173828125,
0.0311737060546875,
-0.01528167724609375,
0.0017070770263671875,
0.0164794921875,
0.0443115234375,
-0.0290374755859375,
-0.0287322998046875,
0.031494140625,
0.00814056396484375,
0.0413818359375,
0.0241241455078125,
0.00537872314453125,
-0.01158905029296875,
-0.062408447265625,
0.016326904296875,
-0.038421630859375,
0.032562255859375,
-0.0126953125,
-0.016082763671875,
-0.039093017578125,
0.0377197265625,
-0.0460205078125,
-0.02288818359375,
-0.051422119140625,
0.04510498046875,
-0.0193023681640625,
-0.0379638671875,
-0.039459228515625,
-0.0540771484375,
0.0050048828125,
-0.05340576171875,
-0.010345458984375,
0.0301971435546875,
0.0460205078125,
0.0154876708984375,
-0.03643798828125,
-0.033294677734375,
0.030120849609375,
-0.001300811767578125,
0.023468017578125,
0.025238037109375,
0.038055419921875,
-0.0026073455810546875,
0.055328369140625,
0.0183563232421875,
-0.0283660888671875,
0.05426025390625,
-0.01055908203125,
-0.0367431640625,
0.046600341796875,
0.0170745849609375,
0.06646728515625,
-0.0200042724609375,
0.024383544921875,
-0.0047607421875,
0.03533935546875,
-0.00927734375,
0.00844573974609375,
-0.0225982666015625,
0.0016536712646484375,
-0.036285400390625,
0.0185546875,
-0.0341796875,
0.02313232421875,
-0.0181427001953125,
0.0171661376953125,
-0.0226593017578125,
0.00821685791015625,
-0.03692626953125,
-0.01284027099609375,
-0.01012420654296875,
0.03759765625,
-0.023681640625,
0.032867431640625,
0.00704193115234375,
0.005290985107421875,
-0.0084991455078125,
-0.0301971435546875,
0.026519775390625,
0.0051116943359375,
-0.03863525390625,
0.032379150390625,
-0.016448974609375,
0.05792236328125,
-0.0653076171875,
0.0080108642578125,
-0.04217529296875,
-0.05218505859375,
-0.01129150390625,
0.0004429817199707031,
-0.0186614990234375,
0.00893402099609375,
-0.00070953369140625,
0.0008487701416015625,
0.0285797119140625,
0.03350830078125,
0.006195068359375,
-0.014190673828125,
-0.0186920166015625,
-0.002941131591796875,
-0.0042877197265625,
-0.0875244140625,
0.00887298583984375,
0.059326171875,
0.0177001953125,
0.04144287109375,
0.0208587646484375,
0.0665283203125,
0.006961822509765625,
-0.0255279541015625,
0.028564453125,
0.0055694580078125,
0.01177215576171875,
0.0255126953125,
-0.011871337890625,
-0.0254364013671875,
0.0197906494140625,
-0.103271484375,
0.0021209716796875,
0.0299835205078125,
-0.037841796875,
-0.035614013671875,
-0.0255279541015625,
0.02264404296875,
0.003231048583984375,
-0.0093536376953125,
0.005306243896484375,
-0.0145263671875,
0.0128326416015625,
0.0128173828125,
0.0127105712890625,
0.009521484375,
-0.037994384765625,
0.0165557861328125,
0.026275634765625,
-0.0028476715087890625,
0.00951385498046875,
0.048126220703125,
0.04266357421875,
-0.00823211669921875,
-0.006786346435546875,
-0.036529541015625,
0.0124664306640625,
0.01995849609375,
-0.0227203369140625,
0.0148773193359375,
-0.0037822723388671875,
-0.007709503173828125,
-0.013397216796875,
-0.0421142578125,
0.0210113525390625,
-0.0026950836181640625,
0.0123443603515625,
-0.00824737548828125,
0.040313720703125,
0.0082855224609375,
-0.00275421142578125,
0.01409149169921875,
-0.01666259765625,
-0.031768798828125,
0.004238128662109375,
-0.004779815673828125,
0.01331329345703125,
-0.01453399658203125,
0.01812744140625,
0.050933837890625,
-0.00832366943359375,
-0.001049041748046875,
0.0139312744140625,
0.0041656494140625,
-0.0020771026611328125,
0.0161285400390625,
0.006317138671875,
0.015625,
-0.061126708984375,
-0.018280029296875,
0.016754150390625,
-0.030609130859375,
-0.0008788108825683594,
-0.02032470703125,
-0.0251312255859375,
-0.02020263671875,
-0.10009765625,
-0.05950927734375,
0.0032672882080078125,
-0.1131591796875,
0.021514892578125,
-0.0024890899658203125,
-0.061920166015625,
-0.0215606689453125,
0.06268310546875,
0.01250457763671875,
-0.0101470947265625,
-0.0033397674560546875,
-0.0142669677734375,
-0.031158447265625,
-0.05078125,
-0.0148773193359375,
0.005619049072265625,
0.006687164306640625,
0.01654052734375,
-0.0001494884490966797,
-0.0025844573974609375,
-0.029693603515625,
0.0019664764404296875,
-0.0186614990234375,
-0.00926971435546875,
-0.027313232421875,
-0.0020122528076171875,
-0.041046142578125,
0.0277862548828125,
-0.0225677490234375,
0.04840087890625,
0.03216552734375,
-0.014923095703125,
0.0186309814453125,
-0.01092529296875,
-0.0213775634765625,
-0.0190582275390625,
0.028778076171875,
0.0184173583984375,
-0.040191650390625,
-0.0240631103515625,
-0.08013916015625,
0.000762939453125,
-0.0159454345703125,
-0.028717041015625,
-0.0268402099609375,
0.01323699951171875,
-0.008392333984375,
-0.020660400390625,
-0.00318145751953125,
0.01248931884765625,
0.0005464553833007812,
0.009490966796875,
0.005523681640625,
-0.033966064453125,
-0.0128326416015625,
-0.01236724853515625,
-0.0053253173828125,
0.049560546875,
0.0152587890625,
-0.0018167495727539062,
0.0255584716796875,
0.03326416015625,
-0.0010366439819335938,
0.04827880859375,
-0.0299072265625,
-0.07061767578125,
0.042694091796875,
-0.06884765625,
0.001987457275390625,
-0.0654296875,
0.0022220611572265625,
-0.037811279296875,
0.07269287109375,
-0.001983642578125,
-0.009429931640625,
-0.007232666015625,
0.00908660888671875,
-0.018463134765625,
-0.044830322265625,
-0.0277099609375,
0.005031585693359375,
0.0037021636962890625,
-0.0023136138916015625,
-0.019439697265625,
-0.00946807861328125,
0.0152740478515625,
-0.07086181640625,
0.0200653076171875,
-0.0280609130859375,
0.0208740234375,
-0.068359375,
0.0386962890625,
0.0001087188720703125,
0.0391845703125,
-0.0262908935546875,
0.005069732666015625,
-0.0618896484375,
-0.06878662109375,
-0.0030422210693359375,
-0.0276641845703125,
0.03558349609375,
-0.01235198974609375,
0.02728271484375,
-0.0101318359375,
0.04351806640625,
0.0301361083984375,
0.017974853515625,
0.00888824462890625,
-0.016357421875,
0.0144805908203125,
-0.0264434814453125,
0.0176239013671875,
-0.0352783203125,
-0.000629425048828125,
-0.031005859375,
-0.049591064453125,
-0.06451416015625,
-0.04656982421875,
-0.046173095703125,
0.00045490264892578125,
-0.02862548828125,
-0.053070068359375,
-0.027130126953125,
-0.002079010009765625,
0.005359649658203125,
-0.017547607421875,
0.005100250244140625,
-0.0308380126953125,
-0.0576171875,
0.0265655517578125,
-0.0306243896484375,
-0.0050811767578125,
0.02691650390625,
0.04620361328125,
0.0038967132568359375,
-0.00807952880859375,
-0.11468505859375,
0.0090179443359375,
0.01389312744140625,
-0.01116180419921875,
0.01245880126953125,
-0.01070404052734375,
-0.0009427070617675781,
0.01279449462890625,
-0.0204315185546875,
0.039398193359375,
-0.0221099853515625,
0.0516357421875,
0.004085540771484375,
0.009063720703125,
0.026611328125,
0.0236053466796875,
-0.04119873046875,
-0.01812744140625,
-0.0242156982421875,
-0.0038967132568359375,
-0.0238037109375,
0.02789306640625,
0.000015139579772949219,
0.04498291015625,
-0.025238037109375,
-0.0950927734375,
0.041473388671875,
-0.09814453125,
0.0189056396484375,
0.0127410888671875,
-0.01081085205078125,
0.0545654296875,
0.01474761962890625,
-0.0145111083984375,
0.00469970703125,
0.01448822021484375,
-0.01352691650390625,
0.020599365234375,
-0.006252288818359375,
-0.027008056640625,
-0.011505126953125,
0.0157928466796875,
-0.068359375,
0.01032257080078125,
-0.0025196075439453125,
-0.07196044921875,
0.0343017578125,
-0.0033206939697265625,
-0.022186279296875,
-0.0228729248046875,
-0.0034503936767578125,
0.021087646484375,
-0.0030651092529296875,
-0.00449371337890625,
-0.0263519287109375,
0.02923583984375,
-0.034210205078125,
0.0560302734375,
0.0196075439453125,
0.0009646415710449219,
0.0287322998046875,
0.039764404296875,
0.0056304931640625,
0.0256195068359375,
-0.01525115966796875,
0.035125732421875,
0.06805419921875,
-0.0196990966796875,
0.0153045654296875,
0.032379150390625,
0.00875091552734375,
-0.049407958984375,
0.0253448486328125,
-0.03375244140625,
0.016845703125,
-0.0013628005981445312,
0.0247955322265625,
-0.0528564453125,
-0.05523681640625,
0.069580078125,
-0.031463623046875,
-0.0080718994140625,
0.0015172958374023438,
-0.00006592273712158203,
-0.01235198974609375,
-0.0012769699096679688,
0.018157958984375,
0.0100250244140625,
-0.007434844970703125,
0.01100921630859375,
-0.0008254051208496094,
-0.020843505859375,
0.0020599365234375,
0.041595458984375,
-0.0022258758544921875,
-0.041595458984375,
-0.041046142578125,
0.005191802978515625,
-0.018218994140625,
-0.0299224853515625,
0.0108642578125,
-0.023101806640625,
-0.023101806640625,
-0.00970458984375,
0.057464599609375,
-0.0290069580078125,
-0.0217437744140625,
-0.01560211181640625,
0.0231781005859375,
-0.049530029296875,
0.0168914794921875,
0.046966552734375,
0.01074981689453125,
-0.0304107666015625,
-0.007083892822265625,
-0.027252197265625,
-0.02545166015625,
0.048828125,
0.0273590087890625,
-0.0308685302734375,
-0.0160064697265625,
0.00811004638671875,
0.0292816162109375,
-0.0194854736328125,
-0.0191802978515625,
0.002216339111328125,
0.019256591796875,
0.00238037109375,
0.03948974609375,
-0.0007290840148925781,
0.033935546875,
-0.006076812744140625,
0.032989501953125,
0.00437164306640625,
-0.0157623291015625,
-0.04534912109375,
-0.0037364959716796875,
-0.0511474609375,
-0.06195068359375,
0.014556884765625,
0.0243682861328125,
0.006145477294921875,
0.0648193359375,
0.053955078125,
0.031585693359375,
0.0231170654296875,
-0.0146331787109375,
-0.00641632080078125,
-0.020751953125,
0.036865234375,
-0.0176849365234375,
0.0135345458984375,
-0.005260467529296875,
-0.0178680419921875,
0.001064300537109375,
-0.021087646484375,
-0.00556182861328125,
0.006954193115234375,
-0.003986358642578125,
-0.00649261474609375,
0.00823211669921875,
-0.01959228515625,
0.038177490234375,
0.07275390625,
-0.0027008056640625,
0.053009033203125,
0.02685546875,
0.02880859375,
0.036773681640625,
0.0006036758422851562,
0.004070281982421875,
0.007755279541015625,
0.01338958740234375,
-0.011383056640625,
0.003002166748046875,
-0.00009369850158691406,
-0.0093994140625,
0.004550933837890625,
-0.0034351348876953125,
0.0269012451171875,
-0.004199981689453125,
0.0175628662109375,
0.00022459030151367188,
-0.01393890380859375,
0.0183868408203125,
0.03424072265625,
-0.017059326171875,
-0.0175323486328125,
-0.0221099853515625,
-0.0248870849609375,
-0.016754150390625,
-0.015838623046875,
0.0048980712890625,
0.00687408447265625,
0.0005707740783691406,
0.029266357421875,
0.00914764404296875,
-0.0399169921875,
-0.024261474609375,
0.0302581787109375,
-0.0261077880859375,
0.0008759498596191406,
0.031646728515625,
-0.019805908203125,
-0.00933837890625,
-0.060577392578125,
-0.0288238525390625,
-0.00921630859375,
-0.0240631103515625,
-0.0294647216796875,
-0.026458740234375,
0.045745849609375,
0.029998779296875,
-0.009765625,
-0.0293731689453125,
0.01454925537109375,
0.010772705078125,
-0.03302001953125,
-0.02166748046875,
-0.00780487060546875,
0.04486083984375,
-0.0335693359375,
0.02093505859375,
-0.0252838134765625,
0.0033092498779296875,
0.01387786865234375,
0.0174407958984375,
0.051177978515625,
-0.059417724609375,
0.00287628173828125,
0.04034423828125,
-0.004161834716796875,
-0.01032257080078125,
0.003322601318359375,
0.05499267578125,
-0.09552001953125,
-0.07891845703125,
0.0254364013671875,
-0.054656982421875,
-0.013916015625,
0.00994110107421875,
-0.06634521484375,
0.140869140625,
0.0303192138671875,
0.04302978515625,
-0.0016422271728515625,
0.060760498046875,
-0.037933349609375,
0.033416748046875,
-0.045166015625,
0.026947021484375,
0.0191802978515625,
-0.030975341796875,
-0.021453857421875,
0.019775390625,
-0.049530029296875,
-0.0287017822265625,
0.08795166015625,
0.0249176025390625,
-0.06005859375,
-0.0179901123046875,
0.03460693359375,
0.019683837890625,
-0.01036834716796875,
0.059173583984375,
-0.002620697021484375,
-0.014068603515625,
0.01425933837890625,
0.003398895263671875,
0.0213775634765625,
0.0033931732177734375,
-0.0294036865234375,
0.0287933349609375,
0.023834228515625,
0.0184478759765625,
-0.021728515625,
0.0186920166015625,
-0.06884765625,
-0.0025196075439453125,
0.04400634765625,
-0.0005273818969726562,
-0.0059356689453125,
0.02337646484375,
0.0015554428100585938,
-0.0277557373046875,
0.035125732421875,
-0.038726806640625,
0.04510498046875,
-0.015838623046875,
-0.01233673095703125,
0.040008544921875,
0.0164947509765625,
0.0068817138671875,
-0.0062713623046875,
-0.01560211181640625,
0.0137481689453125,
0.0079345703125,
0.048126220703125,
0.0138702392578125,
0.0218505859375,
-0.04144287109375,
0.0226593017578125,
0.0416259765625,
0.06170654296875,
-0.044769287109375,
0.00017750263214111328,
0.0252227783203125,
0.00791168212890625,
-0.0192413330078125,
-0.02197265625,
0.01068115234375,
-0.05084228515625,
-0.0310211181640625,
-0.04290771484375,
0.0084228515625,
0.051239013671875,
0.034698486328125,
0.0231475830078125,
0.0220489501953125,
-0.07623291015625,
-0.031097412109375,
-0.03778076171875,
0.015899658203125,
0.0074920654296875,
0.02392578125,
0.009613037109375,
0.049530029296875,
0.009674072265625,
-0.0067291259765625,
-0.0124664306640625,
0.0245513916015625,
-0.01366424560546875,
0.027862548828125,
-0.045867919921875,
-0.054962158203125,
0.04150390625,
0.03253173828125,
0.0290069580078125,
0.0298004150390625,
0.0810546875,
0.027862548828125,
-0.0703125,
-0.0021915435791015625,
0.055450439453125,
-0.02789306640625,
0.0199127197265625,
-0.061279296875,
0.0207977294921875,
0.0145416259765625,
0.0027828216552734375,
-0.01116943359375,
-0.035308837890625,
0.07391357421875,
-0.039825439453125,
0.053802490234375,
-0.0298004150390625,
-0.035797119140625,
0.01111602783203125,
-0.04132080078125,
0.079345703125,
-0.0333251953125,
-0.04119873046875,
0.0025234222412109375,
-0.04119873046875,
-0.024871826171875,
0.011810302734375,
0.024261474609375,
-0.0275726318359375,
0.047393798828125,
0.021728515625,
-0.00789642333984375,
0.0170745849609375,
0.00560760498046875,
-0.008544921875,
-0.00576019287109375,
0.037109375,
-0.006389617919921875,
-0.0170440673828125,
-0.00698089599609375,
-0.00910186767578125,
0.03961181640625,
0.0177154541015625,
0.06878662109375,
-0.0138092041015625,
0.021820068359375,
0.0167236328125,
0.0051727294921875,
-0.0162353515625,
0.0175323486328125,
0.00846099853515625,
-0.0203094482421875,
0.0028476715087890625,
-0.01416778564453125,
0.017425537109375,
0.04144287109375,
-0.00677490234375,
-0.01861572265625,
0.0057830810546875,
-0.047027587890625,
0.01210784912109375,
0.05169677734375,
0.006824493408203125,
-0.01947021484375,
0.016204833984375,
0.0236358642578125,
-0.0099029541015625,
0.03179931640625,
-0.0030975341796875,
-0.021697998046875,
0.042327880859375,
-0.031341552734375,
-0.042816162109375,
0.0129852294921875,
-0.06280517578125,
0.0057220458984375,
0.03582763671875,
0.003021240234375,
-0.01496124267578125,
-0.02703857421875,
-0.023406982421875,
0.0123291015625,
-0.0173187255859375,
0.04058837890625,
-0.00829315185546875,
0.000942230224609375,
0.003955841064453125,
0.003765106201171875,
0.029327392578125,
-0.0203094482421875,
-0.00013566017150878906,
-0.01548004150390625,
0.01152801513671875,
0.00557708740234375,
-0.0160064697265625,
-0.005359649658203125,
-0.03411865234375,
0.0016832351684570312,
0.0198822021484375,
-0.000598907470703125,
-0.00302886962890625,
-0.00760650634765625,
0.01026153564453125,
0.037200927734375,
0.0198822021484375,
-0.06005859375,
0.042022705078125,
-0.032257080078125,
0.0195159912109375,
0.0091552734375,
0.0235748291015625,
-0.0280914306640625,
0.036376953125,
-0.0184326171875,
-0.07574462890625,
-0.036102294921875,
0.0850830078125,
-0.05926513671875,
0.0282440185546875,
0.042755126953125,
-0.0411376953125,
0.01033782958984375,
0.036041259765625,
0.03533935546875,
0.0870361328125,
-0.0235137939453125,
-0.031646728515625,
0.00720977783203125,
-0.00458526611328125,
0.0090484619140625,
0.004940032958984375,
0.0004525184631347656,
0.0066986083984375,
-0.0035915374755859375,
-0.033477783203125,
0.0068817138671875,
0.006099700927734375,
-0.041412353515625,
-0.05169677734375,
-0.016998291015625,
0.00359344482421875,
-0.037017822265625,
-0.0207977294921875,
0.0115814208984375,
-0.0150909423828125,
0.0270538330078125,
-0.004791259765625,
-0.00418853759765625,
0.0015583038330078125,
0.03436279296875,
0.00044918060302734375,
0.012603759765625,
0.0292510986328125,
-0.0167083740234375,
-0.02789306640625,
-0.0011491775512695312,
-0.002094268798828125,
0.0028076171875,
0.0169830322265625,
-0.022613525390625,
0.055206298828125,
0.0196380615234375,
-0.0224456787109375,
0.042083740234375,
0.029144287109375,
-0.0221710205078125,
-0.01287841796875,
0.00563812255859375,
-0.026214599609375,
0.036773681640625,
0.0430908203125,
0.0867919921875,
0.0171356201171875,
-0.059051513671875,
-0.029052734375,
-0.04656982421875,
0.00559234619140625,
-0.00241851806640625,
0.004024505615234375,
-0.053558349609375,
0.018096923828125,
0.0005621910095214844,
-0.0087432861328125,
-0.04254150390625,
0.0049285888671875,
-0.04534912109375,
-0.01509857177734375,
-0.00621795654296875,
-0.01116180419921875,
-0.01047515869140625,
-0.01395416259765625,
0.1246337890625,
-0.04437255859375,
0.02911376953125,
0.01335906982421875,
0.0109405517578125,
0.084716796875,
0.01519775390625,
-0.05078125,
-0.00003081560134887695,
-0.01287078857421875,
0.0257720947265625,
-0.01617431640625,
0.034332275390625,
-0.021942138671875,
0.02239990234375,
-0.0093841552734375,
-0.0164642333984375,
-0.00237274169921875,
-0.037872314453125,
-0.007266998291015625,
0.0183563232421875,
-0.0071258544921875,
0.0484619140625,
-0.04046630859375,
-0.056365966796875,
-0.0487060546875,
-0.01038360595703125,
-0.029571533203125,
0.0304718017578125,
0.0188751220703125,
-0.01384735107421875,
0.007843017578125,
0.00579071044921875,
-0.02423095703125,
-0.0143280029296875,
0.01116180419921875,
-0.0020809173583984375,
-0.0222015380859375,
0.00910186767578125
] |
ecf44c7d2e8e6121a4dff7e6488d71e07c255242
|
Wordpress Stackexchange
Q: How to get posts published between a date and today? Is it a way to get posts published between a date and today with query_posts() ?
Example : All posts published since 2012-04-01
Thanks
EDIT :
How to add the filter date on this Query Posts ?
query_posts( array(
array('post'),
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array('post-format-image')
)
),
'cat' => '-173',
'post_status' => 'publish'
) );
A: If you wish to get posts between two dates, then use the before and after parameters in the date_query parameter,
$query_string = array(
'post_type' => 'post',
'date_query' => array(
'column' => 'post_date',
'after' => '2012-04-01',
'before' => '2012-04-30'
),
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array('post-format-image')
)
),
'cat' => '-173',
'post_status' => 'publish'
);
|
Q: How to get posts published between a date and today? Is it a way to get posts published between a date and today with query_posts() ?
Example : All posts published since 2012-04-01
Thanks
EDIT :
How to add the filter date on this Query Posts ?
query_posts( array(
array('post'),
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array('post-format-image')
)
),
'cat' => '-173',
'post_status' => 'publish'
) );
A: If you wish to get posts between two dates, then use the before and after parameters in the date_query parameter,
$query_string = array(
'post_type' => 'post',
'date_query' => array(
'column' => 'post_date',
'after' => '2012-04-01',
'before' => '2012-04-30'
),
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array('post-format-image')
)
),
'cat' => '-173',
'post_status' => 'publish'
);
A: As of 3.7 you can use date_query http://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters
So the args passed would look like:
$query_string = array(
'post_type' => 'post',
'date_query' => array(
'after' => '2012-04-01'
),
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array('post-format-image')
)
),
'cat' => '-173',
'post_status' => 'publish'
);
A: UPDATE December 23 2014
There is a better method using date_query property of WP_Query class:
$args = array(
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-image' )
)
),
'cat' => '-173',
'post_status' => 'publish',
'date_query' => array(
'column' => 'post_date',
'after' => '- 30 days'
)
);
$query = new WP_Query( $args );
OLD ANSWER
Use the Time Parameters in WP_Query()
Quoting example from the Codex:
Return posts from the last 30 days:
// This takes your current query, that will have the filtering part added to.
$query_string = array(
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-image' )
)
),
'cat' => '-173',
'post_status' => 'publish'
);
// Create a new filtering function that will add our where clause to the query
function filter_where( $where = '' ) {
// posts in the last 30 days
$where .= " AND post_date > '" . date( 'Y-m-d', strtotime( '-30 days' ) ) . "'";
return $where;
}
add_filter( 'posts_where', 'filter_where' );
$query = new WP_Query( $query_string );
remove_filter( 'posts_where', 'filter_where' );
Edit
(in response to the OP's updated question).
Avoid using query_posts. You can use the above technique to alter your main query (subject to some extra conditionals - is home page, is a page called 'foobar' etc. ):
function wpse52070_filter_where( $where = '' , $query ) {
if( $query->is_main_query() && is_page( 'foobar' ) ){
// posts in the last 30 days
$where .= " AND post_date > '" . date( 'Y-m-d', strtotime( '-30 days' ) ) . "'";
}
return $where;
}
add_filter( 'posts_where', 'wpse52070_filter_where' );
|
wordpress
|
{
"language": "en",
"length": 464,
"provenance": "stackexchange_00019.jsonl.gz:419943",
"question_score": "15",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52070"
}
|
[
0.0280303955078125,
-0.01349639892578125,
-0.044647216796875,
-0.0012464523315429688,
0.02862548828125,
-0.053192138671875,
0.0712890625,
0.0140533447265625,
0.011871337890625,
0.018951416015625,
-0.023101806640625,
0.0032329559326171875,
-0.024932861328125,
-0.0185089111328125,
-0.0208892822265625,
-0.0179901123046875,
0.031585693359375,
-0.02410888671875,
0.033905029296875,
0.003566741943359375,
0.00860595703125,
0.01189422607421875,
0.0535888671875,
0.004680633544921875,
0.01165771484375,
0.0010852813720703125,
0.09295654296875,
-0.0325927734375,
0.0350341796875,
-0.024200439453125,
0.020233154296875,
-0.046173095703125,
-0.01222991943359375,
0.01312255859375,
0.028533935546875,
0.02679443359375,
-0.0170440673828125,
0.017303466796875,
0.0218505859375,
0.020355224609375,
0.020904541015625,
-0.006404876708984375,
-0.020843505859375,
0.0087890625,
-0.0175018310546875,
-0.021728515625,
0.01776123046875,
-0.01739501953125,
0.038299560546875,
0.0272216796875,
-0.00518035888671875,
0.0142822265625,
-0.00576019287109375,
0.052459716796875,
-0.02813720703125,
-0.023712158203125,
-0.0170135498046875,
0.024139404296875,
0.050018310546875,
-0.03363037109375,
-0.0556640625,
-0.0362548828125,
0.030792236328125,
-0.040435791015625,
-0.0037689208984375,
-0.003040313720703125,
0.0447998046875,
0.004962921142578125,
-0.046356201171875,
-0.0010175704956054688,
0.04656982421875,
-0.030914306640625,
-0.01422882080078125,
-0.0220947265625,
-0.0100250244140625,
-0.00762939453125,
-0.0027866363525390625,
-0.0379638671875,
0.01157379150390625,
0.0025730133056640625,
-0.01485443115234375,
0.01480865478515625,
-0.054351806640625,
-0.0265350341796875,
-0.0024433135986328125,
-0.0221710205078125,
-0.001270294189453125,
0.002040863037109375,
-0.023773193359375,
-0.044952392578125,
-0.022979736328125,
-0.011260986328125,
-0.05889892578125,
-0.004955291748046875,
-0.01399993896484375,
-0.041656494140625,
0.039947509765625,
0.0882568359375,
-0.0286407470703125,
0.0029201507568359375,
-0.061279296875,
-0.0008478164672851562,
-0.044464111328125,
-0.026519775390625,
0.033050537109375,
0.0189208984375,
-0.005847930908203125,
0.033447265625,
0.07525634765625,
0.023834228515625,
0.01181793212890625,
0.035186767578125,
-0.03582763671875,
-0.0185546875,
-0.01126861572265625,
0.038665771484375,
-0.00571441650390625,
-0.0123443603515625,
-0.0068817138671875,
-0.0076141357421875,
0.039215087890625,
0.055877685546875,
-0.038330078125,
-0.06536865234375,
0.0107879638671875,
-0.0220794677734375,
-0.036468505859375,
-0.0184326171875,
0.0391845703125,
0.058319091796875,
-0.01788330078125,
-0.004245758056640625,
0.0277557373046875,
-0.01551055908203125,
-0.0021305084228515625,
-0.035247802734375,
0.01444244384765625,
-0.051361083984375,
-0.007663726806640625,
0.01055908203125,
-0.0183258056640625,
-0.022796630859375,
0.00943756103515625,
-0.03704833984375,
-0.01294708251953125,
0.01776123046875,
0.049713134765625,
0.00702667236328125,
-0.029998779296875,
-0.0516357421875,
-0.0152130126953125,
0.00844573974609375,
0.0498046875,
-0.0091094970703125,
-0.056396484375,
-0.029632568359375,
-0.0093841552734375,
-0.024169921875,
-0.0103302001953125,
-0.043212890625,
0.028076171875,
0.039825439453125,
0.03948974609375,
-0.010528564453125,
-0.013092041015625,
-0.038116455078125,
-0.08111572265625,
-0.01081085205078125,
0.021453857421875,
-0.01346588134765625,
0.0259552001953125,
0.0073699951171875,
0.029541015625,
-0.0360107421875,
-0.03271484375,
-0.006191253662109375,
0.005901336669921875,
-0.018768310546875,
0.0218353271484375,
0.01430511474609375,
-0.0285797119140625,
-0.0306396484375,
0.041229248046875,
-0.023651123046875,
-0.016571044921875,
-0.001026153564453125,
0.035247802734375,
-0.0115966796875,
-0.038360595703125,
0.01303863525390625,
0.032745361328125,
0.04705810546875,
-0.051361083984375,
0.034820556640625,
-0.0174560546875,
-0.046875,
0.0288238525390625,
-0.0193328857421875,
0.0102996826171875,
0.01012420654296875,
-0.0172576904296875,
0.0638427734375,
-0.043670654296875,
0.040679931640625,
-0.069580078125,
0.04632568359375,
-0.0279388427734375,
0.037078857421875,
-0.052703857421875,
0.01055908203125,
0.0460205078125,
-0.00710296630859375,
-0.0234527587890625,
-0.01528167724609375,
-0.0019092559814453125,
-0.0025386810302734375,
-0.0079193115234375,
-0.003070831298828125,
-0.0024127960205078125,
0.00971221923828125,
0.00852203369140625,
-0.02484130859375,
-0.00604248046875,
0.035400390625,
0.06890869140625,
-0.0291290283203125,
0.021392822265625,
-0.0352783203125,
0.0246429443359375,
0.0299224853515625,
-0.07550048828125,
-0.00939178466796875,
0.0491943359375,
0.0166015625,
-0.0201568603515625,
0.0280303955078125,
0.04766845703125,
-0.01922607421875,
-0.01009368896484375,
0.0296630859375,
0.0283355712890625,
0.05023193359375,
0.00438690185546875,
0.00983428955078125,
0.04620361328125,
-0.091796875,
-0.01837158203125,
-0.006916046142578125,
0.01195526123046875,
0.035003662109375,
0.0113372802734375,
-0.01812744140625,
0.0301971435546875,
-0.02667236328125,
0.00843048095703125,
0.0406494140625,
0.0017404556274414062,
-0.00787353515625,
-0.01091766357421875,
0.020263671875,
-0.001087188720703125,
-0.044647216796875,
-0.031890869140625,
-0.01195526123046875,
0.00463104248046875,
-0.01715087890625,
0.023834228515625,
0.0296478271484375,
0.005237579345703125,
-0.03875732421875,
0.007061004638671875,
0.00879669189453125,
0.0201416015625,
0.020263671875,
-0.05908203125,
0.0186614990234375,
0.0074005126953125,
0.004764556884765625,
-0.0024967193603515625,
-0.005207061767578125,
-0.00675201416015625,
0.0030078887939453125,
0.053009033203125,
-0.0028820037841796875,
-0.01074981689453125,
-0.00835418701171875,
0.058197021484375,
0.0005092620849609375,
0.036773681640625,
0.0033092498779296875,
0.03076171875,
0.0133514404296875,
-0.042449951171875,
0.0721435546875,
-0.01480865478515625,
-0.03167724609375,
-0.041534423828125,
-0.06927490234375,
0.04473876953125,
-0.060394287109375,
0.046478271484375,
0.06329345703125,
-0.0172576904296875,
0.01605224609375,
-0.0035724639892578125,
0.031280517578125,
0.027618408203125,
-0.0101165771484375,
-0.023406982421875,
0.01534271240234375,
-0.042388916015625,
0.00981903076171875,
0.0161285400390625,
-0.01410675048828125,
0.01329803466796875,
-0.022430419921875,
-0.026824951171875,
-0.02935791015625,
-0.0975341796875,
-0.0694580078125,
-0.063720703125,
-0.027435302734375,
-0.0182952880859375,
0.006862640380859375,
-0.0012950897216796875,
0.0218048095703125,
-0.0012664794921875,
0.016357421875,
-0.0223846435546875,
0.007549285888671875,
-0.0270843505859375,
-0.00925445556640625,
-0.01505279541015625,
0.0170745849609375,
-0.004871368408203125,
0.0003304481506347656,
-0.006793975830078125,
0.121826171875,
0.0274810791015625,
-0.1036376953125,
-0.033447265625,
-0.00244140625,
-0.056243896484375,
0.03759765625,
-0.0101776123046875,
0.018585205078125,
0.0221710205078125,
-0.001003265380859375,
0.041107177734375,
0.046722412109375,
-0.052703857421875,
0.005428314208984375,
0.006793975830078125,
0.01971435546875,
0.0124664306640625,
0.01206207275390625,
-0.0179443359375,
0.042999267578125,
0.01422882080078125,
-0.0184783935546875,
-0.026763916015625,
-0.0019474029541015625,
-0.056640625,
0.0091552734375,
0.042144775390625,
-0.01119232177734375,
-0.0029754638671875,
-0.01153564453125,
-0.0260009765625,
-0.0303192138671875,
0.03515625,
-0.046661376953125,
0.00431060791015625,
-0.001293182373046875,
-0.015869140625,
-0.0030918121337890625,
-0.0204925537109375,
-0.0179443359375,
0.04217529296875,
-0.020660400390625,
0.0303802490234375,
-0.03460693359375,
0.056304931640625,
-0.07220458984375,
-0.057403564453125,
0.04925537109375,
-0.0177459716796875,
-0.0286865234375,
-0.042816162109375,
-0.03082275390625,
-0.01264190673828125,
0.07440185546875,
-0.0200042724609375,
0.0011320114135742188,
-0.01084136962890625,
-0.002635955810546875,
-0.039031982421875,
-0.0338134765625,
-0.03704833984375,
0.0019025802612304688,
-0.07525634765625,
0.0095977783203125,
-0.0301971435546875,
-0.00957489013671875,
-0.0182037353515625,
0.0194854736328125,
-0.032073974609375,
-0.0479736328125,
0.0362548828125,
0.01434326171875,
-0.003570556640625,
0.033905029296875,
-0.01003265380859375,
0.019775390625,
-0.03564453125,
0.0017347335815429688,
-0.0244140625,
-0.0189056396484375,
0.031585693359375,
0.0163726806640625,
-0.0000059604644775390625,
-0.00797271728515625,
0.022979736328125,
0.04425048828125,
0.0285491943359375,
0.0304107666015625,
-0.0033206939697265625,
-0.0146484375,
0.0264434814453125,
-0.01959228515625,
0.005382537841796875,
-0.0174560546875,
-0.0010585784912109375,
-0.01434326171875,
0.01120758056640625,
0.0426025390625,
-0.03033447265625,
0.0265045166015625,
-0.0206146240234375,
0.0023479461669921875,
-0.02203369140625,
-0.004077911376953125,
0.00502777099609375,
0.01812744140625,
-0.035186767578125,
-0.005001068115234375,
-0.00965118408203125,
-0.016693115234375,
0.07757568359375,
0.0498046875,
-0.00768280029296875,
-0.0153961181640625,
0.098876953125,
0.01305389404296875,
-0.05352783203125,
-0.042999267578125,
-0.02142333984375,
0.0467529296875,
0.0019664764404296875,
0.0054473876953125,
0.01015472412109375,
-0.035980224609375,
0.03619384765625,
0.0026988983154296875,
-0.040924072265625,
-0.038787841796875,
0.066650390625,
-0.003528594970703125,
-0.0004596710205078125,
-0.0178070068359375,
-0.06768798828125,
0.0673828125,
0.05560302734375,
-0.0033550262451171875,
-0.01239776611328125,
-0.0162811279296875,
0.052947998046875,
-0.006267547607421875,
0.0160369873046875,
-0.0404052734375,
-0.03192138671875,
0.016632080078125,
0.020111083984375,
0.00661468505859375,
0.016387939453125,
0.0015621185302734375,
0.0050811767578125,
0.0200653076171875,
-0.00791168212890625,
-0.01377105712890625,
-0.0223236083984375,
-0.0180511474609375,
0.033905029296875,
-0.044281005859375,
-0.0390625,
0.018341064453125,
0.0257720947265625,
0.006214141845703125,
-0.01468658447265625,
-0.027130126953125,
-0.01157379150390625,
-0.01068878173828125,
-0.03485107421875,
0.0153350830078125,
-0.0303192138671875,
0.0277252197265625,
0.054351806640625,
0.018402099609375,
0.002971649169921875,
-0.044036865234375,
0.06427001953125,
-0.017822265625,
0.0162506103515625,
-0.003108978271484375,
-0.005657196044921875,
0.045562744140625,
0.03460693359375,
0.0088043212890625,
0.037689208984375,
-0.043487548828125,
0.02593994140625,
0.00415802001953125,
0.01080322265625,
0.007259368896484375,
0.02862548828125,
-0.01514434814453125,
0.0116424560546875,
-0.01045989990234375,
-0.038726806640625,
0.0062255859375,
0.0121002197265625,
0.01050567626953125,
-0.005039215087890625,
0.00629425048828125,
0.03778076171875,
0.046783447265625,
-0.056396484375,
-0.019134521484375,
0.07232666015625,
0.04266357421875,
-0.0257110595703125,
-0.05523681640625,
-0.01433563232421875,
0.08392333984375,
-0.0174102783203125,
0.01128387451171875,
-0.035614013671875,
0.034942626953125,
-0.00405120849609375,
0.036346435546875,
-0.02685546875,
-0.029632568359375,
0.00838470458984375,
-0.032806396484375,
-0.031219482421875,
0.0037136077880859375,
0.028289794921875,
-0.0299530029296875,
-0.02752685546875,
0.0474853515625,
-0.048004150390625,
0.020965576171875,
-0.04156494140625,
0.0271148681640625,
-0.0423583984375,
-0.0076904296875,
0.08612060546875,
0.06396484375,
-0.037078857421875,
-0.00847625732421875,
-0.0450439453125,
-0.0264892578125,
0.00957489013671875,
-0.01497650146484375,
-0.0290374755859375,
-0.00746917724609375,
0.048187255859375,
0.043975830078125,
-0.000865936279296875,
-0.07745361328125,
-0.0294952392578125,
-0.03533935546875,
0.041717529296875,
0.02032470703125,
-0.0028820037841796875,
0.077880859375,
-0.01226043701171875,
0.07037353515625,
0.01959228515625,
0.037109375,
-0.061370849609375,
-0.024200439453125,
-0.00872039794921875,
-0.06683349609375,
-0.01751708984375,
0.030181884765625,
-0.03265380859375,
-0.00984954833984375,
-0.00820159912109375,
0.0011005401611328125,
0.011688232421875,
-0.01515960693359375,
-0.0082550048828125,
-0.006549835205078125,
-0.005466461181640625,
0.01548004150390625,
0.0258941650390625,
0.0236663818359375,
-0.0200653076171875,
0.0311737060546875,
0.0101165771484375,
0.0360107421875,
0.0020275115966796875,
-0.030548095703125,
0.02484130859375,
0.01031494140625,
0.0028285980224609375,
0.01233673095703125,
0.07635498046875,
0.0136566162109375,
0.05267333984375,
0.0164947509765625,
0.02862548828125,
0.0044708251953125,
-0.00878143310546875,
-0.009124755859375,
0.0007729530334472656,
0.04254150390625,
-0.007030487060546875,
-0.02032470703125,
0.03472900390625,
-0.01690673828125,
0.021026611328125,
0.012115478515625,
0.0274505615234375,
-0.035980224609375,
0.020721435546875,
0.00015783309936523438,
-0.0277862548828125,
0.0321044921875,
0.007595062255859375,
0.0036144256591796875,
0.0191650390625,
0.0173797607421875,
-0.0213165283203125,
-0.0228424072265625,
0.0175323486328125,
0.00827789306640625,
-0.00727081298828125,
-0.00469970703125,
0.037567138671875,
0.0089874267578125,
-0.052642822265625,
-0.01502227783203125,
0.015350341796875,
-0.018310546875,
0.025848388671875,
-0.01129913330078125,
-0.031158447265625,
0.00577545166015625,
-0.037384033203125,
-0.01358795166015625,
-0.04510498046875,
0.003063201904296875,
-0.0011692047119140625,
-0.00962066650390625,
0.05413818359375,
0.01384735107421875,
0.0098114013671875,
-0.0196380615234375,
0.021484375,
-0.0117645263671875,
-0.04248046875,
0.01195526123046875,
0.0276336669921875,
0.033905029296875,
-0.015411376953125,
0.0276336669921875,
-0.024444580078125,
-0.0149383544921875,
-0.01953125,
-0.0343017578125,
0.042724609375,
-0.019287109375,
-0.02423095703125,
0.01459503173828125,
0.021240234375,
0.00576019287109375,
-0.0048675537109375,
0.005313873291015625,
-0.0286865234375,
0.007625579833984375,
-0.00705718994140625,
0.017913818359375,
0.0186920166015625,
-0.0021305084228515625,
-0.05426025390625,
0.058685302734375,
-0.034698486328125,
0.03228759765625,
0.0242156982421875,
0.0131378173828125,
-0.0221099853515625,
-0.0155181884765625,
-0.031707763671875,
0.042694091796875,
-0.0013637542724609375,
-0.004974365234375,
-0.045257568359375,
-0.00107574462890625,
-0.0301971435546875,
0.0275421142578125,
0.0670166015625,
0.0222015380859375,
-0.043914794921875,
-0.02471923828125,
0.047149658203125,
0.03607177734375,
-0.002567291259765625,
0.038116455078125,
0.01198577880859375,
0.0269317626953125,
0.0162353515625,
-0.06524658203125,
0.0277862548828125,
-0.031463623046875,
-0.0099029541015625,
0.034576416015625,
-0.00228118896484375,
0.01406097412109375,
0.0330810546875,
-0.01168060302734375,
0.038421630859375,
0.006977081298828125,
-0.0202484130859375,
-0.052734375,
0.0142364501953125,
0.024932861328125,
0.0478515625,
-0.059417724609375,
-0.034698486328125,
-0.01232147216796875,
0.029815673828125,
0.0174560546875,
-0.005870819091796875,
0.0208587646484375,
0.018646240234375,
0.0113067626953125,
-0.0290985107421875,
-0.0077667236328125,
0.0109100341796875,
-0.0135040283203125,
0.0657958984375,
0.0188446044921875,
0.0213775634765625,
-0.051788330078125,
0.0034637451171875,
0.065673828125,
0.0924072265625,
-0.038421630859375,
0.01517486572265625,
0.00482177734375,
-0.00004976987838745117,
-0.021453857421875,
-0.050933837890625,
-0.056121826171875,
-0.00423431396484375,
0.042694091796875,
0.0015039443969726562,
-0.022064208984375,
-0.01042938232421875,
0.033203125,
0.0130767822265625,
0.0225982666015625,
-0.0032749176025390625,
-0.0119781494140625,
-0.06396484375,
-0.0004203319549560547,
0.0274658203125,
0.07098388671875,
0.0240936279296875,
0.0721435546875,
-0.003932952880859375,
-0.048187255859375,
0.030181884765625,
-0.031768798828125,
0.009307861328125,
-0.034454345703125,
0.03033447265625,
-0.0020923614501953125,
-0.02191162109375,
0.0187225341796875,
0.009429931640625,
0.01407623291015625,
0.01922607421875,
0.0278778076171875,
0.006866455078125,
-0.01366424560546875,
0.00804901123046875,
-0.0226287841796875,
-0.029754638671875,
-0.0369873046875,
-0.036163330078125,
-0.0212554931640625,
-0.018463134765625,
0.017486572265625,
0.0181121826171875,
-0.0185089111328125,
-0.0450439453125,
0.0288238525390625,
-0.004119873046875,
-0.00189208984375,
0.020782470703125,
0.0215911865234375,
-0.00171661376953125,
-0.0221099853515625,
-0.037567138671875,
0.0088958740234375,
-0.05499267578125,
-0.0241851806640625,
0.0178070068359375,
0.019317626953125,
-0.034423828125,
0.038970947265625,
0.03955078125,
-0.0265350341796875,
0.0198211669921875,
0.02593994140625,
0.006103515625,
0.0107421875,
0.01358795166015625,
-0.007701873779296875,
-0.0297698974609375,
-0.005908966064453125,
-0.0467529296875,
0.041778564453125,
0.01763916015625,
0.029571533203125,
-0.0032501220703125,
0.03887939453125,
-0.0290069580078125,
0.012298583984375,
-0.053314208984375,
-0.037200927734375,
0.039337158203125,
-0.027008056640625,
-0.016571044921875,
0.0178985595703125,
0.04736328125,
-0.0157928466796875,
0.04827880859375,
-0.0625,
-0.0255889892578125,
-0.0218048095703125,
0.0265655517578125,
-0.0088653564453125,
0.019989013671875,
-0.031402587890625,
-0.0132293701171875,
-0.00380706787109375,
0.00018596649169921875,
0.00848388671875,
-0.029632568359375,
-0.0236663818359375,
0.008880615234375,
0.05535888671875,
-0.0185089111328125,
0.0394287109375,
-0.020965576171875,
0.06976318359375,
0.0312042236328125,
-0.0152740478515625,
0.053070068359375,
-0.017486572265625,
-0.0088653564453125,
-0.0022182464599609375,
0.0269775390625,
-0.0259552001953125,
-0.033905029296875,
0.070068359375,
-0.02294921875,
-0.029388427734375,
0.020477294921875,
-0.0180206298828125,
-0.005252838134765625,
-0.011444091796875,
0.0009531974792480469,
-0.019012451171875,
-0.0177001953125,
0.0042572021484375,
0.00324249267578125,
-0.031494140625,
-0.00928497314453125,
0.00861358642578125,
-0.05487060546875,
0.0097808837890625,
-0.00214385986328125,
0.0086517333984375,
0.0186614990234375,
-0.06982421875,
0.0360107421875,
0.0117950439453125,
0.007221221923828125,
-0.0256500244140625,
-0.01236724853515625,
0.0083160400390625,
-0.00994110107421875,
-0.036407470703125,
0.03131103515625,
-0.0247650146484375,
-0.0196533203125,
0.01129150390625,
-0.00565338134765625,
0.03216552734375,
-0.00684356689453125,
-0.042877197265625,
-0.0013971328735351562,
-0.0178070068359375,
0.0396728515625,
-0.0164337158203125,
0.0005779266357421875,
-0.004608154296875,
0.01537322998046875,
-0.048980712890625,
-0.047515869140625,
0.0411376953125,
-0.0294647216796875,
-0.03985595703125,
0.005542755126953125,
-0.028411865234375,
0.0026302337646484375,
-0.0194244384765625,
-0.055816650390625,
0.061004638671875,
-0.01019287109375,
-0.020660400390625,
-0.03271484375,
0.0185089111328125,
0.01216888427734375,
-0.0013647079467773438,
-0.00791168212890625,
-0.0118560791015625,
-0.04327392578125,
-0.01441192626953125,
-0.0032329559326171875,
0.055816650390625,
-0.01690673828125,
-0.021392822265625,
-0.03582763671875,
-0.0248260498046875,
-0.03204345703125,
0.002651214599609375,
0.0093994140625,
0.0186614990234375,
0.00846099853515625,
0.020904541015625,
-0.02618408203125,
0.057464599609375,
0.005039215087890625,
0.0089263916015625,
-0.02783203125,
-0.016693115234375,
-0.0247650146484375,
0.0009746551513671875,
0.052734375,
0.10028076171875,
0.0322265625,
-0.05615234375,
0.0318603515625,
-0.01068878173828125,
-0.03143310546875,
0.0145416259765625,
0.0034923553466796875,
-0.0226593017578125,
-0.00812530517578125,
0.005847930908203125,
-0.0095977783203125,
0.0259552001953125,
-0.043853759765625,
-0.0123443603515625,
-0.007137298583984375,
-0.0235748291015625,
0.00893402099609375,
-0.03411865234375,
0.037750244140625,
-0.005252838134765625,
-0.0211334228515625,
0.0009908676147460938,
0.002532958984375,
-0.02752685546875,
-0.005214691162109375,
0.0298919677734375,
-0.0206451416015625,
0.035919189453125,
-0.0034046173095703125,
-0.047821044921875,
0.0194549560546875,
-0.01788330078125,
0.0460205078125,
0.032958984375,
0.0027713775634765625,
-0.006923675537109375,
-0.006664276123046875,
-0.05426025390625,
0.01438140869140625,
0.01251220703125,
-0.04083251953125,
0.08538818359375,
0.004245758056640625,
0.0693359375,
-0.00397491455078125,
0.056182861328125,
0.0018148422241210938,
-0.0222930908203125,
0.0017414093017578125,
-0.031585693359375,
0.002201080322265625,
0.004730224609375,
-0.005771636962890625,
0.00435638427734375,
-0.00585174560546875,
-0.0223846435546875,
0.0036411285400390625,
-0.00989532470703125
] |
d8e91858371c3973a1e3338ce4f364c9eb7f70bf
|
Wordpress Stackexchange
Q: Admin Page Redirect Is it possible to redirect users to an admin page if they access another admin page?
For example if they a user ever hits "all pages" /wp-admin/edit.php?post_type=page
they would get redirected to "add New page" /wp-admin/post-new.php?post_type=page
A: Michael's solution appears to be intended for use inside a class, so for anyone wanting a standalone function which will work directly in functions.php, the example below includes a redirect from customize.php to a theme options page and the one from Michael's original function.
function admin_redirects() {
global $pagenow;
/* Redirect Customizer to Theme options */
if($pagenow == 'customize.php'){
wp_redirect(admin_url('/admin.php?page=theme_options', 'http'), 301);
exit;
}
/* OP's redirect from /wp-admin/edit.php?post_type=page */
if($pagenow == 'edit.php' && isset($_GET['post_type']) && $_GET['post_type'] == 'page'){
wp_redirect(admin_url('/post-new.php?post_type=page', 'http'), 301);
exit;
}
}
add_action('admin_init', 'admin_redirects');
|
Q: Admin Page Redirect Is it possible to redirect users to an admin page if they access another admin page?
For example if they a user ever hits "all pages" /wp-admin/edit.php?post_type=page
they would get redirected to "add New page" /wp-admin/post-new.php?post_type=page
A: Michael's solution appears to be intended for use inside a class, so for anyone wanting a standalone function which will work directly in functions.php, the example below includes a redirect from customize.php to a theme options page and the one from Michael's original function.
function admin_redirects() {
global $pagenow;
/* Redirect Customizer to Theme options */
if($pagenow == 'customize.php'){
wp_redirect(admin_url('/admin.php?page=theme_options', 'http'), 301);
exit;
}
/* OP's redirect from /wp-admin/edit.php?post_type=page */
if($pagenow == 'edit.php' && isset($_GET['post_type']) && $_GET['post_type'] == 'page'){
wp_redirect(admin_url('/post-new.php?post_type=page', 'http'), 301);
exit;
}
}
add_action('admin_init', 'admin_redirects');
A: /**
* Redirect admin pages.
*
* Redirect specific admin page to another specific admin page.
*
* @return void
* @author Michael Ecklund
*
*/
function disallowed_admin_pages() {
global $pagenow;
# Check current admin page.
if ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'page' ) {
wp_redirect( admin_url( '/post-new.php?post_type=page' ) );
exit;
}
}
Fire the above function on the hook admin_init.
add_action( 'admin_init', 'disallowed_admin_pages' );
Alternate syntax:
/**
* Redirect admin pages.
*
* Redirect specific admin page to another specific admin page.
*
* @return void
* @author Michael Ecklund
*
*/
add_action( 'admin_init', function () {
global $pagenow;
# Check current admin page.
if ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'page' ) {
wp_redirect( admin_url( '/post-new.php?post_type=page' ) );
exit;
}
} );
A: Yes this is possible by adding an action to admin_init, at that point you could check the request uri to see if it matches /wp-admin/edit.php?post_type=page and if it does issue a redirect to the add posts page: /wp-admin/post-new.php?post_type=page.
Also the Plugin API and the action reference pages on the WordPress codex go into more detail about actions and how they work.
|
wordpress
|
{
"language": "en",
"length": 326,
"provenance": "stackexchange_00019.jsonl.gz:419958",
"question_score": "22",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52114"
}
|
[
0.09375,
-0.007801055908203125,
0.057281494140625,
-0.033203125,
0.0035572052001953125,
-0.01505279541015625,
0.047760009765625,
-0.063232421875,
-0.048614501953125,
0.0015020370483398438,
0.031585693359375,
-0.016448974609375,
-0.0303802490234375,
-0.050262451171875,
0.0169830322265625,
-0.031890869140625,
0.0218353271484375,
-0.0087890625,
0.0262451171875,
-0.0106658935546875,
-0.01165008544921875,
0.0059661865234375,
0.054595947265625,
0.0034332275390625,
-0.0180816650390625,
0.01580810546875,
0.03887939453125,
-0.026458740234375,
-0.0179595947265625,
-0.0182037353515625,
-0.007503509521484375,
0.00003784894943237305,
0.0202178955078125,
0.029998779296875,
-0.01088714599609375,
-0.023284912109375,
-0.01439666748046875,
0.028533935546875,
0.0242767333984375,
-0.0098876953125,
0.031280517578125,
-0.0164031982421875,
0.002323150634765625,
0.0294342041015625,
-0.006397247314453125,
-0.049713134765625,
0.04034423828125,
-0.0220794677734375,
-0.00621795654296875,
0.0009760856628417969,
0.0237884521484375,
-0.03680419921875,
0.032012939453125,
-0.02349853515625,
-0.0133819580078125,
0.0013856887817382812,
0.01476287841796875,
-0.0264892578125,
0.03521728515625,
0.0008459091186523438,
-0.0214691162109375,
-0.0241241455078125,
0.0208587646484375,
-0.031524658203125,
-0.01386260986328125,
0.0007567405700683594,
-0.01271820068359375,
0.021881103515625,
-0.06939697265625,
-0.011474609375,
0.02880859375,
-0.03424072265625,
-0.000025272369384765625,
0.00833892822265625,
0.01399993896484375,
-0.0298004150390625,
0.02325439453125,
0.016021728515625,
-0.0006508827209472656,
0.053924560546875,
0.0178680419921875,
0.0093841552734375,
0.00016498565673828125,
-0.04400634765625,
0.03509521484375,
-0.0002944469451904297,
-0.021240234375,
-0.0204315185546875,
-0.03155517578125,
-0.031097412109375,
-0.035552978515625,
-0.006870269775390625,
-0.024627685546875,
0.00736236572265625,
-0.021881103515625,
-0.007434844970703125,
0.0350341796875,
0.044830322265625,
0.0328369140625,
0.026275634765625,
-0.0224456787109375,
-0.049041748046875,
0.0220489501953125,
-0.039794921875,
0.0200958251953125,
0.05059814453125,
0.001239776611328125,
-0.0162353515625,
0.027557373046875,
-0.0033626556396484375,
0.0006647109985351562,
0.01364898681640625,
-0.035614013671875,
-0.0084991455078125,
-0.004375457763671875,
0.02020263671875,
-0.0638427734375,
0.005458831787109375,
-0.010345458984375,
0.0185089111328125,
-0.01142120361328125,
0.012725830078125,
0.043975830078125,
-0.0271759033203125,
0.00434112548828125,
-0.0014429092407226562,
-0.034149169921875,
-0.0465087890625,
0.046142578125,
-0.014556884765625,
-0.0197601318359375,
0.00530242919921875,
0.0305023193359375,
0.0258636474609375,
0.021728515625,
-0.00676727294921875,
0.033050537109375,
-0.045318603515625,
0.0009484291076660156,
0.001094818115234375,
0.04827880859375,
-0.0273284912109375,
-0.032379150390625,
0.005970001220703125,
0.01331329345703125,
0.05401611328125,
0.01523590087890625,
-0.019744873046875,
0.0027484893798828125,
-0.0611572265625,
-0.01111602783203125,
-0.036285400390625,
0.012847900390625,
0.0205078125,
0.0067138671875,
0.00411224365234375,
0.01019287109375,
0.002223968505859375,
-0.007904052734375,
0.0027923583984375,
0.03753662109375,
0.00528717041015625,
0.032073974609375,
-0.01149749755859375,
-0.057220458984375,
0.0034961700439453125,
-0.07196044921875,
-0.0299530029296875,
0.0189056396484375,
-0.009368896484375,
0.0677490234375,
-0.04437255859375,
-0.0033130645751953125,
-0.005054473876953125,
-0.00804901123046875,
-0.002777099609375,
0.001232147216796875,
-0.00415802001953125,
0.0310211181640625,
0.05828857421875,
0.0257720947265625,
0.002155303955078125,
0.040496826171875,
0.02142333984375,
-0.04022216796875,
0.06243896484375,
-0.008270263671875,
0.0362548828125,
0.001369476318359375,
-0.0007848739624023438,
0.03125,
0.045745849609375,
-0.01476287841796875,
0.025390625,
-0.04144287109375,
-0.0377197265625,
0.003841400146484375,
0.0201873779296875,
-0.037384033203125,
0.00620269775390625,
-0.0030155181884765625,
0.029296875,
-0.00559234619140625,
0.0182342529296875,
-0.0113067626953125,
0.0208587646484375,
-0.0132904052734375,
0.0291748046875,
0.03741455078125,
0.0187530517578125,
-0.01373291015625,
-0.012939453125,
-0.0030994415283203125,
-0.0185089111328125,
-0.0308685302734375,
0.0258026123046875,
-0.00009882450103759766,
0.06695556640625,
-0.0128021240234375,
0.045196533203125,
-0.004787445068359375,
-0.05841064453125,
-0.01071929931640625,
-0.00628662109375,
0.035797119140625,
-0.0020427703857421875,
-0.019561767578125,
-0.02423095703125,
-0.005764007568359375,
0.007472991943359375,
-0.054901123046875,
0.055511474609375,
0.02099609375,
0.0029735565185546875,
-0.042236328125,
-0.0120391845703125,
-0.00247955322265625,
-0.04608154296875,
0.005397796630859375,
0.061248779296875,
0.0302886962890625,
0.0298004150390625,
-0.0219573974609375,
0.0048828125,
0.02252197265625,
-0.056549072265625,
0.0068359375,
-0.010284423828125,
0.0274200439453125,
0.060150146484375,
-0.01171112060546875,
-0.0027675628662109375,
0.019439697265625,
-0.0160369873046875,
-0.01296234130859375,
0.049224853515625,
-0.006988525390625,
-0.005687713623046875,
-0.0146331787109375,
0.0020751953125,
0.0024662017822265625,
-0.038848876953125,
-0.0305633544921875,
0.001300811767578125,
0.029388427734375,
-0.01244354248046875,
0.0123748779296875,
-0.00893402099609375,
-0.037445068359375,
-0.0228729248046875,
0.0396728515625,
-0.003978729248046875,
0.0033626556396484375,
0.0269317626953125,
0.0276641845703125,
-0.0791015625,
-0.04638671875,
0.01094818115234375,
0.027374267578125,
-0.01018524169921875,
-0.018768310546875,
0.0165557861328125,
-0.040771484375,
-0.0195770263671875,
-0.000045299530029296875,
-0.036834716796875,
-0.009124755859375,
-0.00205230712890625,
0.0278472900390625,
0.0033016204833984375,
0.0430908203125,
-0.017181396484375,
-0.021942138671875,
0.01444244384765625,
0.00870513916015625,
-0.0526123046875,
0.040435791015625,
-0.036773681640625,
0.03656005859375,
-0.0119781494140625,
0.07794189453125,
0.06622314453125,
-0.019683837890625,
0.041839599609375,
-0.0003745555877685547,
0.026275634765625,
0.025146484375,
-0.00806427001953125,
-0.0072479248046875,
-0.0264434814453125,
-0.0299224853515625,
-0.0282745361328125,
0.017822265625,
0.0081634521484375,
0.0239105224609375,
-0.02496337890625,
0.01302337646484375,
0.006500244140625,
-0.0634765625,
-0.0635986328125,
-0.07354736328125,
-0.0634765625,
0.006679534912109375,
-0.00580596923828125,
-0.0188446044921875,
0.00698089599609375,
0.0212249755859375,
0.0251922607421875,
0.02520751953125,
-0.0126953125,
-0.03424072265625,
-0.0199737548828125,
-0.044342041015625,
-0.028045654296875,
-0.01251983642578125,
-0.0155487060546875,
0.0007305145263671875,
0.0258026123046875,
-0.006076812744140625,
-0.054168701171875,
0.01195526123046875,
0.0265350341796875,
0.0160369873046875,
0.0261993408203125,
-0.01203155517578125,
-0.009429931640625,
0.032806396484375,
-0.0005636215209960938,
0.06549072265625,
0.0155792236328125,
0.0065460205078125,
-0.0245361328125,
-0.0256805419921875,
-0.03167724609375,
0.00435638427734375,
-0.048553466796875,
0.0210113525390625,
-0.0279998779296875,
-0.02777099609375,
-0.059844970703125,
-0.0017805099487304688,
-0.002849578857421875,
-0.03558349609375,
0.0083160400390625,
0.02008056640625,
-0.026397705078125,
0.026702880859375,
-0.030426025390625,
0.0273284912109375,
0.00423431396484375,
0.0174713134765625,
-0.02325439453125,
0.0266265869140625,
0.0007181167602539062,
0.0289154052734375,
-0.037200927734375,
0.0026798248291015625,
-0.0269622802734375,
0.035430908203125,
0.009613037109375,
0.00412750244140625,
0.022125244140625,
-0.01345062255859375,
-0.0018606185913085938,
-0.089111328125,
0.033294677734375,
-0.046417236328125,
-0.0056610107421875,
-0.038330078125,
-0.009124755859375,
0.01007080078125,
0.102294921875,
-0.0372314453125,
0.01125335693359375,
-0.050262451171875,
-0.0019006729125976562,
-0.0207977294921875,
-0.06256103515625,
-0.035308837890625,
0.0201568603515625,
-0.09906005859375,
-0.0124053955078125,
-0.0188751220703125,
-0.0312347412109375,
-0.031524658203125,
0.05584716796875,
-0.06536865234375,
-0.038787841796875,
0.0293731689453125,
-0.022979736328125,
0.03338623046875,
0.034088134765625,
-0.00467681884765625,
0.0205841064453125,
-0.024200439453125,
-0.039031982421875,
-0.080322265625,
-0.00878143310546875,
-0.00882720947265625,
0.0626220703125,
0.021728515625,
-0.03643798828125,
-0.028717041015625,
0.021209716796875,
0.01461029052734375,
-0.0078582763671875,
-0.03131103515625,
-0.0104827880859375,
-0.045928955078125,
-0.0198516845703125,
-0.02960205078125,
-0.017547607421875,
0.0033893585205078125,
0.0014772415161132812,
-0.0178985595703125,
-0.004863739013671875,
-0.042205810546875,
-0.037109375,
-0.00701904296875,
-0.0227813720703125,
-0.08294677734375,
-0.00818634033203125,
-0.021575927734375,
0.000049114227294921875,
-0.022674560546875,
-0.01259613037109375,
-0.006500244140625,
-0.108642578125,
0.040679931640625,
-0.029876708984375,
-0.020782470703125,
0.00238800048828125,
0.024566650390625,
0.016876220703125,
-0.0242919921875,
0.0178375244140625,
0.032806396484375,
0.0328369140625,
0.006465911865234375,
0.06256103515625,
0.0186767578125,
-0.0028476715087890625,
0.0560302734375,
0.01299285888671875,
-0.0225372314453125,
-0.03204345703125,
0.06005859375,
-0.0003104209899902344,
-0.03790283203125,
0.02508544921875,
-0.053741455078125,
0.03759765625,
0.02593994140625,
-0.010589599609375,
-0.01358795166015625,
-0.0328369140625,
0.02960205078125,
-0.01151275634765625,
0.0222930908203125,
-0.03271484375,
-0.04656982421875,
0.00878143310546875,
0.035858154296875,
0.0079345703125,
0.0163726806640625,
-0.00643157958984375,
0.0270233154296875,
-0.01287078857421875,
-0.00022530555725097656,
0.043792724609375,
0.033538818359375,
0.000012814998626708984,
0.042266845703125,
-0.00525665283203125,
-0.009918212890625,
0.01483917236328125,
-0.00492095947265625,
0.007411956787109375,
0.0026035308837890625,
-0.05169677734375,
0.0154876708984375,
-0.004241943359375,
-0.0052642822265625,
0.0127105712890625,
-0.006816864013671875,
0.03094482421875,
0.0227813720703125,
-0.00421142578125,
-0.03009033203125,
-0.00804901123046875,
0.00402069091796875,
-0.041229248046875,
0.0191802978515625,
0.01232147216796875,
0.0007486343383789062,
0.034423828125,
0.09002685546875,
0.032958984375,
0.0582275390625,
-0.04144287109375,
0.03228759765625,
0.02301025390625,
0.022491455078125,
0.008636474609375,
0.027740478515625,
-0.0010023117065429688,
-0.010711669921875,
0.0051422119140625,
-0.04412841796875,
-0.01433563232421875,
0.042755126953125,
0.059417724609375,
0.021453857421875,
-0.01380157470703125,
-0.004138946533203125,
-0.006816864013671875,
-0.0297393798828125,
0.044647216796875,
0.033203125,
-0.0526123046875,
-0.0272064208984375,
0.036651611328125,
0.04156494140625,
0.000054955482482910156,
-0.0225372314453125,
0.034759521484375,
-0.03558349609375,
0.0210113525390625,
-0.01708984375,
-0.0243988037109375,
-0.0027103424072265625,
0.0017299652099609375,
-0.0357666015625,
-0.0211029052734375,
0.001560211181640625,
-0.0005459785461425781,
-0.018524169921875,
-0.032012939453125,
-0.01432037353515625,
0.03326416015625,
-0.0023250579833984375,
0.0037078857421875,
-0.00316619873046875,
-0.017364501953125,
0.0005927085876464844,
-0.005523681640625,
0.07763671875,
0.018157958984375,
-0.01824951171875,
0.024169921875,
-0.051727294921875,
-0.01396942138671875,
-0.01491546630859375,
-0.0287017822265625,
-0.017242431640625,
-0.0180206298828125,
0.0355224609375,
0.012542724609375,
0.02435302734375,
-0.00957489013671875,
-0.0204315185546875,
0.0034656524658203125,
0.01392364501953125,
0.021331787109375,
-0.00476837158203125,
0.066162109375,
-0.024993896484375,
0.04205322265625,
-0.0018177032470703125,
0.0171966552734375,
-0.01554107666015625,
-0.00449371337890625,
0.01284027099609375,
-0.0254364013671875,
-0.0226593017578125,
-0.0181427001953125,
0.01416015625,
-0.007656097412109375,
0.0062408447265625,
-0.0136260986328125,
0.00975799560546875,
0.005039215087890625,
0.0014142990112304688,
-0.034698486328125,
-0.031280517578125,
-0.00782012939453125,
0.0193023681640625,
-0.02734375,
0.00893402099609375,
0.01116943359375,
-0.0160675048828125,
-0.025146484375,
0.003055572509765625,
0.022064208984375,
0.0081634521484375,
-0.0009441375732421875,
-0.07208251953125,
0.06402587890625,
0.08056640625,
0.007717132568359375,
0.05596923828125,
-0.00220489501953125,
0.01209259033203125,
0.06292724609375,
-0.0173797607421875,
0.0343017578125,
0.041534423828125,
0.045684814453125,
-0.0105133056640625,
0.0184173583984375,
0.033233642578125,
-0.01239776611328125,
0.0204620361328125,
0.09027099609375,
0.07635498046875,
-0.15087890625,
0.025665283203125,
0.01263427734375,
0.029083251953125,
0.05780029296875,
-0.00799560546875,
0.003696441650390625,
-0.0254364013671875,
0.0216217041015625,
-0.040771484375,
-0.0160064697265625,
-0.0108795166015625,
-0.0259246826171875,
-0.01541900634765625,
-0.01097869873046875,
0.037445068359375,
0.023895263671875,
-0.00894927978515625,
0.01168060302734375,
0.018768310546875,
0.0014181137084960938,
-0.02032470703125,
-0.0007476806640625,
-0.0311737060546875,
-0.023193359375,
-0.051300048828125,
-0.01198577880859375,
-0.007396697998046875,
0.016265869140625,
0.03936767578125,
0.01325225830078125,
0.0098114013671875,
0.0682373046875,
-0.01355743408203125,
0.0198211669921875,
0.038818359375,
-0.01494598388671875,
-0.018707275390625,
-0.034149169921875,
-0.0129241943359375,
-0.033203125,
-0.01398468017578125,
0.0032062530517578125,
-0.04229736328125,
-0.03717041015625,
-0.0107421875,
0.00959014892578125,
0.07794189453125,
-0.010955810546875,
-0.033599853515625,
0.022705078125,
0.0019178390502929688,
-0.0220794677734375,
0.01068878173828125,
0.012298583984375,
-0.01922607421875,
-0.027740478515625,
-0.01727294921875,
-0.0703125,
0.0099639892578125,
-0.034759521484375,
-0.0523681640625,
0.0784912109375,
0.0289306640625,
0.0255889892578125,
0.0144805908203125,
0.033416748046875,
-0.0207672119140625,
0.0109100341796875,
-0.014739990234375,
0.0601806640625,
0.039947509765625,
0.0101470947265625,
-0.0222625732421875,
0.005100250244140625,
0.00940704345703125,
0.0258636474609375,
0.053680419921875,
0.023223876953125,
-0.060089111328125,
0.032562255859375,
0.058990478515625,
0.0148468017578125,
-0.0039005279541015625,
0.058685302734375,
0.0105743408203125,
-0.0281829833984375,
0.07257080078125,
-0.0023193359375,
0.0285797119140625,
0.0137176513671875,
0.012420654296875,
0.00846099853515625,
0.005435943603515625,
-0.009307861328125,
0.0207366943359375,
-0.0266571044921875,
-0.0889892578125,
0.0232391357421875,
0.048980712890625,
0.005397796630859375,
-0.0096435546875,
-0.022613525390625,
-0.028564453125,
-0.047332763671875,
0.040313720703125,
-0.032073974609375,
0.012420654296875,
-0.01312255859375,
0.0001685619354248047,
-0.032501220703125,
0.0172271728515625,
0.0035839080810546875,
-0.053466796875,
-0.032196044921875,
0.036895751953125,
-0.04449462890625,
0.09161376953125,
0.0474853515625,
0.054412841796875,
-0.0211181640625,
-0.033660888671875,
0.0165557861328125,
0.0970458984375,
-0.03302001953125,
-0.017120361328125,
0.00952911376953125,
0.0157012939453125,
0.01557159423828125,
0.01102447509765625,
0.06292724609375,
-0.00196075439453125,
0.0037021636962890625,
-0.04193115234375,
0.0110015869140625,
0.0423583984375,
0.0051116943359375,
-0.0218048095703125,
-0.0196533203125,
-0.0311431884765625,
0.0323486328125,
-0.044158935546875,
-0.016357421875,
0.046966552734375,
0.066162109375,
0.00727081298828125,
0.053436279296875,
0.005218505859375,
-0.0255279541015625,
-0.00714111328125,
-0.0220489501953125,
0.00238800048828125,
0.0035991668701171875,
-0.07452392578125,
-0.050079345703125,
0.0328369140625,
0.0650634765625,
-0.000029921531677246094,
-0.010406494140625,
-0.0234375,
0.0174560546875,
0.05218505859375,
-0.01071929931640625,
0.0214691162109375,
0.0008778572082519531,
0.058746337890625,
-0.030548095703125,
0.0012063980102539062,
-0.03631591796875,
-0.031341552734375,
-0.015960693359375,
0.0010251998901367188,
0.0037021636962890625,
0.006008148193359375,
0.0251312255859375,
0.00214385986328125,
-0.018341064453125,
-0.0006613731384277344,
-0.007129669189453125,
0.0751953125,
0.03387451171875,
-0.07623291015625,
-0.030059814453125,
-0.0088043212890625,
-0.0249176025390625,
0.03424072265625,
0.0430908203125,
-0.03143310546875,
0.0309295654296875,
-0.003154754638671875,
0.0171966552734375,
-0.0103302001953125,
-0.0023326873779296875,
-0.0147705078125,
-0.0286712646484375,
0.0292816162109375,
0.0020389556884765625,
-0.040557861328125,
-0.01558685302734375,
-0.007053375244140625,
0.0210418701171875,
-0.005268096923828125,
0.040679931640625,
-0.01453399658203125,
0.011444091796875,
-0.025238037109375,
0.031524658203125,
-0.05242919921875,
-0.0286102294921875,
0.0114593505859375,
-0.0088653564453125,
-0.005832672119140625,
0.005786895751953125,
-0.044891357421875,
0.016845703125,
0.027252197265625,
-0.01983642578125,
0.03216552734375,
-0.015411376953125,
0.0201568603515625,
-0.0213623046875,
0.00397491455078125,
-0.0218353271484375,
-0.031097412109375,
-0.037750244140625,
0.00650787353515625,
0.02154541015625,
0.0245819091796875,
-0.024139404296875,
0.034332275390625,
0.004917144775390625,
-0.0252532958984375,
0.00946807861328125,
-0.0357666015625,
0.01053619384765625,
0.040283203125,
-0.0144195556640625,
-0.03302001953125,
0.031768798828125,
0.01244354248046875,
-0.00262451171875,
0.041473388671875,
0.0195770263671875,
0.040557861328125,
0.047271728515625,
-0.018798828125,
-0.0286712646484375,
0.0020313262939453125,
-0.00304412841796875,
-0.0194854736328125,
-0.0189666748046875,
-0.019927978515625,
-0.014312744140625,
-0.0284423828125,
-0.0268402099609375,
-0.0189056396484375,
-0.01207733154296875,
0.00887298583984375,
0.00339508056640625,
-0.0565185546875,
-0.038360595703125,
0.036712646484375,
0.0274200439453125,
-0.01220703125,
-0.0538330078125,
0.035491943359375,
-0.05657958984375,
0.062469482421875,
-0.03173828125,
0.004734039306640625,
0.0116424560546875,
0.0428466796875,
-0.0487060546875,
-0.006237030029296875,
-0.039337158203125,
-0.011474609375,
-0.041046142578125,
-0.01291656494140625,
0.0300445556640625,
-0.007450103759765625,
-0.0252532958984375,
-0.023468017578125,
-0.0250091552734375,
0.0226287841796875,
-0.043121337890625,
-0.003391265869140625,
0.007183074951171875,
0.0232696533203125,
-0.01230621337890625,
-0.04156494140625,
-0.00806427001953125,
0.01593017578125,
0.0029449462890625,
0.004680633544921875,
0.003269195556640625,
0.003986358642578125,
-0.0323486328125,
-0.068603515625,
0.032928466796875,
0.004764556884765625,
-0.032928466796875,
-0.0166778564453125,
0.031707763671875,
0.0128021240234375,
0.0036640167236328125,
0.006500244140625,
-0.03326416015625,
-0.0259857177734375,
-0.01412200927734375,
0.0201263427734375,
0.02911376953125,
0.01047515869140625,
0.03338623046875,
-0.032318115234375,
0.0186309814453125,
0.003131866455078125,
-0.0019969940185546875,
0.005889892578125,
-0.0196685791015625,
0.0283966064453125,
0.05401611328125,
-0.01284027099609375,
-0.051177978515625,
-0.0106658935546875,
-0.0235748291015625,
0.01904296875,
-0.035064697265625,
-0.06683349609375,
-0.05853271484375,
0.052734375,
0.025146484375,
0.0241546630859375,
0.0119171142578125,
-0.0268402099609375,
-0.01409912109375,
-0.043212890625,
-0.00533294677734375,
0.046600341796875,
-0.0777587890625,
0.0035247802734375,
0.0227508544921875,
-0.00931549072265625,
-0.0077667236328125,
0.044036865234375,
-0.002475738525390625,
0.000030219554901123047,
0.04766845703125,
-0.029815673828125,
-0.004467010498046875,
-0.012359619140625,
0.0537109375,
-0.03851318359375,
-0.01922607421875,
-0.0219268798828125,
0.042724609375,
-0.01149749755859375,
-0.06378173828125,
0.0205230712890625,
0.03094482421875,
-0.0305328369140625,
0.004085540771484375,
0.00005370378494262695,
0.026824951171875,
-0.04779052734375,
-0.0170440673828125,
0.01468658447265625,
0.0275115966796875,
-0.025665283203125,
0.031768798828125,
0.018951416015625,
0.074462890625,
-0.004833221435546875,
0.040985107421875,
0.0143280029296875,
0.0394287109375,
0.001445770263671875,
0.04656982421875,
-0.01154327392578125,
-0.02197265625,
0.0088958740234375,
-0.0386962890625,
0.000484466552734375,
0.03118896484375,
0.00545501708984375,
-0.040924072265625,
0.016937255859375,
0.0268096923828125,
0.037445068359375,
0.0139312744140625
] |
5e5255a2e90d36a7263924ae17ceed25e8809d04
|
Wordpress Stackexchange
Q: How to change redirect after moving a page to trash? How could I change the redirect location after a user trashes a page?
Right now they go to all pages here:....wp-admin/edit.php?post_type=page
I want them to go here:......wp-admin/edit.php?post_type=page&page=custom_page_order
A: Hook into load-{screen_id} and check if the $_GET['trashed'] variable is 1 or above.
add_action('load-edit.php','wpse_trashed_redirect');
function wpse_trashed_redirect(){
$screen = get_current_screen();
if('edit-page' == $screen->id){
if( isset($_GET['trashed']) && intval($_GET['trashed']) >0){
$redirect = add_query_arg(array('page'=>'custom_page_oder', 'trashed' => false, 'ids' => false ));
wp_redirect($redirect);
exit();
}
}
}
This works - and I'm not aware of a better way of doing this...
|
Q: How to change redirect after moving a page to trash? How could I change the redirect location after a user trashes a page?
Right now they go to all pages here:....wp-admin/edit.php?post_type=page
I want them to go here:......wp-admin/edit.php?post_type=page&page=custom_page_order
A: Hook into load-{screen_id} and check if the $_GET['trashed'] variable is 1 or above.
add_action('load-edit.php','wpse_trashed_redirect');
function wpse_trashed_redirect(){
$screen = get_current_screen();
if('edit-page' == $screen->id){
if( isset($_GET['trashed']) && intval($_GET['trashed']) >0){
$redirect = add_query_arg(array('page'=>'custom_page_oder', 'trashed' => false, 'ids' => false ));
wp_redirect($redirect);
exit();
}
}
}
This works - and I'm not aware of a better way of doing this...
|
wordpress
|
{
"language": "en",
"length": 95,
"provenance": "stackexchange_00019.jsonl.gz:419959",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52116"
}
|
[
0.056182861328125,
0.02337646484375,
0.001537322998046875,
-0.030914306640625,
0.030242919921875,
-0.03125,
0.0249481201171875,
-0.036956787109375,
0.037078857421875,
-0.0033092498779296875,
-0.0196075439453125,
-0.04876708984375,
0.01256561279296875,
-0.054168701171875,
-0.00032401084899902344,
-0.02587890625,
0.03125,
-0.03460693359375,
0.0300445556640625,
-0.00933837890625,
-0.000476837158203125,
0.00989532470703125,
0.0673828125,
-0.0364990234375,
-0.015838623046875,
-0.003536224365234375,
0.05133056640625,
0.0051422119140625,
-0.04754638671875,
-0.035125732421875,
-0.0020351409912109375,
0.024993896484375,
0.0235137939453125,
0.0237274169921875,
-0.0296173095703125,
-0.02606201171875,
0.00725555419921875,
-0.00475311279296875,
-0.00872802734375,
0.033721923828125,
0.032806396484375,
-0.0311126708984375,
-0.053802490234375,
0.01094818115234375,
-0.03778076171875,
-0.0192108154296875,
0.0215606689453125,
-0.015869140625,
0.0171966552734375,
0.0295867919921875,
0.033721923828125,
-0.010498046875,
0.0234222412109375,
-0.0146636962890625,
-0.0194549560546875,
0.007595062255859375,
-0.012298583984375,
0.00429534912109375,
0.0182037353515625,
0.00652313232421875,
-0.00447845458984375,
0.0153350830078125,
0.0013856887817382812,
-0.009185791015625,
-0.004131317138671875,
-0.009552001953125,
0.0009431838989257812,
0.042999267578125,
-0.044830322265625,
-0.03375244140625,
-0.01126861572265625,
-0.0260467529296875,
-0.01305389404296875,
0.00885009765625,
-0.00887298583984375,
-0.00899505615234375,
0.028289794921875,
0.003627777099609375,
0.00006401538848876953,
0.03662109375,
0.006671905517578125,
-0.0214385986328125,
-0.0161590576171875,
-0.039306640625,
0.02447509765625,
-0.0018224716186523438,
-0.0172882080078125,
-0.00833892822265625,
-0.036590576171875,
-0.0259246826171875,
-0.033905029296875,
-0.030120849609375,
-0.018280029296875,
-0.00817108154296875,
-0.0258331298828125,
-0.00971221923828125,
0.0335693359375,
0.053314208984375,
0.0198211669921875,
-0.008941650390625,
0.004817962646484375,
-0.031890869140625,
-0.01251983642578125,
-0.02386474609375,
-0.0081329345703125,
-0.01641845703125,
0.0258636474609375,
0.00923919677734375,
0.01548004150390625,
0.0110626220703125,
-0.033721923828125,
0.007965087890625,
-0.0251312255859375,
-0.00732421875,
-0.0212249755859375,
0.0017299652099609375,
-0.06365966796875,
0.005886077880859375,
-0.0193328857421875,
0.01557159423828125,
-0.01154327392578125,
-0.002811431884765625,
0.020599365234375,
-0.0321044921875,
-0.016571044921875,
-0.037261962890625,
-0.01555633544921875,
-0.0222625732421875,
-0.0202484130859375,
-0.05126953125,
-0.0174560546875,
0.05059814453125,
0.05914306640625,
0.031890869140625,
0.00978851318359375,
0.0134124755859375,
0.06805419921875,
-0.042083740234375,
-0.0186004638671875,
0.041961669921875,
-0.0031566619873046875,
-0.035400390625,
-0.035308837890625,
-0.0158233642578125,
0.0308380126953125,
0.044677734375,
0.032501220703125,
-0.005550384521484375,
-0.0186309814453125,
-0.0799560546875,
0.04461669921875,
-0.0181884765625,
0.0362548828125,
0.0014505386352539062,
0.0014896392822265625,
-0.033233642578125,
0.036163330078125,
-0.01800537109375,
-0.021026611328125,
-0.0285797119140625,
0.036956787109375,
0.0215911865234375,
0.044769287109375,
-0.0180816650390625,
-0.058258056640625,
-0.02197265625,
-0.08599853515625,
-0.035858154296875,
0.0193328857421875,
0.0213775634765625,
0.0215301513671875,
0.0188446044921875,
-0.053497314453125,
0.01508331298828125,
0.0184173583984375,
-0.001827239990234375,
0.00341796875,
-0.010894775390625,
0.019287109375,
0.06134033203125,
0.0034885406494140625,
-0.021881103515625,
0.0287322998046875,
-0.005008697509765625,
-0.036651611328125,
0.05859375,
0.001255035400390625,
0.044097900390625,
0.01065826416015625,
-0.009246826171875,
0.00566864013671875,
0.03704833984375,
-0.00035190582275390625,
0.0007843971252441406,
0.02618408203125,
-0.024993896484375,
-0.010711669921875,
-0.020751953125,
0.00621795654296875,
-0.01206207275390625,
0.0004856586456298828,
0.018402099609375,
0.01532745361328125,
0.031646728515625,
-0.0187835693359375,
0.05670166015625,
-0.026214599609375,
0.035980224609375,
0.051513671875,
0.031585693359375,
-0.015869140625,
-0.0019359588623046875,
-0.00717926025390625,
-0.014251708984375,
-0.032379150390625,
0.0225067138671875,
-0.01446533203125,
0.02630615234375,
-0.0026149749755859375,
0.03253173828125,
0.00547027587890625,
-0.0491943359375,
-0.0137786865234375,
-0.03912353515625,
0.04681396484375,
-0.026947021484375,
0.0011644363403320312,
-0.032684326171875,
0.0101318359375,
-0.0251922607421875,
-0.0204925537109375,
0.0849609375,
0.06915283203125,
0.038482666015625,
-0.01425933837890625,
0.01042938232421875,
-0.016510009765625,
-0.0924072265625,
-0.0250701904296875,
0.06402587890625,
0.01537322998046875,
0.0286407470703125,
-0.01207733154296875,
0.049957275390625,
0.0286407470703125,
-0.033843994140625,
-0.006244659423828125,
0.03875732421875,
0.019744873046875,
0.052978515625,
-0.01251983642578125,
-0.0094757080078125,
0.01049041748046875,
-0.0640869140625,
-0.01282501220703125,
0.032958984375,
-0.0187225341796875,
0.02325439453125,
0.01172637939453125,
-0.039306640625,
-0.0042877197265625,
-0.058502197265625,
-0.025604248046875,
-0.0232696533203125,
0.0474853515625,
-0.025421142578125,
0.025665283203125,
0.00980377197265625,
-0.01508331298828125,
-0.0207977294921875,
0.0167236328125,
-0.0231475830078125,
-0.00835418701171875,
-0.0083465576171875,
0.007389068603515625,
-0.036041259765625,
-0.000507354736328125,
0.0144805908203125,
-0.01422882080078125,
-0.031280517578125,
-0.032958984375,
-0.0303955078125,
-0.0234527587890625,
-0.01324462890625,
0.003238677978515625,
-0.040069580078125,
0.0143585205078125,
0.003650665283203125,
0.01371002197265625,
-0.008636474609375,
0.034454345703125,
0.00917816162109375,
-0.009521484375,
0.021759033203125,
0.0250091552734375,
-0.043365478515625,
0.03668212890625,
-0.01552581787109375,
0.0206298828125,
-0.021087646484375,
0.047760009765625,
0.0655517578125,
-0.0200347900390625,
0.020294189453125,
0.0013713836669921875,
0.054443359375,
0.0214691162109375,
-0.0129547119140625,
-0.013458251953125,
0.00753021240234375,
-0.054412841796875,
-0.0382080078125,
0.03643798828125,
0.0146026611328125,
0.037994384765625,
0.0005593299865722656,
0.00521087646484375,
0.022796630859375,
-0.035003662109375,
-0.05841064453125,
-0.01158905029296875,
-0.0294189453125,
0.0015544891357421875,
0.03350830078125,
-0.0019626617431640625,
-0.0053558349609375,
0.054290771484375,
0.008026123046875,
0.0199127197265625,
0.004894256591796875,
-0.031341552734375,
0.02178955078125,
-0.0240020751953125,
-0.025482177734375,
-0.0118865966796875,
-0.01383209228515625,
0.005977630615234375,
0.021453857421875,
-0.007411956787109375,
-0.060882568359375,
-0.04718017578125,
0.040283203125,
-0.003719329833984375,
-0.047515869140625,
-0.02203369140625,
-0.0231170654296875,
0.053955078125,
-0.01412200927734375,
0.0986328125,
0.02001953125,
0.01253509521484375,
0.0018711090087890625,
-0.05316162109375,
-0.034332275390625,
-0.0131988525390625,
-0.05169677734375,
0.03985595703125,
0.00925445556640625,
-0.0157623291015625,
-0.0411376953125,
-0.0283660888671875,
-0.00008809566497802734,
-0.032073974609375,
0.01461029052734375,
0.018646240234375,
0.0016736984252929688,
-0.00884246826171875,
0.0218963623046875,
0.03265380859375,
0.0183563232421875,
0.01415252685546875,
0.012786865234375,
-0.0037174224853515625,
-0.008392333984375,
0.02435302734375,
-0.03887939453125,
0.017852783203125,
-0.002105712890625,
-0.0166473388671875,
-0.0006470680236816406,
0.00418853759765625,
0.004596710205078125,
0.01378631591796875,
-0.007488250732421875,
-0.07025146484375,
0.0347900390625,
-0.06805419921875,
-0.029296875,
-0.025115966796875,
0.0015954971313476562,
0.01549530029296875,
0.07598876953125,
-0.01190185546875,
-0.01922607421875,
-0.04693603515625,
-0.0110321044921875,
-0.002880096435546875,
-0.01849365234375,
-0.0048980712890625,
-0.0035247802734375,
-0.15087890625,
0.046844482421875,
0.006031036376953125,
-0.015472412109375,
-0.046630859375,
0.0372314453125,
-0.079833984375,
-0.050384521484375,
0.037994384765625,
-0.07464599609375,
0.00377655029296875,
0.01971435546875,
-0.02984619140625,
-0.010498046875,
-0.0133056640625,
-0.054931640625,
-0.07269287109375,
-0.01021575927734375,
-0.00490570068359375,
0.045989990234375,
0.0200958251953125,
-0.036468505859375,
0.018157958984375,
0.054931640625,
0.036529541015625,
0.0217437744140625,
-0.030181884765625,
-0.027435302734375,
-0.044769287109375,
-0.031341552734375,
-0.0291900634765625,
-0.0186309814453125,
0.0204620361328125,
-0.009368896484375,
-0.0487060546875,
0.0002206563949584961,
-0.024566650390625,
0.02239990234375,
0.03289794921875,
-0.043701171875,
-0.06304931640625,
-0.035888671875,
-0.007175445556640625,
0.0203399658203125,
-0.0090484619140625,
-0.0016155242919921875,
-0.035125732421875,
-0.07537841796875,
0.016845703125,
-0.01259613037109375,
-0.010162353515625,
0.01045989990234375,
0.01132965087890625,
0.01480865478515625,
-0.019195556640625,
0.02752685546875,
-0.018035888671875,
0.01079559326171875,
-0.010711669921875,
0.032684326171875,
0.00421142578125,
-0.006374359130859375,
0.043182373046875,
-0.0321044921875,
-0.0191497802734375,
-0.015167236328125,
0.0235748291015625,
-0.0120849609375,
-0.0338134765625,
0.0198822021484375,
-0.061920166015625,
0.04351806640625,
0.045562744140625,
-0.0108642578125,
-0.00968170166015625,
-0.007328033447265625,
0.0234222412109375,
-0.037811279296875,
0.0222320556640625,
-0.025421142578125,
-0.025054931640625,
-0.01081085205078125,
0.037811279296875,
0.04583740234375,
0.0199127197265625,
0.000059604644775390625,
0.040130615234375,
0.061431884765625,
-0.00191497802734375,
0.00243377685546875,
-0.0345458984375,
0.03216552734375,
0.0281829833984375,
0.02081298828125,
0.025115966796875,
0.005939483642578125,
0.0002834796905517578,
0.0433349609375,
0.015838623046875,
-0.01192474365234375,
-0.0311279296875,
-0.0352783203125,
-0.018707275390625,
-0.0136260986328125,
-0.0022830963134765625,
0.022308349609375,
-0.005462646484375,
-0.020782470703125,
0.00981903076171875,
-0.0139617919921875,
-0.0089874267578125,
-0.048858642578125,
0.041534423828125,
0.0130157470703125,
-0.002216339111328125,
0.037994384765625,
0.06658935546875,
0.005096435546875,
0.052520751953125,
-0.0209503173828125,
0.005733489990234375,
0.03173828125,
0.0007433891296386719,
-0.0006475448608398438,
0.06402587890625,
-0.014617919921875,
-0.007480621337890625,
0.034088134765625,
-0.0187530517578125,
0.00614166259765625,
0.031402587890625,
0.04150390625,
-0.0161895751953125,
-0.0311737060546875,
0.01284027099609375,
-0.034759521484375,
-0.0125579833984375,
0.06683349609375,
-0.001995086669921875,
-0.07720947265625,
-0.031829833984375,
0.0233001708984375,
0.05230712890625,
-0.03936767578125,
-0.006195068359375,
-0.01336669921875,
-0.044647216796875,
-0.0200347900390625,
0.029632568359375,
-0.0269927978515625,
-0.0198211669921875,
-0.0269927978515625,
-0.0202484130859375,
-0.0201873779296875,
0.007099151611328125,
-0.0242767333984375,
0.0172271728515625,
-0.023651123046875,
-0.0237884521484375,
0.04791259765625,
-0.01824951171875,
0.0201263427734375,
-0.0202789306640625,
-0.00714874267578125,
0.0109100341796875,
0.017852783203125,
0.0242462158203125,
-0.00792694091796875,
-0.047607421875,
0.0018987655639648438,
-0.052703857421875,
-0.00629425048828125,
-0.01171875,
-0.031768798828125,
-0.0249176025390625,
-0.004058837890625,
0.015411376953125,
0.0271453857421875,
0.0017290115356445312,
-0.019134521484375,
-0.0221710205078125,
-0.020782470703125,
-0.0038909912109375,
0.0214080810546875,
-0.0100860595703125,
0.053741455078125,
0.003021240234375,
0.05487060546875,
0.0083465576171875,
0.0171661376953125,
-0.00925445556640625,
-0.0224151611328125,
0.0086669921875,
-0.023162841796875,
-0.002532958984375,
-0.0281219482421875,
0.006610870361328125,
0.0075225830078125,
0.035064697265625,
-0.01468658447265625,
0.01502227783203125,
-0.0006060600280761719,
0.00579071044921875,
-0.04315185546875,
-0.00260162353515625,
-0.01525115966796875,
0.0321044921875,
-0.030242919921875,
-0.004467010498046875,
-0.0313720703125,
0.006526947021484375,
0.044647216796875,
-0.047515869140625,
0.00548553466796875,
-0.03277587890625,
-0.03912353515625,
-0.05474853515625,
0.058197021484375,
0.063232421875,
0.002643585205078125,
0.037139892578125,
-0.006443023681640625,
-0.007541656494140625,
0.03253173828125,
-0.0204315185546875,
0.0498046875,
0.022857666015625,
0.046844482421875,
-0.018280029296875,
0.01105499267578125,
0.020050048828125,
-0.0173492431640625,
-0.015716552734375,
0.07073974609375,
0.040802001953125,
-0.11126708984375,
0.0006394386291503906,
0.004528045654296875,
0.01168060302734375,
0.019866943359375,
-0.01568603515625,
0.004795074462890625,
0.0141143798828125,
0.0004551410675048828,
-0.038665771484375,
-0.047821044921875,
-0.00548553466796875,
-0.00909423828125,
-0.007080078125,
-0.0181427001953125,
0.0233917236328125,
-0.01035308837890625,
-0.075927734375,
0.031494140625,
0.03179931640625,
-0.00670623779296875,
-0.022705078125,
-0.0017185211181640625,
0.03704833984375,
-0.01335906982421875,
-0.054931640625,
0.052032470703125,
-0.017181396484375,
-0.0019779205322265625,
0.00807952880859375,
0.01404571533203125,
0.0419921875,
0.0697021484375,
-0.00408172607421875,
-0.0007214546203613281,
0.03594970703125,
-0.028289794921875,
-0.004192352294921875,
-0.0258026123046875,
0.00827789306640625,
-0.0186004638671875,
-0.05572509765625,
0.01216888427734375,
-0.04974365234375,
-0.03424072265625,
-0.01611328125,
-0.0106201171875,
0.0726318359375,
-0.001621246337890625,
-0.0255126953125,
0.0198974609375,
0.01369476318359375,
-0.0139923095703125,
0.01467132568359375,
-0.0067901611328125,
-0.0341796875,
-0.04901123046875,
-0.0017709732055664062,
-0.07958984375,
-0.004695892333984375,
-0.0325927734375,
-0.0411376953125,
0.06390380859375,
0.03436279296875,
0.0075836181640625,
0.011993408203125,
0.0288543701171875,
-0.04156494140625,
0.01336669921875,
-0.04058837890625,
0.06939697265625,
0.0253143310546875,
0.041961669921875,
-0.046356201171875,
-0.0132293701171875,
0.02008056640625,
0.0247039794921875,
-0.005054473876953125,
0.0128021240234375,
-0.0450439453125,
0.025054931640625,
0.031158447265625,
-0.0008149147033691406,
0.01143646240234375,
0.049957275390625,
0.0149078369140625,
-0.01255035400390625,
-0.0144195556640625,
-0.02850341796875,
0.011810302734375,
-0.04510498046875,
0.004039764404296875,
0.01496124267578125,
0.0301513671875,
0.01416778564453125,
-0.03289794921875,
-0.005977630615234375,
-0.09307861328125,
0.015838623046875,
0.051513671875,
0.019561767578125,
-0.0118865966796875,
0.043731689453125,
0.029266357421875,
-0.0428466796875,
0.01113128662109375,
-0.0419921875,
0.04498291015625,
0.0014362335205078125,
0.0028438568115234375,
0.061676025390625,
0.0154571533203125,
0.029327392578125,
-0.008453369140625,
0.00010824203491210938,
-0.0312347412109375,
0.0163421630859375,
0.097900390625,
0.0838623046875,
0.0140380859375,
-0.00388336181640625,
0.015960693359375,
0.04193115234375,
0.10443115234375,
-0.06683349609375,
-0.033172607421875,
0.006561279296875,
0.01477813720703125,
0.029052734375,
0.0015621185302734375,
0.064208984375,
-0.058013916015625,
-0.027374267578125,
-0.013763427734375,
-0.015594482421875,
0.01708984375,
0.0164337158203125,
-0.006427764892578125,
-0.007518768310546875,
-0.017486572265625,
-0.0125579833984375,
0.00289154052734375,
-0.030242919921875,
0.0244293212890625,
0.00908660888671875,
0.00128173828125,
0.01462554931640625,
0.049468994140625,
0.01308441162109375,
-0.031341552734375,
0.03240966796875,
-0.0035381317138671875,
0.033294677734375,
-0.040771484375,
-0.0294647216796875,
-0.0009579658508300781,
0.041961669921875,
-0.00966644287109375,
-0.02398681640625,
-0.0094757080078125,
-0.0114898681640625,
-0.01300811767578125,
-0.0247039794921875,
-0.0035839080810546875,
-0.030670166015625,
0.044342041015625,
-0.0301666259765625,
-0.006359100341796875,
-0.010894775390625,
-0.0299530029296875,
-0.03228759765625,
-0.035308837890625,
0.039031982421875,
0.0017595291137695312,
0.042510986328125,
-0.0001633167266845703,
-0.03826904296875,
-0.01319122314453125,
-0.01354217529296875,
0.05859375,
0.018829345703125,
-0.04644775390625,
-0.034210205078125,
-0.0168304443359375,
0.0294647216796875,
0.00414276123046875,
0.025634765625,
0.03228759765625,
0.0059814453125,
-0.0284576416015625,
-0.00400543212890625,
0.034759521484375,
-0.01250457763671875,
-0.0149688720703125,
0.01375579833984375,
0.0091552734375,
-0.0173492431640625,
-0.02947998046875,
-0.028656005859375,
0.007476806640625,
0.0304718017578125,
-0.03363037109375,
0.06707763671875,
-0.03021240234375,
0.00299072265625,
-0.0156097412109375,
0.0246734619140625,
-0.0203399658203125,
-0.038787841796875,
0.024658203125,
0.003509521484375,
0.0199127197265625,
0.010101318359375,
-0.04534912109375,
0.0311737060546875,
0.0240631103515625,
-0.00037407875061035156,
0.0171051025390625,
-0.0061187744140625,
0.0171356201171875,
0.01102447509765625,
0.047271728515625,
-0.0296630859375,
-0.05584716796875,
-0.0263671875,
0.01493072509765625,
0.0035953521728515625,
0.01080322265625,
-0.023406982421875,
0.04754638671875,
0.02764892578125,
0.007221221923828125,
0.033905029296875,
-0.044036865234375,
0.062164306640625,
0.035125732421875,
-0.03204345703125,
-0.0128021240234375,
0.0084991455078125,
-0.0137786865234375,
-0.006511688232421875,
0.004299163818359375,
0.01166534423828125,
0.01371002197265625,
0.035308837890625,
-0.029876708984375,
-0.07403564453125,
-0.0174407958984375,
-0.01076507568359375,
-0.032623291015625,
-0.03619384765625,
0.0164947509765625,
-0.05096435546875,
-0.03729248046875,
-0.0087890625,
-0.01174163818359375,
-0.00666046142578125,
0.01528167724609375,
-0.0004935264587402344,
0.0014190673828125,
-0.0061798095703125,
-0.0180206298828125,
0.038970947265625,
0.030303955078125,
-0.098876953125,
0.044342041015625,
-0.02099609375,
0.040435791015625,
-0.007160186767578125,
-0.006465911865234375,
-0.01971435546875,
-0.0555419921875,
-0.039947509765625,
-0.0208740234375,
-0.06719970703125,
0.03057861328125,
-0.04632568359375,
-0.0254058837890625,
0.0032939910888671875,
0.0016279220581054688,
-0.014007568359375,
-0.049346923828125,
-0.03424072265625,
0.01227569580078125,
-0.02642822265625,
-0.055816650390625,
0.0033054351806640625,
0.01419830322265625,
0.039581298828125,
0.00020313262939453125,
-0.0439453125,
0.040924072265625,
0.03717041015625,
-0.0019626617431640625,
-0.041473388671875,
-0.034698486328125,
-0.0531005859375,
-0.047943115234375,
0.06494140625,
0.0081329345703125,
-0.0220489501953125,
-0.01520538330078125,
0.02276611328125,
0.0096435546875,
-0.00968170166015625,
0.01128387451171875,
-0.041717529296875,
-0.0081024169921875,
-0.00617218017578125,
-0.00789642333984375,
0.055419921875,
-0.015838623046875,
0.020416259765625,
-0.0038051605224609375,
0.0179901123046875,
0.01053619384765625,
-0.00862884521484375,
0.0122528076171875,
-0.036376953125,
0.04296875,
0.038726806640625,
-0.0120849609375,
-0.022308349609375,
0.0166778564453125,
-0.03253173828125,
-0.0156402587890625,
-0.01885986328125,
-0.022613525390625,
-0.02593994140625,
0.053955078125,
0.025970458984375,
0.0224609375,
-0.005523681640625,
-0.051544189453125,
-0.018402099609375,
0.006969451904296875,
0.00891876220703125,
0.00897979736328125,
-0.05633544921875,
-0.00386810302734375,
-0.0078582763671875,
-0.007686614990234375,
-0.0023097991943359375,
0.0250396728515625,
0.018829345703125,
-0.00937652587890625,
0.057525634765625,
-0.027862548828125,
0.01490020751953125,
-0.00817108154296875,
0.058441162109375,
-0.040008544921875,
0.01012420654296875,
-0.01044464111328125,
0.040985107421875,
0.0212249755859375,
-0.03594970703125,
0.0249786376953125,
0.051910400390625,
-0.043304443359375,
-0.0242919921875,
-0.0017480850219726562,
0.02880859375,
-0.0474853515625,
-0.020721435546875,
0.00945281982421875,
0.034423828125,
-0.02764892578125,
0.03753662109375,
0.0249176025390625,
0.04913330078125,
-0.024658203125,
0.021759033203125,
-0.01580810546875,
0.00814056396484375,
-0.0031757354736328125,
0.0271148681640625,
-0.0161895751953125,
-0.0110321044921875,
0.055877685546875,
-0.04888916015625,
-0.01070404052734375,
0.034698486328125,
0.024658203125,
-0.06103515625,
0.048919677734375,
0.0101165771484375,
0.042999267578125,
0.0188446044921875
] |
a62a5fad0f675c99ea47fe2dd0fa1292bcd23219
|
Wordpress Stackexchange
Q: Highlight parent menu item when child is not in menu I want to highlight the parent of a child page in the menu when the child page itself is not in the menu.
I know this would work if you add the child as a sub page but that isn't the case.
Any ideas?
A: Alrdy got it:
<?php //in functions.php
add_filter('nav_menu_css_class', 'highlight_portfolio', 12, 2);
function highlight_portfolio($classes, $item) {
$parent = get_post_ancestors();
$parent_ID = $parent[0];
if ($parent_ID == $item->object_id) {
array_push($classes, 'current-menu-ancestor');
}
return $classes;
}
|
Q: Highlight parent menu item when child is not in menu I want to highlight the parent of a child page in the menu when the child page itself is not in the menu.
I know this would work if you add the child as a sub page but that isn't the case.
Any ideas?
A: Alrdy got it:
<?php //in functions.php
add_filter('nav_menu_css_class', 'highlight_portfolio', 12, 2);
function highlight_portfolio($classes, $item) {
$parent = get_post_ancestors();
$parent_ID = $parent[0];
if ($parent_ID == $item->object_id) {
array_push($classes, 'current-menu-ancestor');
}
return $classes;
}
A: The accepted answer from @janw is very close, but get_post_anscestors() actually requires a WP Post or the ID of one as an argument per the WordPress docs:
https://developer.wordpress.org/reference/functions/get_post_ancestors/
I implemented like this and it works great:
function highlight_portfolio($classes, $item) {
$parent = get_post_ancestors($item);
$parent_ID = $parent[0];
if ($parent_ID == $item->object_id) {
array_push($classes, 'current-menu-ancestor');
}
return $classes;
}
add_filter('nav_menu_css_class', 'highlight_portfolio', 12, 2);
I would just leave this as a comment but don't have the reputation yet, so posting as an answer instead.
A: As an alternative to @janw's answer, you can insert the following code in the theme’s footer.php file right before the closing body tag .
<!-- Highlight parent page link when on child page -->
<?php if (is_page()) { // displaying a child page ?>
<script type="text/javascript">
jQuery("li.current-page-ancestor").addClass('current-menu-item');
</script>
<?php } ?>
I've detailed how this code works in a post here: How to keep parent page navigation link highlighted when viewing a child/sub page!
|
wordpress
|
{
"language": "en",
"length": 244,
"provenance": "stackexchange_00019.jsonl.gz:419977",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52178"
}
|
[
0.05078125,
0.025604248046875,
0.003387451171875,
0.00043010711669921875,
0.03143310546875,
-0.039642333984375,
0.0406494140625,
-0.061676025390625,
-0.0116424560546875,
0.0027942657470703125,
-0.05450439453125,
-0.0117340087890625,
-0.048431396484375,
-0.0207977294921875,
-0.034820556640625,
-0.07470703125,
0.0094146728515625,
-0.018707275390625,
0.0298004150390625,
-0.006542205810546875,
0.005023956298828125,
-0.0078125,
0.0426025390625,
-0.030670166015625,
0.06182861328125,
-0.074462890625,
-0.0032196044921875,
-0.0088958740234375,
0.03472900390625,
-0.0030193328857421875,
0.025634765625,
-0.00876617431640625,
-0.006404876708984375,
0.00879669189453125,
0.05499267578125,
0.01540374755859375,
0.0074615478515625,
0.003814697265625,
0.04290771484375,
0.0195465087890625,
0.01910400390625,
-0.007568359375,
-0.0165863037109375,
0.0276336669921875,
-0.0236053466796875,
-0.042999267578125,
0.011260986328125,
-0.032257080078125,
0.031463623046875,
-0.0390625,
0.033721923828125,
0.02032470703125,
0.0285797119140625,
0.020538330078125,
-0.0107421875,
0.056640625,
-0.0017194747924804688,
0.04046630859375,
0.0162200927734375,
0.0223236083984375,
-0.030853271484375,
0.055572509765625,
-0.01079559326171875,
-0.035400390625,
0.0088043212890625,
0.00746917724609375,
-0.030181884765625,
0.0155487060546875,
-0.08233642578125,
-0.0002994537353515625,
0.04559326171875,
-0.06201171875,
-0.0164794921875,
0.0208740234375,
-0.06695556640625,
-0.047454833984375,
0.023895263671875,
-0.05780029296875,
0.0234832763671875,
0.0117950439453125,
-0.0311126708984375,
0.047119140625,
-0.06732177734375,
-0.0090789794921875,
-0.0126190185546875,
0.01450347900390625,
-0.0249481201171875,
-0.0184783935546875,
-0.051666259765625,
0.00782012939453125,
-0.0350341796875,
-0.00473785400390625,
-0.022369384765625,
-0.0027294158935546875,
-0.0143585205078125,
0.0142974853515625,
0.038818359375,
0.09466552734375,
-0.049041748046875,
0.0225830078125,
-0.04608154296875,
-0.0008740425109863281,
0.0247802734375,
-0.0618896484375,
0.0196990966796875,
0.051666259765625,
0.01416778564453125,
-0.018768310546875,
0.04217529296875,
-0.00478363037109375,
0.01020050048828125,
0.06884765625,
-0.01425933837890625,
-0.0190277099609375,
-0.0418701171875,
0.0310821533203125,
0.00470733642578125,
-0.03912353515625,
-0.005619049072265625,
-0.041168212890625,
-0.00893402099609375,
-0.01227569580078125,
0.00366973876953125,
-0.0019664764404296875,
0.0013933181762695312,
-0.01256561279296875,
-0.032745361328125,
0.0249786376953125,
0.0295867919921875,
0.0017566680908203125,
-0.037872314453125,
-0.0048370361328125,
0.073486328125,
0.039520263671875,
0.031280517578125,
-0.021942138671875,
-0.01351165771484375,
-0.003833770751953125,
0.018646240234375,
-0.036712646484375,
0.05548095703125,
-0.00635528564453125,
0.01081085205078125,
0.03289794921875,
0.01186370849609375,
0.0014505386352539062,
0.0159454345703125,
0.0237579345703125,
-0.0016307830810546875,
-0.043182373046875,
0.054229736328125,
-0.0328369140625,
0.04559326171875,
-0.004596710205078125,
-0.01971435546875,
-0.03497314453125,
0.00823974609375,
-0.0245208740234375,
-0.006748199462890625,
-0.0386962890625,
0.00556182861328125,
0.00524139404296875,
0.0311279296875,
-0.061981201171875,
-0.05877685546875,
-0.0280609130859375,
-0.058624267578125,
-0.01242828369140625,
0.02667236328125,
-0.035736083984375,
0.07666015625,
-0.040252685546875,
0.00653076171875,
0.007442474365234375,
0.0184326171875,
0.0287017822265625,
0.029052734375,
0.0290069580078125,
-0.0169525146484375,
0.039703369140625,
-0.00559234619140625,
-0.053924560546875,
0.0136566162109375,
-0.02984619140625,
-0.044677734375,
0.034088134765625,
-0.003406524658203125,
0.0292510986328125,
0.0052490234375,
0.0064697265625,
0.0167083740234375,
0.02386474609375,
-0.0343017578125,
-0.01258087158203125,
-0.0004742145538330078,
0.01788330078125,
0.01512908935546875,
0.02655029296875,
0.00836181640625,
-0.0288848876953125,
-0.0021152496337890625,
-0.006988525390625,
0.006519317626953125,
-0.0163726806640625,
-0.057525634765625,
-0.0037689208984375,
-0.0243072509765625,
0.027587890625,
0.006641387939453125,
0.01039886474609375,
-0.003662109375,
0.01690673828125,
0.00902557373046875,
-0.10504150390625,
-0.0367431640625,
0.0316162109375,
0.019683837890625,
-0.0163116455078125,
0.00719451904296875,
-0.037567138671875,
0.005573272705078125,
0.03369140625,
-0.025848388671875,
0.022705078125,
0.043701171875,
0.01340484619140625,
-0.0276641845703125,
0.0037555694580078125,
0.0304107666015625,
0.04095458984375,
-0.05218505859375,
0.0156402587890625,
0.052978515625,
0.0222930908203125,
-0.051361083984375,
-0.010711669921875,
-0.02288818359375,
-0.0230255126953125,
-0.02215576171875,
0.0540771484375,
0.034332275390625,
0.021514892578125,
-0.007663726806640625,
-0.012542724609375,
0.11187744140625,
-0.03863525390625,
-0.0295257568359375,
0.00975799560546875,
-0.054473876953125,
-0.0022754669189453125,
0.0035800933837890625,
0.01064300537109375,
0.02337646484375,
-0.0126495361328125,
-0.0278167724609375,
0.046142578125,
0.0099334716796875,
0.0172576904296875,
-0.0238189697265625,
0.01389312744140625,
0.00795745849609375,
0.0198516845703125,
-0.027496337890625,
0.015045166015625,
0.0023651123046875,
-0.0015916824340820312,
0.016204833984375,
0.004734039306640625,
-0.01316070556640625,
-0.023956298828125,
0.023101806640625,
0.019805908203125,
0.01194000244140625,
0.035400390625,
0.0033111572265625,
0.0029582977294921875,
0.00832366943359375,
-0.0369873046875,
0.020599365234375,
0.00907135009765625,
-0.006744384765625,
0.044586181640625,
0.035400390625,
-0.00823974609375,
-0.0142974853515625,
-0.0265350341796875,
0.019195556640625,
0.0002582073211669922,
-0.01204681396484375,
-0.005138397216796875,
0.02667236328125,
-0.0035381317138671875,
-0.0231475830078125,
0.00350189208984375,
0.038787841796875,
-0.0269317626953125,
-0.016510009765625,
-0.0012302398681640625,
0.0335693359375,
-0.0380859375,
-0.006866455078125,
0.033111572265625,
-0.0312347412109375,
0.006076812744140625,
-0.011871337890625,
-0.0227813720703125,
-0.005870819091796875,
0.0208892822265625,
-0.0002651214599609375,
-0.0265350341796875,
0.009002685546875,
0.07220458984375,
0.01549530029296875,
-0.00836944580078125,
-0.0004782676696777344,
-0.0302581787109375,
-0.0194549560546875,
-0.01971435546875,
-0.07086181640625,
-0.069091796875,
-0.02685546875,
-0.06390380859375,
-0.00007420778274536133,
0.037384033203125,
-0.0306549072265625,
-0.0125885009765625,
0.061920166015625,
0.01271820068359375,
-0.0261383056640625,
-0.06390380859375,
-0.028106689453125,
-0.07269287109375,
-0.04437255859375,
0.00656890869140625,
0.00872802734375,
0.001033782958984375,
0.005397796630859375,
0.06988525390625,
0.0095977783203125,
-0.06536865234375,
0.002567291259765625,
0.03778076171875,
0.0008034706115722656,
0.05047607421875,
0.01129913330078125,
0.004131317138671875,
-0.04290771484375,
0.035919189453125,
-0.00482177734375,
-0.031494140625,
-0.0068817138671875,
-0.025054931640625,
-0.01104736328125,
0.054351806640625,
0.0345458984375,
-0.009796142578125,
0.012786865234375,
0.08734130859375,
0.036834716796875,
0.01201629638671875,
-0.060546875,
-0.0300140380859375,
-0.0760498046875,
0.04541015625,
0.052825927734375,
0.01045989990234375,
-0.015899658203125,
0.0201263427734375,
-0.01010894775390625,
-0.01184844970703125,
-0.0020313262939453125,
-0.0038967132568359375,
0.031707763671875,
0.0003490447998046875,
-0.0218353271484375,
0.002391815185546875,
-0.0121917724609375,
-0.0265655517578125,
0.015777587890625,
-0.0189056396484375,
0.01334381103515625,
0.01224517822265625,
0.0136260986328125,
-0.01180267333984375,
-0.02850341796875,
0.0128173828125,
-0.01276397705078125,
0.025177001953125,
-0.0364990234375,
-0.00600433349609375,
-0.03631591796875,
0.04901123046875,
-0.05645751953125,
-0.03094482421875,
-0.0215301513671875,
0.01885986328125,
0.010650634765625,
-0.080322265625,
0.0183258056640625,
-0.0309906005859375,
-0.07440185546875,
0.039703369140625,
0.0151214599609375,
-0.0143585205078125,
-0.0287017822265625,
0.029327392578125,
-0.061798095703125,
-0.0209503173828125,
0.02581787109375,
-0.050048828125,
-0.0189056396484375,
0.02056884765625,
-0.0214691162109375,
-0.0220184326171875,
-0.0161285400390625,
-0.037811279296875,
-0.045562744140625,
-0.00749969482421875,
-0.039581298828125,
0.033111572265625,
0.031341552734375,
-0.017181396484375,
-0.0003597736358642578,
0.035003662109375,
0.058258056640625,
0.0301361083984375,
0.02197265625,
-0.039825439453125,
-0.006252288818359375,
-0.00046443939208984375,
0.030059814453125,
-0.0205230712890625,
-0.0090789794921875,
-0.01380157470703125,
-0.0298919677734375,
-0.0193328857421875,
-0.01428985595703125,
-0.034423828125,
0.0300750732421875,
-0.0282745361328125,
-0.03045654296875,
-0.055908203125,
-0.021392822265625,
0.0005459785461425781,
0.00551605224609375,
-0.02801513671875,
-0.045074462890625,
-0.02642822265625,
-0.006641387939453125,
-0.0157012939453125,
-0.04443359375,
0.0027027130126953125,
0.0117034912109375,
0.046875,
-0.0167999267578125,
0.05950927734375,
-0.00823211669921875,
0.024200439453125,
-0.004268646240234375,
0.0198974609375,
-0.0002187490463256836,
-0.040069580078125,
0.05987548828125,
0.0018053054809570312,
0.0010118484497070312,
0.0040130615234375,
0.04119873046875,
0.006649017333984375,
-0.03125,
0.0292816162109375,
0.0135650634765625,
-0.0229034423828125,
0.0030155181884765625,
-0.0234832763671875,
-0.014862060546875,
-0.04083251953125,
0.04718017578125,
0.0227508544921875,
-0.003040313720703125,
-0.06939697265625,
0.0030193328857421875,
-0.01369476318359375,
0.0264739990234375,
0.048004150390625,
0.06072998046875,
-0.0121612548828125,
0.017730712890625,
0.037109375,
0.0113677978515625,
-0.0194549560546875,
0.049713134765625,
-0.006519317626953125,
0.053436279296875,
-0.02789306640625,
0.012725830078125,
-0.0199737548828125,
0.014495849609375,
0.0213165283203125,
0.0162811279296875,
-0.0207977294921875,
-0.0068359375,
0.019439697265625,
-0.0220794677734375,
0.002410888671875,
0.0188140869140625,
-0.0014743804931640625,
-0.00974273681640625,
0.01229095458984375,
-0.0215911865234375,
0.007541656494140625,
0.03411865234375,
-0.0118865966796875,
-0.0080108642578125,
-0.0076141357421875,
-0.01084136962890625,
-0.037445068359375,
0.065673828125,
-0.01678466796875,
0.01678466796875,
0.0025501251220703125,
-0.044342041015625,
-0.039031982421875,
0.040496826171875,
0.0159912109375,
-0.016448974609375,
0.01410675048828125,
0.0191497802734375,
0.07635498046875,
-0.0274200439453125,
-0.012420654296875,
0.03948974609375,
0.043548583984375,
-0.0023136138916015625,
-0.0078277587890625,
-0.0009713172912597656,
-0.00560760498046875,
-0.019989013671875,
0.0149383544921875,
-0.0180206298828125,
-0.0194549560546875,
-0.044281005859375,
0.0008902549743652344,
0.051971435546875,
0.0144500732421875,
-0.057708740234375,
0.025909423828125,
-0.0384521484375,
0.00909423828125,
-0.01123809814453125,
-0.07159423828125,
0.0615234375,
0.06341552734375,
-0.05322265625,
-0.013397216796875,
0.0179443359375,
-0.04010009765625,
-0.0244903564453125,
-0.022674560546875,
-0.019012451171875,
0.054473876953125,
-0.013397216796875,
0.0247802734375,
-0.047454833984375,
0.0199127197265625,
-0.0210418701171875,
-0.01326751708984375,
0.0478515625,
0.0204315185546875,
-0.005573272705078125,
-0.006137847900390625,
-0.0323486328125,
-0.020111083984375,
-0.004642486572265625,
-0.0238494873046875,
-0.0169830322265625,
-0.0011463165283203125,
-0.00743865966796875,
0.004024505615234375,
-0.01244354248046875,
-0.0035991668701171875,
-0.054443359375,
0.038299560546875,
0.04681396484375,
0.0221405029296875,
-0.01525115966796875,
0.07269287109375,
-0.0302276611328125,
0.005214691162109375,
0.0009107589721679688,
0.02099609375,
-0.0158843994140625,
0.008544921875,
-0.0034503936767578125,
-0.0006365776062011719,
0.00098419189453125,
-0.0205841064453125,
0.008575439453125,
-0.006877899169921875,
0.05047607421875,
-0.004932403564453125,
0.062286376953125,
-0.0203399658203125,
0.005695343017578125,
-0.01094818115234375,
-0.0199737548828125,
-0.058380126953125,
0.0258636474609375,
0.0118408203125,
-0.03173828125,
0.005313873291015625,
0.04559326171875,
-0.0195770263671875,
0.0276031494140625,
0.0076446533203125,
0.03558349609375,
-0.0011129379272460938,
-0.0269012451171875,
0.06256103515625,
0.04266357421875,
-0.0465087890625,
0.020355224609375,
0.01380157470703125,
-0.004924774169921875,
0.0347900390625,
-0.003406524658203125,
-0.031890869140625,
0.0179595947265625,
0.0577392578125,
0.0011615753173828125,
0.00144195556640625,
0.039825439453125,
-0.0225982666015625,
-0.0161285400390625,
-0.005405426025390625,
0.00019788742065429688,
-0.0214385986328125,
-0.007732391357421875,
-0.01490020751953125,
-0.0085296630859375,
0.0160675048828125,
-0.00795745849609375,
0.0055694580078125,
-0.009185791015625,
0.0254974365234375,
-0.00188446044921875,
-0.01204681396484375,
0.01023101806640625,
-0.0081024169921875,
-0.01416778564453125,
-0.0299072265625,
0.0220489501953125,
-0.007488250732421875,
-0.003143310546875,
-0.041717529296875,
0.00318145751953125,
-0.040740966796875,
-0.0259246826171875,
-0.0011692047119140625,
-0.0038318634033203125,
0.01018524169921875,
-0.0184173583984375,
0.036590576171875,
-0.062286376953125,
0.049835205078125,
0.01230621337890625,
0.0293121337890625,
0.01541900634765625,
0.04595947265625,
-0.01372528076171875,
0.0036716461181640625,
0.00921630859375,
-0.0211181640625,
0.01021575927734375,
0.0158538818359375,
0.04180908203125,
-0.0287017822265625,
-0.057891845703125,
-0.0011110305786132812,
-0.0687255859375,
0.003589630126953125,
0.004261016845703125,
0.0185089111328125,
0.0657958984375,
-0.035308837890625,
-0.0194549560546875,
0.0116424560546875,
-0.0009212493896484375,
0.0199737548828125,
-0.00945281982421875,
0.00885772705078125,
-0.0014171600341796875,
0.0284881591796875,
-0.0025768280029296875,
0.0255126953125,
-0.006549835205078125,
-0.022705078125,
-0.0279998779296875,
0.0631103515625,
-0.01371002197265625,
0.0211181640625,
0.03564453125,
0.027130126953125,
-0.0135650634765625,
0.0002751350402832031,
-0.054656982421875,
0.05072021484375,
0.0435791015625,
0.033538818359375,
-0.046875,
-0.00458526611328125,
-0.0023040771484375,
0.014617919921875,
0.006320953369140625,
-0.00708770751953125,
-0.024566650390625,
0.013397216796875,
0.0753173828125,
0.031585693359375,
0.01546478271484375,
0.0290679931640625,
-0.01255035400390625,
-0.03472900390625,
0.018096923828125,
-0.00678253173828125,
0.0357666015625,
-0.0220489501953125,
-0.0276336669921875,
-0.022430419921875,
0.01751708984375,
0.0204620361328125,
-0.018402099609375,
-0.005680084228515625,
0.01039886474609375,
-0.01464080810546875,
-0.0024509429931640625,
-0.003986358642578125,
0.01068115234375,
0.026458740234375,
0.01244354248046875,
-0.045257568359375,
-0.080078125,
-0.01849365234375,
0.0169219970703125,
0.000637054443359375,
0.0185699462890625,
-0.0170135498046875,
0.0267791748046875,
-0.007221221923828125,
-0.014495849609375,
0.0012159347534179688,
0.057952880859375,
-0.08990478515625,
-0.00923919677734375,
0.046722412109375,
0.0306854248046875,
0.0292816162109375,
-0.0009579658508300781,
0.039459228515625,
0.02197265625,
-0.0149078369140625,
-0.0321044921875,
0.0149688720703125,
-0.004085540771484375,
-0.021514892578125,
0.0133209228515625,
0.0244598388671875,
-0.020538330078125,
-0.0019969940185546875,
0.0017032623291015625,
-0.048614501953125,
0.0276336669921875,
0.034271240234375,
0.021514892578125,
-0.0112152099609375,
0.01508331298828125,
-0.05145263671875,
-0.01232147216796875,
-0.0124053955078125,
0.0204315185546875,
0.0229644775390625,
0.006542205810546875,
0.0303497314453125,
-0.0148162841796875,
0.00708770751953125,
-0.0009860992431640625,
-0.03271484375,
-0.020782470703125,
0.01407623291015625,
-0.0225982666015625,
0.00799560546875,
0.002094268798828125,
0.0364990234375,
-0.007167816162109375,
0.04541015625,
0.03582763671875,
-0.00745391845703125,
-0.036468505859375,
0.0003833770751953125,
0.03790283203125,
-0.048248291015625,
-0.0233917236328125,
-0.0306396484375,
0.01001739501953125,
0.0665283203125,
0.0174560546875,
0.0170440673828125,
-0.00649261474609375,
0.07513427734375,
-0.0257415771484375,
0.004878997802734375,
0.005130767822265625,
-0.0241546630859375,
0.010528564453125,
0.0309295654296875,
0.0170745849609375,
0.0160675048828125,
-0.1046142578125,
-0.046600341796875,
0.0161285400390625,
-0.0279388427734375,
0.049285888671875,
0.052703857421875,
-0.0309600830078125,
0.015960693359375,
0.0565185546875,
-0.00588226318359375,
-0.035797119140625,
0.0169219970703125,
0.025543212890625,
0.0307159423828125,
0.025146484375,
0.053009033203125,
-0.0185546875,
-0.005157470703125,
0.004009246826171875,
0.00826263427734375,
0.0279693603515625,
0.01025390625,
0.023101806640625,
0.0233154296875,
-0.006671905517578125,
0.034423828125,
-0.053009033203125,
-0.025054931640625,
0.0311431884765625,
-0.03143310546875,
0.02166748046875,
0.011688232421875,
-0.03619384765625,
0.0201873779296875,
0.04705810546875,
0.0010671615600585938,
0.03533935546875,
-0.0201568603515625,
0.0088653564453125,
-0.031890869140625,
0.0233306884765625,
-0.009246826171875,
-0.0035037994384765625,
-0.0032978057861328125,
-0.0195770263671875,
0.0394287109375,
0.03448486328125,
0.00566864013671875,
0.05169677734375,
-0.004932403564453125,
-0.04150390625,
0.0217742919921875,
-0.060943603515625,
0.0287322998046875,
0.0278778076171875,
0.00926971435546875,
-0.035125732421875,
0.01555633544921875,
0.0005426406860351562,
0.00589752197265625,
0.00444793701171875,
0.03485107421875,
0.03497314453125,
-0.04437255859375,
0.051300048828125,
0.055206298828125,
0.04925537109375,
-0.034912109375,
0.012359619140625,
0.0501708984375,
-0.0158233642578125,
0.02801513671875,
-0.0411376953125,
-0.033233642578125,
-0.057037353515625,
0.0218963623046875,
0.0190582275390625,
-0.0014314651489257812,
-0.012542724609375,
-0.01447296142578125,
0.00580596923828125,
0.0509033203125,
0.022491455078125,
-0.0689697265625,
0.039764404296875,
-0.0230255126953125,
0.052154541015625,
-0.01499176025390625,
-0.00690460205078125,
-0.003276824951171875,
-0.002460479736328125,
-0.01403045654296875,
0.0157928466796875,
-0.03662109375,
-0.00797271728515625,
-0.00966644287109375,
0.041015625,
0.05523681640625,
-0.032470703125,
0.0011415481567382812,
-0.00215911865234375,
0.023590087890625,
0.0516357421875,
-0.0161590576171875,
-0.0443115234375,
-0.031036376953125,
-0.021575927734375,
0.035736083984375,
0.052825927734375,
0.031707763671875,
-0.03204345703125,
-0.060211181640625,
0.0257415771484375,
-0.01715087890625,
0.0191497802734375,
-0.0496826171875,
-0.1051025390625,
0.0888671875,
-0.00830078125,
-0.044891357421875,
-0.0009756088256835938,
-0.0019521713256835938,
-0.03509521484375,
0.0217132568359375,
0.0029354095458984375,
-0.0304718017578125,
0.033477783203125,
0.0333251953125,
0.01464080810546875,
0.005916595458984375,
0.02203369140625,
-0.01593017578125,
-0.04791259765625,
-0.0016965866088867188,
-0.007465362548828125,
0.0140838623046875,
-0.02490234375,
0.032684326171875,
0.0035953521728515625,
0.02972412109375,
-0.0167083740234375,
0.002895355224609375,
0.01258087158203125,
0.00811767578125,
0.036773681640625,
-0.0030498504638671875,
-0.0301971435546875,
-0.02374267578125,
0.0235443115234375,
0.00803375244140625,
0.01275634765625,
0.00864410400390625,
-0.01261138916015625,
-0.047760009765625,
-0.03668212890625,
-0.0121612548828125,
0.011474609375,
-0.06793212890625,
-0.0015592575073242188,
0.029754638671875,
-0.032440185546875,
-0.01983642578125,
0.0163116455078125,
-0.051116943359375,
0.01262664794921875,
0.030517578125,
0.0171051025390625,
-0.05322265625,
-0.0533447265625,
0.028717041015625,
-0.023681640625,
-0.00998687744140625,
0.0275115966796875,
0.0214691162109375,
0.01654052734375,
0.099365234375,
0.027801513671875,
0.0166015625,
-0.054290771484375,
-0.0045013427734375,
0.00997161865234375,
0.003204345703125,
-0.039306640625,
-0.0237274169921875,
-0.0107269287109375,
-0.0012121200561523438,
0.017120361328125,
0.0078125,
-0.00792694091796875,
-0.00617218017578125,
-0.00665283203125,
0.0034770965576171875,
-0.0078125,
0.057220458984375,
0.01340484619140625,
0.0404052734375,
-0.0023193359375,
-0.013702392578125,
0.0238800048828125,
-0.02740478515625,
0.0026702880859375,
-0.02032470703125,
-0.00897979736328125,
-0.0908203125,
0.0550537109375,
0.00789642333984375,
0.006561279296875,
0.0465087890625
] |
945b8a34b121c1ee9f0318388c4e3599188b4079
|
Wordpress Stackexchange
Q: When we register a custom taxonomy or post type, does the WP database modified at all? When you use the register post type and register taxonomy functions in your functions.php, where do all that setting info get stored in regards to the CT's and CPT's you are registering?
I'm talking about the settings such as whether the CPT is public or not, which custom post types work with which registered taxonomies, whether custom taxonomy is hierarchical or not etc.
Is that all on the server memory? If so, what's the reason of not saving it on the database -for example in wp_options table?
Isn't the wp_options table specifically deal with stuff like this?
A: When you register post type it is stored in a global var name $wp_post_types
and the taxonomies are stored in a global var named $wp_taxonomies
Its all in the memory since you need it all and if it was stored in the database you would need to pull it from the database and then it would still be in the memory.
|
Q: When we register a custom taxonomy or post type, does the WP database modified at all? When you use the register post type and register taxonomy functions in your functions.php, where do all that setting info get stored in regards to the CT's and CPT's you are registering?
I'm talking about the settings such as whether the CPT is public or not, which custom post types work with which registered taxonomies, whether custom taxonomy is hierarchical or not etc.
Is that all on the server memory? If so, what's the reason of not saving it on the database -for example in wp_options table?
Isn't the wp_options table specifically deal with stuff like this?
A: When you register post type it is stored in a global var name $wp_post_types
and the taxonomies are stored in a global var named $wp_taxonomies
Its all in the memory since you need it all and if it was stored in the database you would need to pull it from the database and then it would still be in the memory.
|
wordpress
|
{
"language": "en",
"length": 176,
"provenance": "stackexchange_00019.jsonl.gz:419980",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52189"
}
|
[
0.0479736328125,
-0.004795074462890625,
-0.01303863525390625,
-0.056732177734375,
0.0243988037109375,
-0.0228118896484375,
0.031402587890625,
0.0214385986328125,
0.0035877227783203125,
0.0224761962890625,
-0.046600341796875,
-0.01132965087890625,
-0.0209197998046875,
-0.00516510009765625,
-0.031463623046875,
-0.048126220703125,
0.0248870849609375,
-0.00196075439453125,
0.051116943359375,
0.007236480712890625,
0.0163421630859375,
0.013275146484375,
0.04156494140625,
0.00970458984375,
0.0321044921875,
-0.057373046875,
0.03778076171875,
-0.0291900634765625,
0.03509521484375,
-0.0113677978515625,
0.032470703125,
-0.0037136077880859375,
0.02874755859375,
0.005153656005859375,
-0.021453857421875,
0.005863189697265625,
0.011383056640625,
0.00104522705078125,
-0.006500244140625,
0.02734375,
0.01262664794921875,
-0.006221771240234375,
0.03948974609375,
-0.01432037353515625,
-0.0001729726791381836,
-0.04168701171875,
0.0037517547607421875,
-0.039306640625,
0.0121917724609375,
-0.035797119140625,
0.037628173828125,
0.009429931640625,
0.07373046875,
-0.06121826171875,
-0.029541015625,
-0.005634307861328125,
-0.00971221923828125,
-0.026702880859375,
0.0236663818359375,
0.004329681396484375,
-0.0113983154296875,
-0.031036376953125,
0.03460693359375,
-0.01242828369140625,
-0.00478363037109375,
0.013458251953125,
0.0411376953125,
0.01511383056640625,
-0.084228515625,
-0.031585693359375,
0.0433349609375,
-0.035797119140625,
-0.0011816024780273438,
0.01528167724609375,
-0.01111602783203125,
-0.047210693359375,
0.0278778076171875,
-0.0192718505859375,
-0.000016987323760986328,
0.045257568359375,
0.009185791015625,
-0.049530029296875,
0.01157379150390625,
0.022613525390625,
-0.0167083740234375,
0.04339599609375,
-0.0106353759765625,
-0.0145263671875,
-0.009124755859375,
-0.009735107421875,
-0.0153045654296875,
-0.0199432373046875,
-0.0135955810546875,
0.0182342529296875,
-0.00804901123046875,
-0.016845703125,
0.03955078125,
0.037017822265625,
-0.026031494140625,
0.0012311935424804688,
0.00958251953125,
-0.0487060546875,
0.05364990234375,
-0.0266571044921875,
0.045745849609375,
0.036346435546875,
-0.030914306640625,
-0.036956787109375,
0.04168701171875,
-0.003513336181640625,
0.004604339599609375,
0.0006766319274902344,
-0.007350921630859375,
-0.053680419921875,
0.01428985595703125,
0.04248046875,
-0.0036296844482421875,
0.0200347900390625,
0.005126953125,
-0.0012454986572265625,
0.01409149169921875,
0.035614013671875,
0.04083251953125,
-0.0389404296875,
0.00873565673828125,
-0.00466156005859375,
-0.0181427001953125,
-0.05303955078125,
-0.06121826171875,
0.06787109375,
-0.0168609619140625,
-0.0101470947265625,
0.041168212890625,
0.044677734375,
-0.0021114349365234375,
-0.033203125,
0.0518798828125,
-0.000027835369110107422,
-0.01788330078125,
0.030487060546875,
0.0057830810546875,
-0.02789306640625,
-0.0185394287109375,
-0.02227783203125,
0.006591796875,
0.03106689453125,
0.0215911865234375,
0.01361083984375,
-0.01448822021484375,
-0.0298004150390625,
0.005680084228515625,
-0.007076263427734375,
0.060272216796875,
0.000019073486328125,
-0.053131103515625,
-0.0263824462890625,
0.028656005859375,
-0.028564453125,
-0.04693603515625,
-0.07080078125,
-0.00818634033203125,
-0.032989501953125,
-0.01554107666015625,
0.000041484832763671875,
-0.0218658447265625,
0.06695556640625,
-0.0178680419921875,
-0.0017337799072265625,
0.0263214111328125,
-0.006397247314453125,
0.0279388427734375,
-0.0168304443359375,
-0.005077362060546875,
-0.0012540817260742188,
0.0062713623046875,
0.0069732666015625,
0.018035888671875,
-0.035400390625,
0.036041259765625,
0.034912109375,
-0.02703857421875,
-0.0268707275390625,
0.034454345703125,
-0.0335693359375,
-0.039703369140625,
0.011962890625,
0.006824493408203125,
0.057037353515625,
0.0291595458984375,
0.02655029296875,
-0.00740814208984375,
-0.0111846923828125,
-0.07183837890625,
0.01551055908203125,
0.02520751953125,
0.04425048828125,
-0.035400390625,
0.00952911376953125,
0.00516510009765625,
-0.0294647216796875,
-0.07476806640625,
0.0110626220703125,
-0.0029773712158203125,
0.0181884765625,
-0.02569580078125,
0.0145111083984375,
-0.0132293701171875,
0.045013427734375,
0.00013840198516845703,
0.0210723876953125,
0.005504608154296875,
0.01367950439453125,
-0.02294921875,
-0.0283660888671875,
-0.03326416015625,
0.0131683349609375,
-0.01500701904296875,
0.038299560546875,
-0.0017681121826171875,
-0.0010700225830078125,
-0.0150299072265625,
-0.02569580078125,
0.0006852149963378906,
0.0157623291015625,
0.0262908935546875,
0.039581298828125,
-0.0278778076171875,
0.006275177001953125,
0.02099609375,
0.0360107421875,
-0.0303955078125,
0.005573272705078125,
0.0245208740234375,
-0.0092010498046875,
-0.03314208984375,
-0.016693115234375,
-0.01358795166015625,
-0.100830078125,
0.005252838134765625,
0.06585693359375,
0.018402099609375,
-0.0046539306640625,
-0.02117919921875,
0.035614013671875,
0.032958984375,
-0.005748748779296875,
0.000522613525390625,
0.03070068359375,
0.01995849609375,
0.053192138671875,
0.01253509521484375,
0.0028076171875,
0.0095977783203125,
0.00994110107421875,
0.0265350341796875,
0.0101165771484375,
-0.02276611328125,
-0.0177001953125,
0.06396484375,
-0.032684326171875,
-0.00946044921875,
-0.03680419921875,
-0.007381439208984375,
-0.00736236572265625,
0.0198516845703125,
0.02960205078125,
0.0380859375,
0.0236053466796875,
-0.0164794921875,
0.01192474365234375,
0.003814697265625,
-0.01279449462890625,
0.0031604766845703125,
-0.0289764404296875,
0.002460479736328125,
0.0193328857421875,
-0.0257568359375,
0.0207366943359375,
0.0025234222412109375,
-0.0251922607421875,
-0.0241241455078125,
0.01033782958984375,
-0.05706787109375,
-0.00975799560546875,
-0.02435302734375,
-0.07269287109375,
0.0029239654541015625,
0.04345703125,
-0.042724609375,
-0.045166015625,
-0.001983642578125,
0.0229339599609375,
-0.031402587890625,
0.016632080078125,
-0.0038299560546875,
-0.0208587646484375,
0.00261688232421875,
-0.00799560546875,
0.00843048095703125,
-0.00638580322265625,
0.041595458984375,
0.058135986328125,
0.018341064453125,
-0.00482940673828125,
0.00714111328125,
-0.0126495361328125,
0.0164031982421875,
0.007740020751953125,
-0.004505157470703125,
-0.02069091796875,
-0.0216522216796875,
0.040985107421875,
0.0020198822021484375,
0.005825042724609375,
-0.0153045654296875,
-0.045745849609375,
-0.019439697265625,
0.0030059814453125,
-0.07025146484375,
-0.0224761962890625,
-0.046295166015625,
-0.0067138671875,
0.0004992485046386719,
-0.02874755859375,
0.01202392578125,
0.00982666015625,
-0.0426025390625,
0.0254974365234375,
0.0218963623046875,
-0.063720703125,
-0.047332763671875,
-0.08087158203125,
-0.07623291015625,
-0.049285888671875,
0.0161285400390625,
0.00670623779296875,
-0.002197265625,
0.0911865234375,
0.01678466796875,
-0.062347412109375,
0.0017242431640625,
-0.042236328125,
-0.016021728515625,
0.0382080078125,
0.037109375,
-0.0721435546875,
0.0457763671875,
-0.0008416175842285156,
-0.006534576416015625,
0.0193328857421875,
-0.001125335693359375,
-0.0260009765625,
0.037353515625,
0.009521484375,
0.048065185546875,
0.00405120849609375,
-0.053863525390625,
0.01509857177734375,
0.021820068359375,
-0.040679931640625,
-0.0290374755859375,
-0.0011796951293945312,
-0.0241851806640625,
0.02618408203125,
0.0027866363525390625,
-0.0094146728515625,
-0.02166748046875,
0.047088623046875,
0.01256561279296875,
0.0167388916015625,
-0.0010633468627929688,
-0.01397705078125,
0.01763916015625,
0.00807952880859375,
-0.0012083053588867188,
-0.0184783935546875,
0.0094757080078125,
-0.00861358642578125,
0.0016155242919921875,
0.006866455078125,
0.00899505615234375,
-0.0205535888671875,
0.0182037353515625,
-0.0587158203125,
-0.09820556640625,
0.036041259765625,
-0.067626953125,
-0.025177001953125,
-0.032257080078125,
-0.0101776123046875,
0.033782958984375,
0.1171875,
-0.028564453125,
0.0014190673828125,
0.0034351348876953125,
0.01052093505859375,
-0.0191802978515625,
-0.05035400390625,
-0.040374755859375,
-0.017913818359375,
-0.039520263671875,
-0.00904083251953125,
-0.00698089599609375,
-0.0225982666015625,
-0.025390625,
0.03350830078125,
-0.047210693359375,
-0.0225982666015625,
0.034637451171875,
-0.0277252197265625,
0.02996826171875,
-0.00423431396484375,
0.047821044921875,
-0.049285888671875,
0.00811767578125,
-0.0301513671875,
-0.08062744140625,
-0.01459503173828125,
-0.0174407958984375,
0.054107666015625,
0.002658843994140625,
-0.0217437744140625,
-0.0219573974609375,
0.0292510986328125,
0.02197265625,
-0.0040130615234375,
0.0183563232421875,
0.0032825469970703125,
-0.0099334716796875,
-0.045013427734375,
0.00019872188568115234,
-0.0372314453125,
-0.0169525146484375,
-0.0205535888671875,
-0.022796630859375,
0.02044677734375,
0.00373077392578125,
0.01523590087890625,
0.0285491943359375,
-0.00977325439453125,
-0.039764404296875,
-0.0045928955078125,
-0.057281494140625,
-0.0125579833984375,
-0.006763458251953125,
-0.03460693359375,
0.002349853515625,
-0.06805419921875,
0.030792236328125,
-0.0312042236328125,
0.001220703125,
0.0184173583984375,
0.0877685546875,
0.019744873046875,
0.00429534912109375,
-0.049285888671875,
0.0005311965942382812,
0.056396484375,
0.0091552734375,
0.01274871826171875,
0.04071044921875,
-0.01543426513671875,
0.0022716522216796875,
0.031219482421875,
-0.0416259765625,
-0.0167388916015625,
0.09588623046875,
0.04205322265625,
0.0245819091796875,
-0.018341064453125,
-0.0247802734375,
0.02117919921875,
0.0157470703125,
-0.0247955322265625,
-0.041900634765625,
-0.0087738037109375,
0.06646728515625,
-0.046478271484375,
0.0787353515625,
-0.049652099609375,
-0.03436279296875,
0.037841796875,
-0.0296478271484375,
0.039337158203125,
-0.0204620361328125,
0.00975799560546875,
0.006011962890625,
-0.0289154052734375,
0.01015472412109375,
0.0133514404296875,
-0.003082275390625,
0.04656982421875,
0.0217742919921875,
0.051544189453125,
0.03936767578125,
-0.0238189697265625,
0.00434112548828125,
-0.0028324127197265625,
-0.0390625,
-0.0478515625,
-0.01032257080078125,
-0.00441741943359375,
0.0235137939453125,
0.050567626953125,
0.0038967132568359375,
0.052032470703125,
0.02850341796875,
0.0147552490234375,
-0.005649566650390625,
-0.03277587890625,
0.0212249755859375,
-0.03656005859375,
-0.01117706298828125,
0.01454925537109375,
-0.02667236328125,
-0.007965087890625,
0.02093505859375,
-0.002597808837890625,
-0.0199127197265625,
-0.00864410400390625,
0.07489013671875,
0.059112548828125,
0.0086669921875,
0.00565338134765625,
0.01039886474609375,
-0.002384185791015625,
-0.00809478759765625,
-0.0240478515625,
-0.0318603515625,
-0.01427459716796875,
-0.01302337646484375,
0.0245513916015625,
-0.0248870849609375,
-0.0027904510498046875,
0.0419921875,
0.0020961761474609375,
-0.01111602783203125,
-0.006504058837890625,
-0.04638671875,
-0.0538330078125,
-0.00522613525390625,
0.036285400390625,
0.0506591796875,
-0.02099609375,
-0.0162506103515625,
0.0136871337890625,
-0.048095703125,
0.0140838623046875,
-0.018646240234375,
-0.004405975341796875,
-0.0035228729248046875,
-0.004337310791015625,
-0.047821044921875,
0.004611968994140625,
0.011383056640625,
0.01064300537109375,
-0.0311279296875,
0.0182037353515625,
-0.02703857421875,
-0.0011949539184570312,
-0.0211029052734375,
0.01495361328125,
0.007022857666015625,
-0.02557373046875,
0.03167724609375,
0.0018863677978515625,
0.06292724609375,
0.0160369873046875,
-0.0171661376953125,
-0.00527191162109375,
-0.01214599609375,
-0.005130767822265625,
0.0163726806640625,
-0.033294677734375,
-0.0177764892578125,
-0.0132904052734375,
0.0045318603515625,
-0.0036830902099609375,
0.00321197509765625,
-0.019256591796875,
-0.012847900390625,
0.01541900634765625,
0.03375244140625,
-0.0014677047729492188,
-0.0013065338134765625,
0.06365966796875,
-0.035736083984375,
0.06475830078125,
-0.00397491455078125,
0.006679534912109375,
-0.0325927734375,
-0.0125732421875,
-0.0159912109375,
-0.06011962890625,
-0.0166778564453125,
-0.01105499267578125,
-0.0169525146484375,
0.07012939453125,
0.05999755859375,
0.0048675537109375,
0.01428985595703125,
-0.001964569091796875,
0.0019931793212890625,
-0.0029125213623046875,
-0.003314971923828125,
-0.0007429122924804688,
-0.00225830078125,
0.048004150390625,
-0.0226287841796875,
-0.01071929931640625,
0.041473388671875,
0.0025653839111328125,
0.0226287841796875,
-0.00936126708984375,
0.01239013671875,
0.0161285400390625,
-0.00847625732421875,
-0.0073394775390625,
-0.00907135009765625,
0.048187255859375,
0.04620361328125,
-0.0267486572265625,
0.045379638671875,
-0.004222869873046875,
0.0076904296875,
-0.081298828125,
-0.026702880859375,
0.03582763671875,
0.018646240234375,
-0.0249786376953125,
0.034423828125,
-0.0176544189453125,
-0.006603240966796875,
0.041656494140625,
0.038238525390625,
-0.0738525390625,
0.003082275390625,
0.04376220703125,
0.0063934326171875,
-0.0440673828125,
0.03826904296875,
-0.060577392578125,
-0.044281005859375,
-0.061737060546875,
-0.0167694091796875,
-0.056427001953125,
-0.042755126953125,
0.044036865234375,
-0.01029205322265625,
0.0023021697998046875,
0.034210205078125,
0.0104522705078125,
0.02398681640625,
-0.0201568603515625,
-0.02081298828125,
-0.0029087066650390625,
-0.01544952392578125,
0.03460693359375,
0.00951385498046875,
0.00487518310546875,
-0.043060302734375,
0.04119873046875,
0.0012865066528320312,
-0.0199432373046875,
0.0088043212890625,
-0.005950927734375,
0.0406494140625,
0.03802490234375,
0.001438140869140625,
-0.0052337646484375,
-0.00014650821685791016,
-0.0011892318725585938,
-0.0291748046875,
-0.035614013671875,
-0.003398895263671875,
0.038909912109375,
-0.033203125,
0.0316162109375,
-0.01245880126953125,
-0.0189666748046875,
-0.01105499267578125,
-0.04229736328125,
0.07470703125,
-0.0771484375,
0.0186004638671875,
0.00531768798828125,
0.020904541015625,
0.027099609375,
-0.004306793212890625,
0.01418304443359375,
-0.020599365234375,
-0.0175018310546875,
-0.0137481689453125,
-0.046630859375,
-0.0199127197265625,
-0.0289459228515625,
-0.01418304443359375,
0.09307861328125,
-0.01407623291015625,
-0.01580810546875,
0.032745361328125,
0.04791259765625,
-0.0310516357421875,
0.046844482421875,
-0.0303192138671875,
0.052764892578125,
-0.0074920654296875,
0.0204010009765625,
-0.056671142578125,
0.0002639293670654297,
-0.0107421875,
0.016265869140625,
0.09033203125,
0.0157318115234375,
0.003345489501953125,
0.01511383056640625,
0.07379150390625,
0.0041046142578125,
-0.03790283203125,
0.0224609375,
-0.011566162109375,
0.05352783203125,
0.030792236328125,
-0.03985595703125,
0.0304718017578125,
0.00598907470703125,
-0.044403076171875,
0.01218414306640625,
0.0112762451171875,
0.009796142578125,
-0.033721923828125,
-0.03814697265625,
-0.0105743408203125,
-0.02618408203125,
0.007396697998046875,
-0.00943756103515625,
-0.01132965087890625,
0.02703857421875,
0.0299224853515625,
-0.006465911865234375,
0.034942626953125,
-0.032562255859375,
0.058380126953125,
0.001651763916015625,
0.0227813720703125,
0.0086517333984375,
0.007610321044921875,
0.045562744140625,
-0.02593994140625,
0.002376556396484375,
-0.0029773712158203125,
-0.01195526123046875,
0.0305328369140625,
0.016937255859375,
0.00390625,
-0.05108642578125,
0.019866943359375,
0.06842041015625,
0.045074462890625,
-0.047637939453125,
-0.052093505859375,
0.0176849365234375,
0.037567138671875,
-0.007053375244140625,
0.034942626953125,
0.0182037353515625,
0.004451751708984375,
0.0712890625,
-0.007175445556640625,
-0.03985595703125,
0.004405975341796875,
0.019744873046875,
-0.001399993896484375,
0.0009622573852539062,
0.0195159912109375,
-0.03271484375,
-0.051666259765625,
0.007205963134765625,
0.0382080078125,
0.06903076171875,
0.01226806640625,
0.06683349609375,
0.0053558349609375,
-0.0281219482421875,
-0.01702880859375,
0.03778076171875,
-0.0125579833984375,
0.011627197265625,
-0.0391845703125,
-0.042572021484375,
0.01546478271484375,
0.03338623046875,
0.012908935546875,
0.0163116455078125,
0.04443359375,
0.05694580078125,
-0.0000667572021484375,
-0.0102386474609375,
0.057220458984375,
0.002841949462890625,
-0.01274871826171875,
-0.0435791015625,
0.04693603515625,
0.039947509765625,
0.0296630859375,
-0.00847625732421875,
0.0174560546875,
0.050079345703125,
-0.020751953125,
0.0106048583984375,
0.004947662353515625,
-0.040924072265625,
0.06903076171875,
-0.00518035888671875,
0.07171630859375,
0.0168609619140625,
-0.035675048828125,
-0.00882720947265625,
-0.0333251953125,
-0.041656494140625,
0.022430419921875,
0.044189453125,
0.0128936767578125,
-0.0218505859375,
-0.005046844482421875,
-0.0182037353515625,
-0.0057220458984375,
0.01166534423828125,
0.00774383544921875,
0.015777587890625,
0.018524169921875,
0.00830078125,
-0.03564453125,
-0.00116729736328125,
0.01319122314453125,
0.0010585784912109375,
-0.030670166015625,
0.0679931640625,
-0.0090789794921875,
0.007320404052734375,
-0.0038299560546875,
0.03302001953125,
-0.0291900634765625,
-0.01277923583984375,
0.048675537109375,
-0.0014591217041015625,
0.01165008544921875,
-0.006591796875,
-0.03985595703125,
0.0263824462890625,
0.0421142578125,
-0.03375244140625,
0.03204345703125,
-0.01390838623046875,
0.00806427001953125,
-0.0426025390625,
0.0211181640625,
-0.0190887451171875,
-0.0306549072265625,
-0.00505828857421875,
-0.00876617431640625,
0.01209259033203125,
0.0163116455078125,
0.0207061767578125,
0.02850341796875,
-0.004917144775390625,
-0.0296783447265625,
0.037567138671875,
-0.0477294921875,
0.07177734375,
0.039825439453125,
-0.025390625,
-0.042999267578125,
0.006927490234375,
-0.0191802978515625,
-0.0027179718017578125,
0.0086822509765625,
0.05059814453125,
0.011138916015625,
-0.0732421875,
-0.002452850341796875,
0.0286407470703125,
0.042449951171875,
-0.00281524658203125,
0.0204010009765625,
-0.006168365478515625,
-0.0122528076171875,
0.0240325927734375,
-0.01380157470703125,
-0.034942626953125,
-0.01849365234375,
-0.017059326171875,
0.031280517578125,
-0.028961181640625,
-0.026123046875,
-0.0987548828125,
-0.019989013671875,
0.07708740234375,
0.01116943359375,
-0.037078857421875,
-0.00893402099609375,
-0.0259552001953125,
0.04205322265625,
0.030853271484375,
-0.0305328369140625,
0.01154327392578125,
0.033294677734375,
0.0070953369140625,
0.017852783203125,
-0.0265350341796875,
-0.02960205078125,
0.01486968994140625,
0.0271759033203125,
0.019622802734375,
-0.0256805419921875,
-0.015380859375,
0.046356201171875,
0.003192901611328125,
0.093017578125,
0.00270843505859375,
-0.032745361328125,
0.01824951171875,
0.0009708404541015625,
0.0007472038269042969,
-0.03704833984375,
-0.0239715576171875,
-0.0172119140625,
0.004688262939453125,
-0.06365966796875,
0.030731201171875,
0.0264434814453125,
-0.021209716796875,
-0.04632568359375,
0.0200347900390625,
-0.025421142578125,
-0.0135498046875,
-0.0501708984375,
0.0177459716796875,
-0.00563812255859375,
0.0217437744140625,
-0.00952911376953125,
-0.029510498046875,
-0.01448822021484375,
0.036865234375,
0.00659942626953125,
0.02642822265625,
0.031280517578125,
-0.0076446533203125,
-0.052490234375,
-0.015625,
-0.023834228515625,
0.0219879150390625,
0.03411865234375,
-0.01342010498046875,
0.037109375,
0.04486083984375,
-0.0352783203125,
0.0118865966796875,
-0.0092926025390625,
-0.00279998779296875,
-0.00676727294921875,
-0.07342529296875,
0.0127410888671875,
-0.0147705078125,
0.05401611328125,
-0.01537322998046875,
-0.0019989013671875,
-0.0237884521484375,
-0.018768310546875,
-0.030548095703125,
-0.0287628173828125,
-0.0157928466796875,
0.017425537109375,
-0.067626953125,
-0.01485443115234375,
0.0266571044921875,
0.000499725341796875,
-0.023284912109375,
0.0244903564453125,
-0.007366180419921875,
-0.00644683837890625,
0.045745849609375,
-0.0205078125,
-0.020660400390625,
0.013397216796875,
-0.059539794921875,
0.015625,
-0.0011606216430664062,
-0.0207672119140625,
-0.0019197463989257812,
-0.03729248046875,
0.03570556640625,
-0.032440185546875,
0.01099395751953125,
-0.021636962890625,
0.019256591796875,
-0.0199127197265625,
0.0189208984375,
-0.032073974609375,
0.02178955078125,
-0.004039764404296875,
0.017730712890625,
-0.01386260986328125,
0.0065460205078125,
-0.00860595703125,
0.0308074951171875,
-0.007232666015625,
0.03778076171875,
0.0086517333984375,
0.0009307861328125,
-0.02069091796875,
0.04443359375,
-0.016937255859375,
-0.0217742919921875,
-0.0080718994140625,
-0.0115814208984375,
0.0177459716796875,
-0.0462646484375,
0.00603485107421875,
-0.0283966064453125,
0.0002522468566894531,
-0.06396484375,
-0.039337158203125,
0.02532958984375
] |
f53a342d25853792a8d7aab40bdaded0bb0a2430
|
Wordpress Stackexchange
Q: Add custom option to Standard Page Attributes Meta Box I'd like to add a simple checkbox option to the exsisting standard Page Attributes Meta Box.
Is there an obvious/intended way to do that using the WordPress API, rather than registering a new metabox for my one new option?
A: Unfortunately not. The only way is to deregister the metabox, and then re-register it, supplying your own callback function which mimics the original metabox, but with your alterations (making sure the names of the inputs do not change).
This method is outlined in these posts:
*
*custom post type taxonomies UI radiobuttons not checkboxes
*Custom-Taxonomy as categories: Remove "most-used" tab?
Alternatively you can insert the options with javascript as outlined in:
*
*How to Add Reminders/Notes to New Post Meta Boxes
|
Q: Add custom option to Standard Page Attributes Meta Box I'd like to add a simple checkbox option to the exsisting standard Page Attributes Meta Box.
Is there an obvious/intended way to do that using the WordPress API, rather than registering a new metabox for my one new option?
A: Unfortunately not. The only way is to deregister the metabox, and then re-register it, supplying your own callback function which mimics the original metabox, but with your alterations (making sure the names of the inputs do not change).
This method is outlined in these posts:
*
*custom post type taxonomies UI radiobuttons not checkboxes
*Custom-Taxonomy as categories: Remove "most-used" tab?
Alternatively you can insert the options with javascript as outlined in:
*
*How to Add Reminders/Notes to New Post Meta Boxes
A:
Stephen Harris gently pointed that I misread the question. Unfortunately, there's no action post_submitbox_publish_actions where we can hook.
So, to make my solution work, the workaround is to make jQuery move the checkbox from its original placement. I've added the script to make this happen.
This is a complete wild attempt to do it, based in
- this Q&A: How to Move the Author Metabox into the "Publish" metabox?
- and the codex first example: http://codex.wordpress.org/Function_Reference/add_meta_box
I'm running the code inside a plugin (wp-content/mu-plugins/tests.php) and haven't tested with functions.php...
I cannot guarantee it is a "correct" code, but it works in my local WordPress.
add_action( 'post_submitbox_misc_actions', 'wpse_52193_custombox_in_publish' );
add_action( 'save_post', 'wpse_52193_save_postdata' );
add_action( 'admin_head', 'wpse_52193_script_enqueuer');
function wpse_52193_custombox_in_publish() {
global $post;
if ('page' != get_post_type($post)) return;
wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_noncename' );
$checked = (get_post_meta($post->ID, 'myplugin_new_field',true)) ? 'checked="yes"' : '';
echo '<div id="myplugin_new_field_div" class="misc-pub-section" style="border-top-style:solid; border-top-width:1px; border-top-color:#EEEEEE; border-bottom-width:0px;"><div style="font-weight: bold;">Description for this field:</div>';
echo '<input name="myplugin_new_field" id="myplugin_new_field" type="checkbox" '.$checked.'>';
echo '</div>';
}
function wpse_52193_save_postdata( $post_id ) {
if ( 'page' != $_POST['post_type'] )
return;
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
if ( !wp_verify_nonce( $_POST['myplugin_noncename'], plugin_basename( __FILE__ ) ) )
return;
$mydata = $_POST['myplugin_new_field'];
update_post_meta($post_id, 'myplugin_new_field', $mydata);
}
function wpse_52193_script_enqueuer(){
global $current_screen;
if('page' != $current_screen->id) return;
echo '<script type="text/javascript">
jQuery(document).ready( function($) {
$("#myplugin_new_field_div").appendTo("#pageparentdiv");
});
</script>';
}
A: the site here have many question for this, like this search, also a google search
also an working example (git rebo), that you can use and change for your requirement
A: I do it like this:
add_action( 'page_attributes_misc_attributes', function() {
global $post; ?>
<p class='post-attributes-label-wrapper'>
<label class='post-attributes-label' for='my_checkbox'>
<input name='my_checkbox' type='checkbox' id='my_checkbox' <? checked( get_post_meta( $post->ID, 'my_checkbox', 1 ) ); ?> />My checkbox
</label>
</p> <?
});
add_action( 'save_post', function() {
$val = isset( $_POST['my_checkbox'] ) ? 1 : 0;
update_post_meta( $_POST['post_ID'], 'my_checkbox', $val );
});
|
wordpress
|
{
"language": "en",
"length": 436,
"provenance": "stackexchange_00019.jsonl.gz:419982",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52193"
}
|
[
0.0662841796875,
-0.003814697265625,
0.0338134765625,
-0.04290771484375,
0.00315093994140625,
-0.00652313232421875,
0.01163482666015625,
-0.04058837890625,
0.00009715557098388672,
0.02984619140625,
0.004669189453125,
-0.0240478515625,
-0.003047943115234375,
-0.03436279296875,
-0.0247802734375,
-0.0203704833984375,
0.03582763671875,
-0.0069732666015625,
0.03460693359375,
-0.0130767822265625,
0.006893157958984375,
0.0019254684448242188,
0.0274200439453125,
0.034210205078125,
0.04046630859375,
-0.045928955078125,
-0.02020263671875,
-0.0178375244140625,
0.02264404296875,
-0.004913330078125,
0.0252685546875,
0.0030956268310546875,
0.0197601318359375,
0.012542724609375,
0.006702423095703125,
0.0650634765625,
0.03265380859375,
-0.005298614501953125,
0.021331787109375,
0.0207061767578125,
0.039093017578125,
-0.0250091552734375,
0.01038360595703125,
0.0280609130859375,
-0.006343841552734375,
-0.027069091796875,
0.037261962890625,
-0.038543701171875,
0.0122222900390625,
-0.036346435546875,
0.00897979736328125,
-0.012603759765625,
0.035247802734375,
-0.0859375,
-0.0167083740234375,
-0.0189666748046875,
-0.0022678375244140625,
-0.0289306640625,
0.019775390625,
0.01409149169921875,
-0.00238037109375,
-0.00884246826171875,
0.01459503173828125,
-0.02386474609375,
0.04248046875,
-0.01227569580078125,
-0.0120849609375,
0.023345947265625,
-0.025115966796875,
0.037811279296875,
0.0238189697265625,
-0.03936767578125,
0.0140228271484375,
-0.0258636474609375,
0.00012862682342529297,
-0.00815582275390625,
-0.01299285888671875,
-0.021636962890625,
0.0153656005859375,
0.01335906982421875,
0.01313018798828125,
0.0241241455078125,
-0.0017061233520507812,
-0.018341064453125,
0.017120361328125,
0.007904052734375,
-0.018951416015625,
-0.01495361328125,
-0.01090240478515625,
-0.0341796875,
-0.0084228515625,
-0.0828857421875,
-0.031402587890625,
0.0151214599609375,
0.000652313232421875,
-0.034820556640625,
0.008392333984375,
0.0251617431640625,
0.011810302734375,
0.027435302734375,
-0.01125335693359375,
-0.037933349609375,
0.04351806640625,
-0.040283203125,
-0.005237579345703125,
0.020172119140625,
-0.0007886886596679688,
0.01207733154296875,
0.02606201171875,
0.033782958984375,
-0.0057525634765625,
-0.0184478759765625,
0.01258087158203125,
0.01076507568359375,
-0.033050537109375,
-0.0216064453125,
-0.0069580078125,
-0.0020351409912109375,
-0.01702880859375,
-0.0147857666015625,
0.01192474365234375,
0.031951904296875,
0.0272216796875,
-0.037139892578125,
0.00182342529296875,
-0.0037479400634765625,
-0.02850341796875,
-0.045684814453125,
-0.03778076171875,
-0.00841522216796875,
-0.052032470703125,
0.01146697998046875,
0.08355712890625,
0.07647705078125,
0.039886474609375,
-0.01453399658203125,
0.042236328125,
-0.0186004638671875,
-0.00980377197265625,
0.02056884765625,
0.006923675537109375,
-0.038665771484375,
-0.0131378173828125,
-0.003696441650390625,
0.00884246826171875,
0.0246124267578125,
0.008697509765625,
0.014862060546875,
0.0019311904907226562,
-0.0293121337890625,
0.02490234375,
-0.051544189453125,
0.039154052734375,
0.00357818603515625,
-0.054718017578125,
-0.02984619140625,
-0.0163116455078125,
-0.0249481201171875,
0.001201629638671875,
-0.033050537109375,
-0.006420135498046875,
-0.0008816719055175781,
0.00318145751953125,
-0.0178985595703125,
-0.007106781005859375,
-0.00838470458984375,
-0.004665374755859375,
0.002208709716796875,
0.0264739990234375,
0.057891845703125,
0.0214996337890625,
-0.03375244140625,
0.01522064208984375,
0.008453369140625,
-0.0220184326171875,
0.006038665771484375,
0.0191802978515625,
0.0634765625,
0.00034236907958984375,
0.0030574798583984375,
0.0003249645233154297,
-0.0592041015625,
0.0980224609375,
-0.04132080078125,
-0.0638427734375,
0.05126953125,
-0.0108795166015625,
0.05364990234375,
0.0035495758056640625,
-0.004932403564453125,
0.038238525390625,
0.0290679931640625,
-0.054595947265625,
-0.005645751953125,
0.01464080810546875,
0.0161285400390625,
0.0030689239501953125,
-0.0023250579833984375,
0.01352691650390625,
-0.019256591796875,
-0.0152130126953125,
-0.0108489990234375,
0.0086517333984375,
0.006046295166015625,
0.005306243896484375,
-0.0014753341674804688,
-0.01154327392578125,
0.02716064453125,
-0.0312347412109375,
-0.017730712890625,
0.02337646484375,
-0.051727294921875,
0.00742340087890625,
-0.0008563995361328125,
-0.007617950439453125,
0.0002880096435546875,
0.0205230712890625,
0.0352783203125,
0.006290435791015625,
-0.045867919921875,
0.036590576171875,
-0.0265045166015625,
0.014312744140625,
0.03564453125,
0.03057861328125,
-0.0007472038269042969,
-0.02740478515625,
-0.0227203369140625,
-0.006969451904296875,
0.0081787109375,
-0.036834716796875,
0.0484619140625,
0.00392913818359375,
-0.0029544830322265625,
-0.016265869140625,
-0.01372528076171875,
0.01538848876953125,
-0.0860595703125,
0.0159454345703125,
0.04730224609375,
0.017547607421875,
0.0268402099609375,
0.024505615234375,
0.0689697265625,
0.02447509765625,
-0.046844482421875,
-0.0033721923828125,
0.02508544921875,
-0.0234375,
-0.0195159912109375,
0.01116180419921875,
-0.0190277099609375,
0.034423828125,
-0.0245819091796875,
0.013336181640625,
0.01293182373046875,
-0.034881591796875,
-0.01508331298828125,
-0.005573272705078125,
-0.0232086181640625,
0.013153076171875,
-0.037017822265625,
-0.01105499267578125,
-0.0159759521484375,
0.055694580078125,
0.0015478134155273438,
0.05462646484375,
0.039642333984375,
0.007572174072265625,
-0.005859375,
-0.01343536376953125,
-0.0479736328125,
-0.005870819091796875,
-0.005413055419921875,
0.013916015625,
0.017974853515625,
-0.060546875,
0.0135650634765625,
0.05621337890625,
0.01267242431640625,
0.00019311904907226562,
0.0182647705078125,
-0.0362548828125,
-0.003360748291015625,
0.01702880859375,
-0.05560302734375,
-0.0288848876953125,
-0.0163726806640625,
-0.0157623291015625,
-0.047119140625,
0.0096893310546875,
-0.006866455078125,
-0.0203094482421875,
0.01812744140625,
0.006877899169921875,
-0.05230712890625,
0.0419921875,
-0.02880859375,
0.03656005859375,
-0.0306854248046875,
0.0189971923828125,
0.04937744140625,
-0.030517578125,
0.0249176025390625,
-0.00775146484375,
-0.00438690185546875,
-0.053680419921875,
0.050262451171875,
0.0253448486328125,
-0.038787841796875,
0.009368896484375,
0.054412841796875,
0.00870513916015625,
-0.0258636474609375,
0.0179290771484375,
-0.005657196044921875,
-0.0030040740966796875,
-0.0033588409423828125,
-0.03173828125,
-0.0142059326171875,
0.060394287109375,
-0.03790283203125,
-0.00464630126953125,
0.001338958740234375,
-0.0323486328125,
-0.0295257568359375,
0.049224853515625,
-0.00797271728515625,
-0.03179931640625,
-0.0261383056640625,
-0.005702972412109375,
-0.0595703125,
-0.042572021484375,
-0.050506591796875,
0.007099151611328125,
-0.00540924072265625,
0.003955841064453125,
0.05059814453125,
-0.005573272705078125,
-0.048614501953125,
0.01381683349609375,
-0.033905029296875,
0.0003483295440673828,
0.020111083984375,
0.06427001953125,
-0.039398193359375,
0.007015228271484375,
0.010406494140625,
-0.0018873214721679688,
0.04376220703125,
-0.03564453125,
-0.01509857177734375,
-0.0272369384765625,
0.01032257080078125,
-0.007190704345703125,
-0.00652313232421875,
0.03839111328125,
0.049713134765625,
0.0230560302734375,
-0.006855010986328125,
-0.003963470458984375,
0.03851318359375,
0.005329132080078125,
-0.0584716796875,
-0.044677734375,
-0.024444580078125,
-0.023406982421875,
0.029266357421875,
-0.0137939453125,
0.003452301025390625,
0.0697021484375,
-0.0015697479248046875,
-0.050567626953125,
-0.034423828125,
-0.060089111328125,
-0.0357666015625,
-0.01806640625,
-0.0255584716796875,
0.04449462890625,
-0.01340484619140625,
0.0181427001953125,
-0.012176513671875,
0.022796630859375,
-0.032012939453125,
-0.0753173828125,
0.038818359375,
-0.0552978515625,
0.01505279541015625,
-0.04962158203125,
-0.0177154541015625,
0.024322509765625,
0.124755859375,
-0.058807373046875,
-0.025970458984375,
-0.00399017333984375,
0.016021728515625,
0.01800537109375,
-0.0290985107421875,
0.0085601806640625,
-0.0421142578125,
-0.085693359375,
0.0017404556274414062,
0.0247650146484375,
-0.05169677734375,
-0.01413726806640625,
0.0211029052734375,
-0.061187744140625,
-0.0255584716796875,
0.03814697265625,
-0.0673828125,
-0.010986328125,
0.0214691162109375,
-0.0111083984375,
-0.02374267578125,
-0.007198333740234375,
-0.03741455078125,
-0.09124755859375,
-0.01393890380859375,
-0.02410888671875,
0.058990478515625,
-0.012420654296875,
0.01312255859375,
-0.0254058837890625,
0.045989990234375,
0.0059356689453125,
0.00305938720703125,
0.0186767578125,
0.020111083984375,
0.0119781494140625,
-0.0224151611328125,
0.018402099609375,
-0.03704833984375,
-0.01739501953125,
-0.004058837890625,
0.0265350341796875,
0.03466796875,
-0.01131439208984375,
-0.032196044921875,
-0.00333404541015625,
-0.011566162109375,
-0.0369873046875,
-0.07861328125,
-0.0531005859375,
-0.013458251953125,
-0.026275634765625,
-0.003154754638671875,
-0.06158447265625,
-0.041717529296875,
-0.006580352783203125,
0.0040740966796875,
-0.00576019287109375,
0.035919189453125,
0.035369873046875,
0.0265350341796875,
-0.0122833251953125,
-0.049652099609375,
-0.041259765625,
0.01318359375,
-0.0216064453125,
0.01052093505859375,
-0.016204833984375,
-0.01149749755859375,
0.044403076171875,
-0.036956787109375,
0.040496826171875,
-0.08563232421875,
0.0848388671875,
-0.0141754150390625,
0.0198516845703125,
0.005039215087890625,
-0.0196380615234375,
0.0177459716796875,
0.0192108154296875,
-0.01399993896484375,
-0.0026874542236328125,
-0.0220947265625,
0.00624847412109375,
-0.006549835205078125,
0.024261474609375,
0.0011425018310546875,
-0.02520751953125,
0.0017948150634765625,
0.0087738037109375,
0.029541015625,
0.034820556640625,
-0.0016946792602539062,
0.014556884765625,
-1.7881393432617188e-7,
-0.003986358642578125,
-0.01158905029296875,
0.005115509033203125,
-0.033843994140625,
0.0173187255859375,
-0.00853729248046875,
-0.01446533203125,
-0.0203857421875,
-0.006900787353515625,
0.03271484375,
-0.01038360595703125,
-0.045379638671875,
-0.0190582275390625,
-0.001190185546875,
0.03564453125,
0.0234832763671875,
0.01380157470703125,
0.053802490234375,
0.033935546875,
-0.020111083984375,
-0.0254058837890625,
-0.02569580078125,
0.024658203125,
-0.0589599609375,
-0.01398468017578125,
0.0204620361328125,
-0.0228271484375,
-0.0224609375,
0.05438232421875,
0.005580902099609375,
0.00421905517578125,
-0.0062255859375,
0.0268096923828125,
0.01262664794921875,
0.03924560546875,
0.01393890380859375,
-0.01107025146484375,
-0.007122039794921875,
0.020172119140625,
-0.03082275390625,
0.00655364990234375,
-0.00992584228515625,
0.0116729736328125,
0.00954437255859375,
-0.01047515869140625,
-0.00565338134765625,
0.0006289482116699219,
-0.0269927978515625,
-0.0099945068359375,
-0.0139007568359375,
-0.027435302734375,
-0.04345703125,
-0.01474761962890625,
0.01092529296875,
-0.00110626220703125,
-0.003265380859375,
-0.003429412841796875,
0.021728515625,
0.007598876953125,
0.034942626953125,
-0.00994110107421875,
0.0110015869140625,
-0.002986907958984375,
-0.00621795654296875,
-0.0498046875,
-0.01221466064453125,
-0.013916015625,
-0.0270538330078125,
-0.03167724609375,
0.01325225830078125,
-0.0179901123046875,
-0.01296234130859375,
0.0038738250732421875,
0.0364990234375,
-0.0158233642578125,
-0.01812744140625,
-0.010406494140625,
0.003570556640625,
0.02972412109375,
-0.01187896728515625,
0.01316070556640625,
-0.0253753662109375,
-0.03314208984375,
-0.029571533203125,
-0.0138092041015625,
-0.0208892822265625,
-0.00875091552734375,
0.004314422607421875,
0.02032470703125,
0.04974365234375,
-0.0238037109375,
-0.039031982421875,
-0.0074005126953125,
-0.0049591064453125,
0.014190673828125,
0.07806396484375,
-0.00646209716796875,
0.02618408203125,
-0.03485107421875,
0.064453125,
-0.00846099853515625,
-0.0038623809814453125,
0.006877899169921875,
-0.035980224609375,
0.0184173583984375,
-0.07037353515625,
-0.05682373046875,
-0.034454345703125,
-0.0328369140625,
0.09149169921875,
0.062408447265625,
-0.0008411407470703125,
0.038421630859375,
-0.017303466796875,
-0.00014150142669677734,
-0.00664520263671875,
-0.01444244384765625,
-0.01560211181640625,
0.0157012939453125,
0.033203125,
-0.033599853515625,
-0.0189666748046875,
0.01070404052734375,
0.02191162109375,
0.004673004150390625,
-0.016448974609375,
0.0172271728515625,
0.0142974853515625,
-0.1099853515625,
0.08331298828125,
0.0689697265625,
0.030975341796875,
0.053253173828125,
-0.02801513671875,
0.0183563232421875,
0.0163726806640625,
0.0063934326171875,
-0.0423583984375,
0.00274658203125,
0.06500244140625,
0.0167083740234375,
-0.040283203125,
0.0665283203125,
-0.0295867919921875,
0.035430908203125,
0.0235595703125,
0.0657958984375,
-0.0799560546875,
0.040802001953125,
0.023040771484375,
0.0039825439453125,
0.0377197265625,
-0.0125579833984375,
-0.0096282958984375,
-0.052276611328125,
0.020172119140625,
-0.0111541748046875,
-0.0255279541015625,
-0.015625,
-0.0036602020263671875,
-0.0185546875,
-0.0276336669921875,
-0.0214385986328125,
0.0035381317138671875,
0.01035308837890625,
0.0201263427734375,
-0.0089569091796875,
-0.00127410888671875,
-0.0005750656127929688,
0.0243682861328125,
-0.00566864013671875,
-0.0223388671875,
-0.051300048828125,
-0.006687164306640625,
-0.027069091796875,
-0.032806396484375,
0.030181884765625,
-0.005603790283203125,
0.049072265625,
0.03363037109375,
-0.0090484619140625,
-0.002597808837890625,
-0.018463134765625,
0.0145263671875,
-0.00930023193359375,
-0.02392578125,
0.01108551025390625,
-0.04571533203125,
-0.000324249267578125,
0.0073699951171875,
-0.02044677734375,
-0.0643310546875,
-0.005435943603515625,
0.0196533203125,
0.07635498046875,
-0.005756378173828125,
-0.03277587890625,
0.04388427734375,
0.009796142578125,
-0.036865234375,
0.0180816650390625,
-0.01348876953125,
-0.04498291015625,
-0.0419921875,
-0.0031871795654296875,
-0.0665283203125,
0.02197265625,
0.0179595947265625,
-0.04083251953125,
0.0994873046875,
0.026458740234375,
-0.0305023193359375,
-0.0105133056640625,
0.06756591796875,
-0.0533447265625,
0.0343017578125,
-0.01125335693359375,
0.01763916015625,
0.01021575927734375,
0.0189361572265625,
-0.043487548828125,
-0.03662109375,
-0.00872039794921875,
0.0706787109375,
0.0499267578125,
0.01361846923828125,
0.0120697021484375,
-0.02252197265625,
0.0110931396484375,
0.05255126953125,
-0.0106658935546875,
-0.00701141357421875,
0.0086822509765625,
0.052276611328125,
0.036773681640625,
-0.04632568359375,
0.0189056396484375,
0.00975799560546875,
-0.0165863037109375,
0.0257568359375,
0.023468017578125,
0.0160675048828125,
-0.002834320068359375,
0.030548095703125,
0.01258087158203125,
-0.0102386474609375,
-0.001934051513671875,
-0.037322998046875,
-0.00585174560546875,
0.00441741943359375,
-0.01010894775390625,
0.00734710693359375,
-0.0032405853271484375,
-0.010955810546875,
0.02362060546875,
-0.0020618438720703125,
0.07269287109375,
-0.0128021240234375,
0.012237548828125,
0.053497314453125,
-0.0173797607421875,
0.027984619140625,
0.03228759765625,
-0.04583740234375,
0.0189208984375,
-0.04290771484375,
-0.00897216796875,
-0.0582275390625,
0.052520751953125,
0.022705078125,
0.01352691650390625,
-0.043060302734375,
-0.032867431640625,
0.0032978057861328125,
-0.01143646240234375,
0.0200042724609375,
-0.011688232421875,
0.03704833984375,
-0.01971435546875,
-0.005458831787109375,
-0.043487548828125,
0.0236663818359375,
0.0175018310546875,
0.017669677734375,
-0.017059326171875,
0.037109375,
-0.0616455078125,
0.0107574462890625,
-0.028289794921875,
-0.0291290283203125,
-0.0078582763671875,
0.051239013671875,
0.050506591796875,
0.01184844970703125,
0.007965087890625,
-0.02813720703125,
-0.014007568359375,
0.0139007568359375,
0.00734710693359375,
0.01129913330078125,
-0.0068817138671875,
-0.0192413330078125,
0.02398681640625,
0.016998291015625,
0.01465606689453125,
0.03424072265625,
0.040069580078125,
0.040618896484375,
-0.01114654541015625,
-0.0031185150146484375,
0.08294677734375,
-0.0109405517578125,
-0.011749267578125,
-0.039306640625,
0.053070068359375,
0.06268310546875,
0.0208892822265625,
-0.00496673583984375,
-0.01409149169921875,
0.08636474609375,
0.003963470458984375,
0.035980224609375,
-0.00392913818359375,
-0.01322174072265625,
0.034149169921875,
0.014312744140625,
0.06707763671875,
0.028564453125,
-0.0360107421875,
-0.001735687255859375,
-0.039459228515625,
-0.051849365234375,
0.033782958984375,
0.055023193359375,
-0.02490234375,
0.019317626953125,
-0.00856781005859375,
0.00048279762268066406,
0.0062255859375,
-0.0021648406982421875,
-0.00279998779296875,
0.032745361328125,
0.032440185546875,
0.00783538818359375,
-0.03350830078125,
-0.002803802490234375,
0.0231170654296875,
0.005153656005859375,
-0.0302276611328125,
0.07037353515625,
-0.0114288330078125,
-0.0236663818359375,
-0.046783447265625,
0.026580810546875,
-0.04168701171875,
-0.047607421875,
0.043731689453125,
0.03131103515625,
0.0025234222412109375,
0.0015926361083984375,
0.00653839111328125,
0.0282440185546875,
0.037689208984375,
-0.03204345703125,
0.01947021484375,
-0.0089874267578125,
0.01180267333984375,
-0.0250091552734375,
0.033111572265625,
-0.0276947021484375,
-0.048187255859375,
-0.044097900390625,
0.00012755393981933594,
0.0201263427734375,
0.054107666015625,
0.0014591217041015625,
0.00966644287109375,
0.0270538330078125,
0.037200927734375,
-0.0027484893798828125,
0.0251007080078125,
0.005573272705078125,
0.0313720703125,
-0.0283050537109375,
-0.02789306640625,
0.01849365234375,
-0.024566650390625,
0.029754638671875,
-0.0135498046875,
0.050079345703125,
0.032012939453125,
-0.043975830078125,
-0.00806427001953125,
0.050262451171875,
0.0301055908203125,
-0.0092315673828125,
0.012481689453125,
0.0260162353515625,
-0.0287933349609375,
0.008697509765625,
0.02923583984375,
-0.02056884765625,
-0.02117919921875,
-0.0003654956817626953,
0.0018243789672851562,
0.01190948486328125,
-0.00629425048828125,
-0.03289794921875,
0.0220184326171875,
-0.002716064453125,
0.009124755859375,
-0.058319091796875,
0.03741455078125,
-0.0095367431640625,
0.045928955078125,
-0.02630615234375,
-0.0231781005859375,
0.007503509521484375,
0.058135986328125,
-0.018218994140625,
0.00188446044921875,
-0.021728515625,
-0.020538330078125,
-0.0289154052734375,
0.02545166015625,
0.01529693603515625,
-0.0268096923828125,
0.01306915283203125,
0.0261993408203125,
0.037261962890625,
0.06884765625,
0.03741455078125,
-0.00240325927734375,
0.0081024169921875,
0.00801849365234375,
0.0022296905517578125,
-0.08148193359375,
0.0014200210571289062,
-0.06756591796875,
0.013671875,
-0.0225830078125,
0.031890869140625,
0.05023193359375,
-0.02105712890625,
-0.08099365234375,
0.036407470703125,
-0.0170440673828125,
-0.029388427734375,
-0.003498077392578125,
0.002971649169921875,
0.0010938644409179688,
0.004131317138671875,
-0.0033779144287109375,
-0.005710601806640625,
-0.015167236328125,
-0.005458831787109375,
0.0158843994140625,
0.0168304443359375,
0.03875732421875,
0.00478363037109375,
-0.04876708984375,
-0.0159912109375,
-0.0289154052734375,
0.01476287841796875,
0.034149169921875,
-0.01107025146484375,
0.00026869773864746094,
0.01523590087890625,
-0.089111328125,
-0.08197021484375,
-0.043304443359375,
0.048492431640625,
0.0020198822021484375,
-0.049346923828125,
-0.0191497802734375,
-0.0310211181640625,
0.04296875,
0.019561767578125,
0.01181793212890625,
-0.016632080078125,
-0.0164947509765625,
-0.0474853515625,
0.01392364501953125,
-0.03594970703125,
-0.004665374755859375,
-0.07208251953125,
-0.022674560546875,
0.0171356201171875,
-0.0119171142578125,
-0.00904083251953125,
0.016632080078125,
-0.0279998779296875,
0.0225982666015625,
0.075439453125,
0.0186767578125,
-0.0791015625,
0.039398193359375,
0.0140380859375,
-0.0296630859375,
-0.0018787384033203125,
-0.01727294921875,
-0.01385498046875,
-0.004474639892578125,
-0.004322052001953125,
-0.0077362060546875,
0.0109405517578125,
-0.033905029296875,
0.0119781494140625,
-0.0153045654296875,
0.02801513671875,
-0.0310821533203125,
-0.002536773681640625,
-0.0263519287109375,
0.014862060546875,
-0.00664520263671875,
0.01258087158203125,
-0.0223846435546875,
0.0482177734375,
0.002948760986328125,
0.06231689453125,
-0.0345458984375,
-0.0201568603515625,
-0.03594970703125,
0.00791168212890625,
0.01397705078125,
0.0112762451171875,
0.0745849609375,
-0.0178680419921875,
0.0222930908203125,
-0.03594970703125,
0.006885528564453125,
-0.01458740234375,
-0.00044918060302734375,
0.0054779052734375,
-0.042724609375,
0.0213470458984375
] |
c19e7587378460f9455183bb379cbe988ae8eb70
|
Wordpress Stackexchange
Q: Using a menu walker add a custom item at the end of the menu's items I need to add a search field at the end of a menu in a list item.
I've been looking at walkers but finding it really hard to figure out what is the last item (or even get the total). Also where would i add the code for the custom item.
I've currently got;
class mainNav_walker extends Walker_Nav_Menu
{
public function start_el( &$output, $item, $depth, $args )
{
//print_r($item);
$output .= $this->custom_content( $item );
parent::start_el( &$output, $item, $depth, $args );
}
protected function custom_content( $item )
{
// add <li>SEARCH FIELD HERE?</li>
}
}
A: You don't need a walker in this case. A filter called wp_nav_menu_items is available. It allows you to edit the list items of a menu. Just append your own list item with search field.
add_filter( 'wp_nav_menu_items', 'add_search_to_nav', 10, 2 );
function add_search_to_nav( $items, $args )
{
$items .= '<li>SEARCH</li>';
return $items;
}
Note: if you only want to target a specific menu, a dynamic filter exists:
wp_nav_menu_{$menu->slug}_items
|
Q: Using a menu walker add a custom item at the end of the menu's items I need to add a search field at the end of a menu in a list item.
I've been looking at walkers but finding it really hard to figure out what is the last item (or even get the total). Also where would i add the code for the custom item.
I've currently got;
class mainNav_walker extends Walker_Nav_Menu
{
public function start_el( &$output, $item, $depth, $args )
{
//print_r($item);
$output .= $this->custom_content( $item );
parent::start_el( &$output, $item, $depth, $args );
}
protected function custom_content( $item )
{
// add <li>SEARCH FIELD HERE?</li>
}
}
A: You don't need a walker in this case. A filter called wp_nav_menu_items is available. It allows you to edit the list items of a menu. Just append your own list item with search field.
add_filter( 'wp_nav_menu_items', 'add_search_to_nav', 10, 2 );
function add_search_to_nav( $items, $args )
{
$items .= '<li>SEARCH</li>';
return $items;
}
Note: if you only want to target a specific menu, a dynamic filter exists:
wp_nav_menu_{$menu->slug}_items
|
wordpress
|
{
"language": "en",
"length": 178,
"provenance": "stackexchange_00019.jsonl.gz:420010",
"question_score": "12",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52286"
}
|
[
0.06524658203125,
-0.01678466796875,
0.043426513671875,
-0.01050567626953125,
0.00885009765625,
-0.0174407958984375,
0.07122802734375,
-0.035919189453125,
-0.01275634765625,
0.0065155029296875,
-0.039031982421875,
-0.0073089599609375,
-0.059814453125,
-0.0142974853515625,
-0.0113677978515625,
-0.0721435546875,
0.022186279296875,
-0.0024127960205078125,
0.0223846435546875,
-0.0139312744140625,
-0.007694244384765625,
-0.006885528564453125,
0.06024169921875,
0.05029296875,
0.01116180419921875,
-0.007793426513671875,
0.0296478271484375,
-0.0193023681640625,
0.01480865478515625,
0.003437042236328125,
0.00492095947265625,
-0.0247650146484375,
0.01215362548828125,
-0.01654052734375,
0.0567626953125,
0.00997161865234375,
0.044677734375,
-0.010772705078125,
0.0234527587890625,
0.01232147216796875,
0.03466796875,
-0.01513671875,
-0.044677734375,
0.01702880859375,
-0.0286865234375,
-0.03619384765625,
0.017303466796875,
-0.0307769775390625,
0.0038776397705078125,
-0.0240325927734375,
0.0196380615234375,
0.0208740234375,
0.015960693359375,
-0.022552490234375,
0.0006208419799804688,
0.01444244384765625,
0.0293426513671875,
-0.075439453125,
0.0239715576171875,
0.051483154296875,
0.000060439109802246094,
-0.01541900634765625,
0.0103759765625,
-0.05511474609375,
-0.02130126953125,
0.0028972625732421875,
0.005992889404296875,
-0.006298065185546875,
-0.034210205078125,
-0.028411865234375,
0.036224365234375,
-0.023712158203125,
-0.0035228729248046875,
0.027252197265625,
-0.03411865234375,
-0.06829833984375,
0.0421142578125,
-0.038604736328125,
0.005130767822265625,
0.045166015625,
-0.0244140625,
-0.008880615234375,
-0.0246734619140625,
-0.0396728515625,
0.0101470947265625,
-0.0106048583984375,
-0.0224761962890625,
0.01061248779296875,
0.01251220703125,
-0.0227508544921875,
-0.007598876953125,
0.01444244384765625,
-0.002704620361328125,
-0.0179290771484375,
-0.033050537109375,
-0.033355712890625,
0.016387939453125,
0.06964111328125,
0.0218963623046875,
0.06451416015625,
-0.004947662353515625,
-0.043853759765625,
0.06732177734375,
-0.0753173828125,
0.01058197021484375,
0.039642333984375,
-0.00958251953125,
0.006343841552734375,
0.041107177734375,
0.025543212890625,
0.030975341796875,
0.041229248046875,
-0.00048613548278808594,
-0.01959228515625,
-0.030731201171875,
0.01363372802734375,
-0.01531219482421875,
-0.007373809814453125,
0.01331329345703125,
-0.005886077880859375,
-0.0222930908203125,
-0.0168609619140625,
0.0033588409423828125,
0.00222015380859375,
0.032562255859375,
0.001316070556640625,
-0.0122222900390625,
0.02264404296875,
0.02508544921875,
0.006771087646484375,
-0.016204833984375,
0.0013074874877929688,
0.019195556640625,
0.03472900390625,
0.003681182861328125,
-0.0033054351806640625,
-0.008514404296875,
-0.0187225341796875,
-0.0027675628662109375,
-0.0253753662109375,
0.0413818359375,
0.0186920166015625,
0.009857177734375,
-0.0033817291259765625,
0.031280517578125,
-0.018768310546875,
0.007335662841796875,
0.03375244140625,
0.0295562744140625,
0.002452850341796875,
0.0251007080078125,
-0.0006833076477050781,
0.050445556640625,
-0.006877899169921875,
-0.0592041015625,
-0.01538848876953125,
-0.010498046875,
-0.00864410400390625,
-0.044586181640625,
-0.04193115234375,
-0.080322265625,
-0.009613037109375,
0.049346923828125,
-0.116455078125,
-0.08642578125,
0.0106048583984375,
-0.02410888671875,
-0.004817962646484375,
0.003398895263671875,
0.0185089111328125,
-0.01323699951171875,
-0.01007843017578125,
-0.0141448974609375,
0.0208892822265625,
0.005954742431640625,
0.0232086181640625,
-0.004161834716796875,
0.053070068359375,
0.005413055419921875,
0.01485443115234375,
-0.005290985107421875,
-0.050689697265625,
0.07379150390625,
-0.031494140625,
-0.08270263671875,
0.031280517578125,
0.0095977783203125,
0.08514404296875,
0.0304718017578125,
0.009063720703125,
0.037017822265625,
-0.0181121826171875,
-0.038055419921875,
0.00791168212890625,
-0.021942138671875,
-0.0016431808471679688,
0.0024242401123046875,
0.015625,
-0.0160980224609375,
0.0154266357421875,
-0.0186767578125,
0.010284423828125,
0.00603485107421875,
0.004917144775390625,
-0.06390380859375,
0.0235443115234375,
-0.028717041015625,
0.047119140625,
-0.00916290283203125,
0.01560211181640625,
0.005222320556640625,
-0.0251312255859375,
0.004840850830078125,
-0.009765625,
-0.01389312744140625,
-0.00020563602447509766,
-0.01580810546875,
0.01715087890625,
-0.0011091232299804688,
-0.01152801513671875,
0.004611968994140625,
-0.038116455078125,
-0.0004181861877441406,
0.0201873779296875,
0.057769775390625,
-0.00876617431640625,
-0.0171966552734375,
-0.01258087158203125,
0.0271148681640625,
0.01367950439453125,
-0.06243896484375,
0.038543701171875,
0.08837890625,
0.0200958251953125,
-0.0244293212890625,
0.026947021484375,
0.037109375,
-0.07647705078125,
-0.0194549560546875,
0.0526123046875,
0.046112060546875,
0.0341796875,
0.004390716552734375,
-0.0272979736328125,
0.0595703125,
-0.026611328125,
0.0267333984375,
-0.042694091796875,
-0.01849365234375,
0.020416259765625,
0.051544189453125,
0.01158905029296875,
0.0301666259765625,
0.03668212890625,
0.01169586181640625,
0.007724761962890625,
0.0006585121154785156,
-0.0260009765625,
-0.0088043212890625,
-0.00797271728515625,
0.01451873779296875,
-0.0177459716796875,
-0.039794921875,
0.0168609619140625,
-0.01113128662109375,
0.04388427734375,
0.0299072265625,
0.0382080078125,
-0.032684326171875,
0.0119171142578125,
0.0194854736328125,
0.05535888671875,
0.003265380859375,
-0.00734710693359375,
-0.025360107421875,
0.013458251953125,
0.020599365234375,
0.00807952880859375,
-0.01438140869140625,
-0.027008056640625,
-0.01245880126953125,
0.03900146484375,
0.0394287109375,
-0.0128936767578125,
-0.0277099609375,
-0.043975830078125,
0.030059814453125,
-0.01116180419921875,
-0.0083770751953125,
-0.01678466796875,
0.00829315185546875,
0.00959014892578125,
-0.0458984375,
0.040924072265625,
-0.0271759033203125,
-0.023529052734375,
0.056640625,
0.0223388671875,
0.0121612548828125,
-0.0023860931396484375,
0.02886962890625,
0.0372314453125,
-0.030487060546875,
0.0003364086151123047,
-0.00400543212890625,
-0.005481719970703125,
-0.025848388671875,
0.0145416259765625,
-0.0202789306640625,
-0.039794921875,
-0.01332855224609375,
0.033477783203125,
0.0166473388671875,
0.0016613006591796875,
0.03338623046875,
-0.0199432373046875,
0.006526947021484375,
-0.001995086669921875,
-0.061737060546875,
-0.05926513671875,
0.041473388671875,
-0.06988525390625,
0.024017333984375,
0.030181884765625,
-0.040618896484375,
-0.033111572265625,
0.08050537109375,
0.0012083053588867188,
-0.007457733154296875,
-0.0281982421875,
-0.031768798828125,
-0.0208282470703125,
-0.058380126953125,
0.0396728515625,
0.00878143310546875,
0.01111602783203125,
0.007625579833984375,
0.08367919921875,
0.020782470703125,
-0.0357666015625,
0.040008544921875,
0.023529052734375,
-0.023193359375,
0.0269775390625,
0.01520538330078125,
-0.045501708984375,
0.0257568359375,
0.0046234130859375,
0.02325439453125,
0.02252197265625,
-0.01016998291015625,
-0.0120086669921875,
-0.040283203125,
0.04229736328125,
0.0166015625,
0.003757476806640625,
0.03143310546875,
0.0633544921875,
0.04827880859375,
0.0073394775390625,
0.003940582275390625,
-0.0299530029296875,
-0.028411865234375,
0.0391845703125,
0.021575927734375,
-0.0128173828125,
-0.0183868408203125,
0.001369476318359375,
0.001911163330078125,
-0.00457000732421875,
0.0208892822265625,
-0.0219268798828125,
0.0006117820739746094,
-0.01271820068359375,
-0.007537841796875,
-0.016815185546875,
0.053863525390625,
-0.0033664703369140625,
0.00939178466796875,
0.0297698974609375,
0.0169219970703125,
0.0212860107421875,
-0.02081298828125,
-0.030914306640625,
-0.04339599609375,
0.05010986328125,
0.037109375,
0.032745361328125,
-0.0190887451171875,
-0.0484619140625,
-0.0102691650390625,
0.08740234375,
-0.0631103515625,
-0.042022705078125,
-0.00797271728515625,
0.0178985595703125,
0.034027099609375,
-0.0129852294921875,
0.0216827392578125,
-0.0546875,
-0.08709716796875,
0.02606201171875,
-0.0002765655517578125,
-0.026031494140625,
-0.0174102783203125,
0.039520263671875,
-0.055206298828125,
-0.031951904296875,
0.036468505859375,
-0.052459716796875,
-0.0025463104248046875,
0.0259246826171875,
-0.0340576171875,
-0.0016374588012695312,
-0.025604248046875,
-0.0240936279296875,
-0.036041259765625,
-0.00615692138671875,
-0.0214691162109375,
0.039581298828125,
0.02142333984375,
-0.0028743743896484375,
-0.002735137939453125,
0.04638671875,
0.058746337890625,
0.0234222412109375,
0.01824951171875,
-0.052978515625,
0.05517578125,
0.0137176513671875,
0.0199127197265625,
-0.00313568115234375,
0.00542449951171875,
-0.0240325927734375,
-0.052337646484375,
-0.0066070556640625,
-0.018524169921875,
0.00597381591796875,
0.02777099609375,
-0.039703369140625,
-0.0640869140625,
-0.039093017578125,
-0.0157928466796875,
0.005764007568359375,
-0.035308837890625,
0.0090789794921875,
-0.0228271484375,
-0.055572509765625,
-0.0224456787109375,
-0.023162841796875,
-0.0228271484375,
0.00797271728515625,
0.041717529296875,
0.037261962890625,
-0.0080108642578125,
0.0416259765625,
0.019439697265625,
0.02142333984375,
-0.0180511474609375,
0.037689208984375,
-0.00859832763671875,
-0.015716552734375,
0.047210693359375,
-0.029144287109375,
0.00391387939453125,
-0.0189056396484375,
0.042816162109375,
0.02117919921875,
-0.016021728515625,
0.00667572021484375,
0.019927978515625,
-0.01345062255859375,
0.040679931640625,
-0.0276641845703125,
-0.0008912086486816406,
0.0282440185546875,
0.038330078125,
-0.036376953125,
0.0146942138671875,
-0.0161590576171875,
-0.009735107421875,
-0.0080413818359375,
0.003986358642578125,
0.06494140625,
0.048614501953125,
-0.020294189453125,
0.03076171875,
0.038818359375,
0.018402099609375,
-0.0246124267578125,
-0.0213165283203125,
-0.01003265380859375,
0.040252685546875,
-0.025146484375,
0.0241851806640625,
-0.015167236328125,
-0.0031299591064453125,
0.048248291015625,
0.036407470703125,
0.012451171875,
0.0024280548095703125,
0.0028972625732421875,
-0.02325439453125,
-0.0171966552734375,
0.0040740966796875,
-0.0009622573852539062,
0.0255889892578125,
0.01183319091796875,
0.032012939453125,
-0.023651123046875,
0.035369873046875,
0.0011739730834960938,
0.00438690185546875,
-0.00595855712890625,
-0.0025768280029296875,
-0.035980224609375,
0.07879638671875,
-0.006999969482421875,
0.0184783935546875,
-0.0129547119140625,
-0.01345062255859375,
-0.006053924560546875,
0.0150604248046875,
0.0137786865234375,
0.0018711090087890625,
-0.01235198974609375,
0.0077667236328125,
0.04034423828125,
0.00684356689453125,
-0.01053619384765625,
-0.0178070068359375,
-0.007152557373046875,
0.0028438568115234375,
0.017120361328125,
0.042205810546875,
0.004550933837890625,
-0.004581451416015625,
0.018218994140625,
-0.032470703125,
-0.056427001953125,
-0.02886962890625,
-0.03302001953125,
0.0016469955444335938,
-0.039215087890625,
-0.006153106689453125,
-0.00202178955078125,
-0.01479339599609375,
-0.01390838623046875,
0.0122222900390625,
-0.0241546630859375,
-0.01690673828125,
-0.01038360595703125,
-0.03594970703125,
-0.03350830078125,
0.03826904296875,
-0.08087158203125,
-0.005420684814453125,
-0.0190277099609375,
-0.006595611572265625,
0.02777099609375,
-0.0197601318359375,
0.0166168212890625,
-0.00916290283203125,
0.001873016357421875,
0.00909423828125,
0.00966644287109375,
0.032684326171875,
-0.0055694580078125,
-0.0073394775390625,
0.016082763671875,
-0.006023406982421875,
-0.00466156005859375,
0.028228759765625,
-0.0278472900390625,
-0.016326904296875,
-0.047332763671875,
-0.016632080078125,
0.0178985595703125,
-0.0009560585021972656,
0.0013065338134765625,
-0.0293731689453125,
-0.00876617431640625,
-0.01085662841796875,
-0.032257080078125,
-0.0160675048828125,
0.0142364501953125,
0.00298309326171875,
-0.0108795166015625,
0.000446319580078125,
-0.0071868896484375,
-0.0004189014434814453,
-0.0145721435546875,
0.0174560546875,
0.0111846923828125,
-0.051361083984375,
-0.015716552734375,
-0.06298828125,
0.0284423828125,
0.10394287109375,
-0.0198974609375,
0.030517578125,
-0.0273895263671875,
-0.006725311279296875,
-0.006633758544921875,
0.0175018310546875,
-0.0277557373046875,
0.0134124755859375,
0.06585693359375,
-0.004505157470703125,
-0.0024356842041015625,
-0.0006313323974609375,
0.0027923583984375,
-0.0004451274871826172,
0.001678466796875,
0.01056671142578125,
-0.0189361572265625,
-0.051300048828125,
0.07330322265625,
0.077880859375,
0.002475738525390625,
0.036865234375,
0.03582763671875,
0.007965087890625,
-0.01068878173828125,
0.0009131431579589844,
0.017730712890625,
0.01296234130859375,
0.072998046875,
-0.01305389404296875,
-0.03509521484375,
0.0288238525390625,
-0.050262451171875,
-0.0226287841796875,
0.0014553070068359375,
0.01531219482421875,
-0.0000502467155456543,
-0.01438140869140625,
-0.0151519775390625,
-0.01506805419921875,
0.0291900634765625,
0.0251007080078125,
0.007526397705078125,
0.0107421875,
-0.01226806640625,
-0.03839111328125,
-0.0165557861328125,
-0.00023686885833740234,
-0.00276947021484375,
0.0080413818359375,
0.011016845703125,
0.0167694091796875,
-0.00923919677734375,
-0.0115814208984375,
-0.05487060546875,
0.0224456787109375,
-0.01020050048828125,
-0.00995635986328125,
0.02294921875,
-0.0027446746826171875,
-0.01471710205078125,
-0.03570556640625,
0.0228118896484375,
-0.00875091552734375,
0.01226806640625,
0.080322265625,
0.0047149658203125,
0.023529052734375,
0.0203704833984375,
-0.003993988037109375,
0.035186767578125,
-0.01183319091796875,
-0.01088714599609375,
0.0093841552734375,
-0.02020263671875,
-0.0024051666259765625,
0.0106353759765625,
-0.0154571533203125,
0.00815582275390625,
0.0039520263671875,
-0.022552490234375,
-0.019866943359375,
-0.04095458984375,
0.09027099609375,
-0.06280517578125,
-0.004852294921875,
-0.00385284423828125,
0.0009603500366210938,
0.0162200927734375,
0.006122589111328125,
0.031585693359375,
-0.08056640625,
-0.05712890625,
0.017578125,
-0.04461669921875,
-0.01509857177734375,
0.00200653076171875,
-0.002216339111328125,
0.0650634765625,
-0.00649261474609375,
-0.031158447265625,
0.0105133056640625,
0.044403076171875,
-0.00689697265625,
0.040924072265625,
-0.033416748046875,
0.0423583984375,
-0.04254150390625,
0.035614013671875,
-0.0572509765625,
-0.006591796875,
0.003948211669921875,
0.0421142578125,
-0.046661376953125,
-0.00634765625,
-0.034576416015625,
0.008514404296875,
0.0170440673828125,
-0.0052337646484375,
0.002048492431640625,
0.055419921875,
0.0030727386474609375,
0.0031948089599609375,
0.03558349609375,
-0.040863037109375,
0.031890869140625,
-0.049285888671875,
0.01377105712890625,
-0.01318359375,
0.015594482421875,
0.036407470703125,
-0.0290679931640625,
0.023406982421875,
-0.00562286376953125,
-0.02386474609375,
0.00659942626953125,
-0.0215606689453125,
0.0276336669921875,
0.01152801513671875,
0.037017822265625,
-0.06768798828125,
-0.046630859375,
-0.021728515625,
0.0307769775390625,
0.002841949462890625,
0.033966064453125,
0.057403564453125,
0.0186767578125,
0.051055908203125,
-0.0006952285766601562,
0.01428985595703125,
0.008758544921875,
-0.003177642822265625,
0.0341796875,
-0.0033664703369140625,
0.01459503173828125,
-0.032073974609375,
0.0180511474609375,
0.033233642578125,
0.0531005859375,
-0.034423828125,
-0.03802490234375,
-0.003749847412109375,
0.0014858245849609375,
0.02191162109375,
0.012359619140625,
0.0472412109375,
-0.0021209716796875,
0.0146636962890625,
-0.0193939208984375,
0.0179443359375,
0.0235595703125,
0.019134521484375,
0.00463104248046875,
0.039764404296875,
-0.055694580078125,
0.0229644775390625,
-0.0204620361328125,
0.033538818359375,
0.0188751220703125,
0.0195159912109375,
-0.027252197265625,
0.057861328125,
-0.009552001953125,
0.00699615478515625,
-0.01995849609375,
0.030059814453125,
0.0055084228515625,
0.01971435546875,
-0.0077667236328125,
-0.01148223876953125,
-0.0158843994140625,
0.016510009765625,
0.0196380615234375,
0.0477294921875,
0.034759521484375,
-0.004314422607421875,
-0.004909515380859375,
0.007358551025390625,
0.041778564453125,
-0.031890869140625,
-0.0189666748046875,
-0.040252685546875,
0.03857421875,
0.05682373046875,
0.044891357421875,
0.004642486572265625,
0.0021038055419921875,
0.06390380859375,
0.0239715576171875,
-0.0042724609375,
0.006908416748046875,
-0.05426025390625,
-0.00859832763671875,
-0.012664794921875,
0.07177734375,
0.04193115234375,
-0.154541015625,
-0.0345458984375,
-0.0194091796875,
-0.0848388671875,
0.07464599609375,
0.069091796875,
-0.03143310546875,
-0.005489349365234375,
0.006374359130859375,
-0.0118408203125,
-0.0189361572265625,
0.010040283203125,
-0.0091552734375,
-0.0020961761474609375,
0.01151275634765625,
-0.0011844635009765625,
-0.0295257568359375,
0.0180206298828125,
0.01268768310546875,
-0.0174102783203125,
0.0241241455078125,
0.0016841888427734375,
0.031951904296875,
0.0134735107421875,
-0.042205810546875,
-0.004779815673828125,
-0.00920867919921875,
-0.03814697265625,
0.01441192626953125,
0.01067352294921875,
-0.00006580352783203125,
-0.003231048583984375,
-0.00797271728515625,
-0.0303955078125,
0.079833984375,
-0.06524658203125,
-0.0223388671875,
0.0184326171875,
0.0243682861328125,
-0.067626953125,
-0.0038471221923828125,
-0.02685546875,
0.00775146484375,
-0.00861358642578125,
-0.04791259765625,
0.046234130859375,
0.0093536376953125,
0.0118255615234375,
0.019256591796875,
0.03265380859375,
-0.01490020751953125,
0.03692626953125,
0.0115203857421875,
0.0450439453125,
0.03472900390625,
0.0113067626953125,
0.0233917236328125,
-0.00756072998046875,
-0.0237884521484375,
0.007762908935546875,
0.01552581787109375,
-0.036407470703125,
-0.0038394927978515625,
-0.023712158203125,
0.025970458984375,
0.01055145263671875,
0.05035400390625,
-0.01690673828125,
0.035797119140625,
-0.00946807861328125,
0.0146636962890625,
0.0027008056640625,
-0.032135009765625,
-0.046173095703125,
-0.062347412109375,
-0.0008740425109863281,
0.0189971923828125,
-0.0254974365234375,
-0.036834716796875,
-0.0635986328125,
0.0268707275390625,
0.041656494140625,
0.019622802734375,
-0.0592041015625,
0.06402587890625,
-0.045623779296875,
0.0301666259765625,
0.007373809814453125,
0.0014467239379882812,
-0.00891876220703125,
0.01056671142578125,
-0.01102447509765625,
0.01247406005859375,
-0.0242919921875,
0.0155029296875,
0.00484466552734375,
-0.0107574462890625,
0.0217437744140625,
-0.006511688232421875,
-0.03955078125,
-0.041015625,
-0.007190704345703125,
0.0030994415283203125,
0.00688934326171875,
-0.034088134765625,
-0.01471710205078125,
-0.002201080322265625,
0.004459381103515625,
0.0034656524658203125,
0.006420135498046875,
-0.0159149169921875,
-0.0219268798828125,
0.054840087890625,
-0.0391845703125,
-0.005779266357421875,
-0.04888916015625,
-0.11724853515625,
0.00038552284240722656,
0.0158538818359375,
-0.06390380859375,
-0.0233154296875,
0.00655364990234375,
-0.0101470947265625,
-0.023834228515625,
-0.00412750244140625,
-0.0247650146484375,
0.00450897216796875,
0.018402099609375,
0.006267547607421875,
0.06732177734375,
-0.0266265869140625,
0.018798828125,
-0.04107666015625,
0.0226898193359375,
-0.011077880859375,
0.002910614013671875,
0.0236663818359375,
-0.032928466796875,
0.030731201171875,
0.015625,
-0.0699462890625,
-0.043121337890625,
-0.0111236572265625,
0.0206451416015625,
-0.01325225830078125,
-0.00499725341796875,
-0.0287628173828125,
-0.0160064697265625,
0.067626953125,
0.036834716796875,
0.013946533203125,
-0.0174407958984375,
0.000039577484130859375,
-0.0138397216796875,
-0.0028667449951171875,
0.006317138671875,
0.0037078857421875,
-0.031982421875,
-0.00991058349609375,
0.00557708740234375,
-0.0177459716796875,
-0.0163421630859375,
0.01177215576171875,
-0.031402587890625,
0.00861358642578125,
0.01207733154296875,
-0.0160369873046875,
-0.018585205078125,
0.01026153564453125,
0.07220458984375,
-0.0596923828125,
-0.019744873046875,
0.00008100271224975586,
0.0035343170166015625,
0.0158233642578125,
-0.0440673828125,
-0.065185546875,
-0.00640869140625,
-0.0031375885009765625,
0.0185089111328125,
-0.0283966064453125,
0.0269775390625,
-0.020416259765625,
0.047943115234375,
-0.0313720703125,
0.023895263671875,
0.023101806640625,
0.0281219482421875,
-0.056976318359375,
0.0225677490234375,
0.0210113525390625,
0.06524658203125,
0.01476287841796875,
0.02947998046875,
0.01308441162109375,
0.03582763671875,
0.005146026611328125,
-0.033599853515625,
0.019195556640625,
-0.03857421875,
0.0011272430419921875,
-0.025390625,
-0.04046630859375,
-0.054473876953125,
0.015411376953125,
0.05987548828125,
-0.041046142578125,
0.0340576171875
] |
d889daaa55dc3ef1cb8ad7b971f9712d84691858
|
Wordpress Stackexchange
Q: Is it possible to remove username field from the registration page? If so, how? Is it possible to remove the username field from the registration page?
I want the users to enter only their email and password.
A new user should be created based on these two parameters only.
Is that possible and if so, how?
A: Step 3 in the post of Nishant Kumars post checks if isset($_POST['user_login']) which did not work for me, since the login is what we actually want to remove.
My solution is as follows (in the theme's functions.php), also as a separate function, to stay with the wordpress code style:
function copy_username_to_email (){
if(isset($_POST['user_email']) && !empty($_POST['user_email'])){
$_POST['user_login'] = $_POST['user_email'];
}
}
add_action('login_form_register', 'copy_username_to_email');
|
Q: Is it possible to remove username field from the registration page? If so, how? Is it possible to remove the username field from the registration page?
I want the users to enter only their email and password.
A new user should be created based on these two parameters only.
Is that possible and if so, how?
A: Step 3 in the post of Nishant Kumars post checks if isset($_POST['user_login']) which did not work for me, since the login is what we actually want to remove.
My solution is as follows (in the theme's functions.php), also as a separate function, to stay with the wordpress code style:
function copy_username_to_email (){
if(isset($_POST['user_email']) && !empty($_POST['user_email'])){
$_POST['user_login'] = $_POST['user_email'];
}
}
add_action('login_form_register', 'copy_username_to_email');
A: @Nishant Kumar gave the perfect and should-be-accepted answer to this question. However there is a glitch after the Wordpress 4.0 version released. From codex-
Note: Since 4.0, these properties are private, see [28511].
registration_errors filter here requires a little modification.
//Remove error for username, only show error for email only.
add_filter('registration_errors', 'remove_username_empty_error', 10, 3);
function remove_username_empty_error($wp_error, $sanitized_user_login, $user_email){
if(isset($wp_error->errors['empty_username'])){
$wp_error->remove('empty_username');
}
if(isset($wp_error->errors['username_exists'])){
$wp_error->remove('username_exists');
}
return $wp_error;
}
Note: As @mcnesium mentioned, if we completely got rid of the username field (in my case I used Theme my login plugin to override the regular registration form and there I just removed the username field) then $_POST['user_login'] will be null and condition won't match at all. We better remove that from the condition like @mcnesium suggested.
A: Iterating on @nishant-kumar's answer, here is a vanilla JS, no extra js script, 1 step, no backend edit needed, solution to make a sign up form with only the email input :
/** Hook your code to the login / Sign up page **/
add_action('login_head', function(){
/* Style to hide the user_name field group */
?>
<style>
#registerform > p:first-child{
display:none;
}
</style>
<script type="text/javascript">
/* Execute this action when the DOM is ready AND after everything in the page is loaded */
let user_email;
window.addEventListener('load',function() {
user_email = document.querySelector('[name="user_email"]');
if(user_email) { // Execute only if there is a user_email field on page
user_email.addEventListener('keyup',syncUserName);
user_email.addEventListener('change',syncUserName);
}
});
/* sync user_email's value with the hidden user_login field */
function syncUserName() {
document.querySelector('[name="user_login"]').value = user_email.value;
}
</script>
<?php
});
You just need to add this code in your functions.php file (or in your custom plugin, if you have one)
A: Absolutely YES, you can achieve this.
Rule 1: WordPress requires a username. We must provide a username.
Rule 2: Don't edit WordPress core code.
We can achieve this by hiding username field, get email and store it as username.
Step-1: Remove Username textfield
add_action('login_head', function(){
?>
<style>
#registerform > p:first-child{
display:none;
}
</style>
<script type="text/javascript" src="<?php echo site_url('/wp-includes/js/jquery/jquery.js'); ?>"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
$('#registerform > p:first-child').css('display', 'none');
});
</script>
<?php
});
Step-2: Remove Username error
//Remove error for username, only show error for email only.
add_filter('registration_errors', function($wp_error, $sanitized_user_login, $user_email){
if(isset($wp_error->errors['empty_username'])){
unset($wp_error->errors['empty_username']);
}
if(isset($wp_error->errors['username_exists'])){
unset($wp_error->errors['username_exists']);
}
return $wp_error;
}, 10, 3);
Step-3: Manipulate Background Registration Functionality.
add_action('login_form_register', function(){
if(isset($_POST['user_login']) && isset($_POST['user_email']) && !empty($_POST['user_email'])){
$_POST['user_login'] = $_POST['user_email'];
}
});
Put above code in your theme's functions.php file.
You can also download a complete plugin to achieve this.
Plugin: https://wordpress.org/plugins/smart-wp-login/
A: I think any solution to this request is going to be a 'hack' as wordpress requires that there be a username for all registered users. Even the plugin mentioned above is most likely just finding the username via the email address, and then using that username to login to the site.
If you are okay with a hack, here is a concept that could work:
1) Pre-populate the username field in your registration form with a unique number, using the current timestamp is a good idea to avoid ever getting any duplicates. You would then hide this field so that the user does not see it on the screen when filling out their form.
If you are using jQuery you could use something like:
$(document).ready(function() {
var timestamp = (new Date).getTime();
$('form input.username').val(timestamp);
$('form input.username').css('display', 'none');
});
In this example, 'form input.username' would be the jQuery selector to find the username field, you will need to check the html structure on your page to make sure the selector matches the structure.
2) Use a plugin like the one mentioned earlier (http://wordpress.org/extend/plugins/wp-email-login/) to allow users to login with their email address.
|
wordpress
|
{
"language": "en",
"length": 721,
"provenance": "stackexchange_00019.jsonl.gz:420015",
"question_score": "17",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52302"
}
|
[
0.0276947021484375,
0.01183319091796875,
-0.02685546875,
0.0248870849609375,
0.022003173828125,
-0.06024169921875,
0.0487060546875,
-0.056243896484375,
-0.04180908203125,
0.032501220703125,
0.025390625,
-0.01111602783203125,
0.00628662109375,
-0.0367431640625,
-0.00279998779296875,
-0.03265380859375,
-0.031036376953125,
0.044647216796875,
0.0087127685546875,
-0.038543701171875,
0.035430908203125,
-0.06549072265625,
0.0007448196411132812,
-0.01071929931640625,
0.000698089599609375,
-0.018524169921875,
0.066650390625,
-0.033721923828125,
0.00811004638671875,
-0.02008056640625,
0.01047515869140625,
0.00998687744140625,
-0.0151214599609375,
0.032379150390625,
-0.01348114013671875,
-0.006443023681640625,
0.004283905029296875,
0.024627685546875,
0.035003662109375,
0.0045166015625,
0.03204345703125,
-0.01727294921875,
-0.021331787109375,
-0.005870819091796875,
-0.01021575927734375,
-0.050262451171875,
0.06243896484375,
-0.0115203857421875,
0.032684326171875,
-0.016357421875,
0.0040435791015625,
0.034088134765625,
0.0164337158203125,
-0.006511688232421875,
-0.014678955078125,
0.0086212158203125,
-0.06451416015625,
0.0247039794921875,
0.0166778564453125,
0.05682373046875,
0.012847900390625,
-0.0011854171752929688,
-0.0033283233642578125,
-0.036651611328125,
-0.01172637939453125,
-0.023468017578125,
-0.036407470703125,
0.031402587890625,
-0.028045654296875,
-0.0164794921875,
0.038330078125,
-0.0186920166015625,
-0.003726959228515625,
-0.026123046875,
-0.022552490234375,
0.0163116455078125,
-0.024200439453125,
-0.020751953125,
0.0277252197265625,
-0.00482177734375,
-0.01611328125,
-0.01375579833984375,
-0.095703125,
0.0176544189453125,
0.01898193359375,
0.05694580078125,
-0.0193328857421875,
-0.0224609375,
0.01302337646484375,
-0.0312347412109375,
0.005157470703125,
0.000621795654296875,
-0.025543212890625,
0.0161590576171875,
-0.0101165771484375,
-0.0211639404296875,
0.0303497314453125,
0.01479339599609375,
0.02459716796875,
-0.00870513916015625,
0.005199432373046875,
-0.03985595703125,
-0.01297760009765625,
-0.00988006591796875,
-0.0016450881958007812,
0.07879638671875,
0.0019235610961914062,
-0.0195465087890625,
-0.017974853515625,
-0.0019350051879882812,
0.00299835205078125,
-0.06475830078125,
-0.060394287109375,
-0.042724609375,
-0.0360107421875,
0.07440185546875,
-0.0312347412109375,
-0.035247802734375,
-0.010986328125,
0.0037555694580078125,
-0.0228729248046875,
-0.00507354736328125,
0.00560760498046875,
-0.0302276611328125,
0.034515380859375,
-0.006748199462890625,
-0.03314208984375,
0.016357421875,
0.0230255126953125,
-0.0281219482421875,
-0.047332763671875,
0.0241241455078125,
0.061431884765625,
0.046356201171875,
0.035980224609375,
-0.01061248779296875,
0.01806640625,
-0.0019073486328125,
0.00067901611328125,
0.043670654296875,
0.0035762786865234375,
-0.06854248046875,
-0.01224517822265625,
0.0233001708984375,
-0.0015420913696289062,
0.01210784912109375,
0.01409912109375,
0.0218505859375,
0.01702880859375,
-0.019134521484375,
-0.0125274658203125,
-0.0206756591796875,
-0.01551055908203125,
0.0231170654296875,
0.040435791015625,
0.02972412109375,
0.034393310546875,
0.000675201416015625,
-0.01433563232421875,
0.0262908935546875,
0.07257080078125,
-0.0160675048828125,
-0.0236663818359375,
0.01187896728515625,
-0.04644775390625,
0.01654052734375,
-0.06060791015625,
-0.00844573974609375,
0.0275726318359375,
-0.04620361328125,
0.051544189453125,
0.00643157958984375,
0.0394287109375,
0.0153656005859375,
0.027313232421875,
0.0160675048828125,
0.01404571533203125,
0.03985595703125,
-0.01715087890625,
0.03546142578125,
0.00868988037109375,
-0.0426025390625,
0.0262298583984375,
-0.015838623046875,
-0.06488037109375,
0.0188751220703125,
0.015960693359375,
0.014404296875,
0.01335906982421875,
-0.00021827220916748047,
0.08843994140625,
0.032257080078125,
-0.005889892578125,
-0.035064697265625,
0.0269317626953125,
-0.031494140625,
0.0328369140625,
-0.025360107421875,
0.015289306640625,
0.0274505615234375,
0.0277099609375,
-0.01399993896484375,
0.033935546875,
-0.0302581787109375,
-0.0253448486328125,
0.00925445556640625,
-0.01119232177734375,
0.03240966796875,
-0.07769775390625,
0.004425048828125,
0.054534912109375,
-0.007381439208984375,
-0.055206298828125,
0.026397705078125,
0.02313232421875,
-0.02215576171875,
-0.0245361328125,
0.0275726318359375,
0.0164031982421875,
0.041107177734375,
0.01708984375,
-0.01922607421875,
0.0185546875,
-0.03326416015625,
0.0159454345703125,
-0.047760009765625,
-0.00606536865234375,
-0.050445556640625,
0.00847625732421875,
-0.023773193359375,
0.01058197021484375,
0.06243896484375,
-0.0318603515625,
-0.023193359375,
-0.05157470703125,
0.003997802734375,
-0.01032257080078125,
-0.00591278076171875,
0.0022602081298828125,
0.0307769775390625,
0.0239715576171875,
0.0296478271484375,
-0.0196990966796875,
0.0147552490234375,
0.036376953125,
-0.00855255126953125,
0.0185394287109375,
0.0111083984375,
0.00786590576171875,
0.04833984375,
-0.00390625,
0.023284912109375,
0.01153564453125,
-0.0290679931640625,
0.01175689697265625,
0.0175018310546875,
-0.04052734375,
-0.03192138671875,
0.01270294189453125,
-0.005016326904296875,
-0.0023250579833984375,
-0.081298828125,
-0.0154571533203125,
-0.041961669921875,
0.00799560546875,
-0.033905029296875,
-0.0151824951171875,
-0.025299072265625,
-0.02789306640625,
-0.0016040802001953125,
0.042083740234375,
-0.0284576416015625,
-0.01100921630859375,
-0.0235137939453125,
0.01258087158203125,
0.0137176513671875,
-0.0499267578125,
0.0206756591796875,
0.0163421630859375,
-0.01226043701171875,
-0.0177764892578125,
-0.0179443359375,
0.029815673828125,
0.000995635986328125,
-0.0006604194641113281,
-0.048919677734375,
0.06549072265625,
0.03619384765625,
-0.006618499755859375,
-0.0151519775390625,
0.0159759521484375,
0.01031494140625,
-0.023101806640625,
0.0191497802734375,
-0.00959014892578125,
-0.0355224609375,
-0.0304107666015625,
-0.0111541748046875,
0.0193939208984375,
-0.024444580078125,
-0.0020580291748046875,
0.06622314453125,
0.0036945343017578125,
-0.00922393798828125,
0.007778167724609375,
-0.03851318359375,
-0.021697998046875,
-0.01141357421875,
-0.00807952880859375,
0.0008592605590820312,
-0.039642333984375,
0.0740966796875,
0.0169219970703125,
0.037445068359375,
-0.00323486328125,
-0.040557861328125,
0.000004351139068603516,
0.0185394287109375,
-0.0236663818359375,
-0.0163116455078125,
-0.08404541015625,
-0.018096923828125,
-0.023529052734375,
0.039031982421875,
-0.005558013916015625,
0.032989501953125,
0.038848876953125,
0.0204315185546875,
0.043121337890625,
-0.046051025390625,
-0.055389404296875,
-0.03240966796875,
-0.053924560546875,
-0.01580810546875,
-0.007495880126953125,
-0.004146575927734375,
0.004314422607421875,
0.061767578125,
0.0030651092529296875,
-0.035888671875,
-0.0016145706176757812,
0.005462646484375,
0.004627227783203125,
0.013031005859375,
-0.010101318359375,
-0.0285186767578125,
0.0219573974609375,
0.0135650634765625,
-0.021759033203125,
-0.017974853515625,
0.039886474609375,
-0.04071044921875,
0.0184478759765625,
-0.0038852691650390625,
0.00766754150390625,
0.04449462890625,
-0.0170135498046875,
-0.0273284912109375,
-0.00324249267578125,
-0.067626953125,
-0.0238800048828125,
0.018768310546875,
-0.027191162109375,
0.033233642578125,
0.0014410018920898438,
-0.0224761962890625,
0.025634765625,
0.01337432861328125,
0.0005087852478027344,
0.00482177734375,
-0.0052490234375,
0.005207061767578125,
0.01038360595703125,
-0.007419586181640625,
0.001972198486328125,
-0.011627197265625,
0.01424407958984375,
-0.03729248046875,
0.023956298828125,
-0.0008597373962402344,
-0.01377105712890625,
0.0019006729125976562,
-0.0167083740234375,
0.01355743408203125,
-0.09283447265625,
0.06512451171875,
-0.00836944580078125,
-0.0178375244140625,
-0.0126190185546875,
-0.028594970703125,
0.020660400390625,
0.1075439453125,
0.003505706787109375,
-0.0236053466796875,
-0.0023937225341796875,
0.016448974609375,
-0.05950927734375,
-0.012176513671875,
-0.033111572265625,
-0.00417327880859375,
-0.04449462890625,
-0.005954742431640625,
-0.0238494873046875,
-0.0166778564453125,
-0.00353240966796875,
-0.04742431640625,
-0.0095672607421875,
-0.04168701171875,
0.026336669921875,
0.0231781005859375,
0.0061798095703125,
-0.011474609375,
0.0010385513305664062,
-0.00875091552734375,
-0.00484466552734375,
0.004016876220703125,
-0.020172119140625,
-0.00963592529296875,
-0.01439666748046875,
0.041046142578125,
0.01056671142578125,
0.01245880126953125,
-0.0107574462890625,
0.0209503173828125,
0.020355224609375,
-0.012115478515625,
0.01715087890625,
-0.00800323486328125,
0.00617218017578125,
-0.0185089111328125,
-0.0079803466796875,
-0.027191162109375,
0.00849151611328125,
-0.0190887451171875,
-0.02392578125,
-0.000545501708984375,
-0.046661376953125,
0.00000476837158203125,
-0.0033435821533203125,
-0.017059326171875,
-0.01506805419921875,
-0.0018558502197265625,
-0.0157012939453125,
-0.028411865234375,
-0.005725860595703125,
-0.020721435546875,
0.0161285400390625,
-0.0097808837890625,
0.05743408203125,
0.0115203857421875,
0.0008254051208496094,
-0.0048370361328125,
0.04058837890625,
0.0014896392822265625,
-0.03839111328125,
-0.016754150390625,
0.033660888671875,
0.036590576171875,
0.02490234375,
0.0205535888671875,
-0.01013946533203125,
-0.0279388427734375,
0.057342529296875,
0.0018491744995117188,
0.00540924072265625,
-0.03228759765625,
0.0233306884765625,
-0.002056121826171875,
-0.03326416015625,
0.0311431884765625,
-0.007045745849609375,
0.04052734375,
0.00691986083984375,
0.0203399658203125,
-0.0178985595703125,
0.020904541015625,
0.005710601806640625,
0.0009140968322753906,
-0.01012420654296875,
0.00678253173828125,
-0.049407958984375,
0.020751953125,
-0.04315185546875,
-0.0546875,
-0.01861572265625,
0.00830078125,
-0.029449462890625,
-0.013519287109375,
-0.0128021240234375,
-0.04400634765625,
-0.07196044921875,
0.00012981891632080078,
0.0038928985595703125,
-0.0345458984375,
0.005462646484375,
-0.005985260009765625,
-0.01605224609375,
0.06689453125,
0.015960693359375,
-0.056793212890625,
0.0272064208984375,
-0.011871337890625,
0.047576904296875,
0.0067138671875,
0.0150146484375,
0.022216796875,
0.037261962890625,
0.01090240478515625,
0.008819580078125,
0.02349853515625,
0.0237274169921875,
-0.0230712890625,
-0.00817108154296875,
-0.0009965896606445312,
-0.0281524658203125,
0.00591278076171875,
0.0231475830078125,
-0.023040771484375,
0.020721435546875,
-0.0086822509765625,
0.044769287109375,
0.054107666015625,
0.0093231201171875,
0.001842498779296875,
0.01081085205078125,
-0.007625579833984375,
-0.0201873779296875,
0.01316070556640625,
-0.017730712890625,
0.0031223297119140625,
0.032012939453125,
0.0288238525390625,
0.0158538818359375,
-0.005725860595703125,
-0.020965576171875,
-0.0216522216796875,
0.007411956787109375,
0.004909515380859375,
-0.05694580078125,
-0.07354736328125,
0.00376129150390625,
0.00048160552978515625,
-0.0206451416015625,
-0.06964111328125,
0.00666046142578125,
-0.0289764404296875,
-0.041229248046875,
-0.044921875,
0.0516357421875,
-0.035491943359375,
-0.047454833984375,
-0.03179931640625,
0.01617431640625,
-0.013641357421875,
-0.036834716796875,
-0.02349853515625,
-0.0010290145874023438,
-0.019073486328125,
0.0042877197265625,
0.032012939453125,
0.006595611572265625,
-0.003429412841796875,
-0.026763916015625,
0.0084381103515625,
-0.01427459716796875,
-0.0111236572265625,
0.057586669921875,
0.000736236572265625,
-0.0390625,
-0.00383758544921875,
-0.034759521484375,
0.005340576171875,
-0.041290283203125,
-0.0283203125,
-0.007656097412109375,
-0.0006003379821777344,
0.016632080078125,
0.01605224609375,
-0.01102447509765625,
-0.0172271728515625,
0.00437164306640625,
0.0235137939453125,
0.0133514404296875,
0.0167236328125,
-0.02740478515625,
0.037200927734375,
-0.009429931640625,
0.0200042724609375,
-0.01145172119140625,
0.022979736328125,
0.00032329559326171875,
-0.019500732421875,
0.00543975830078125,
-0.0250396728515625,
-0.017059326171875,
-0.0157012939453125,
-0.030731201171875,
-0.00830841064453125,
0.03717041015625,
-0.01232147216796875,
-0.040313720703125,
-0.004100799560546875,
0.0151824951171875,
-0.041473388671875,
0.041839599609375,
0.00908660888671875,
-0.036834716796875,
-0.035980224609375,
-0.0286865234375,
0.0273895263671875,
0.0024662017822265625,
0.0223236083984375,
-0.01044464111328125,
-0.0286407470703125,
0.0174407958984375,
0.0234375,
-0.00487518310546875,
0.01070404052734375,
0.00021946430206298828,
-0.01800537109375,
0.032257080078125,
0.017364501953125,
0.032958984375,
0.040557861328125,
0.01367950439453125,
-0.033538818359375,
-0.037841796875,
0.047607421875,
0.0250244140625,
-0.001842498779296875,
0.0419921875,
-0.0247802734375,
0.0199127197265625,
0.08306884765625,
0.07861328125,
-0.12371826171875,
0.021881103515625,
-0.004581451416015625,
0.011962890625,
0.0609130859375,
0.021026611328125,
-0.00726318359375,
-0.0005927085876464844,
-0.01399993896484375,
-0.0275726318359375,
-0.0316162109375,
-0.01428985595703125,
0.01554107666015625,
0.0035953521728515625,
-0.0073699951171875,
0.046539306640625,
0.0197601318359375,
-0.02734375,
0.0128173828125,
0.0214691162109375,
0.0222930908203125,
-0.02545166015625,
-0.004550933837890625,
0.033111572265625,
-0.017852783203125,
-0.082275390625,
-0.0092010498046875,
-0.00923919677734375,
-0.0180816650390625,
0.0205078125,
0.01080322265625,
0.044036865234375,
0.0210723876953125,
0.007480621337890625,
-0.0200347900390625,
-0.0129852294921875,
-0.0221405029296875,
-0.00975799560546875,
-0.035675048828125,
-0.01471710205078125,
-0.0201263427734375,
-0.04095458984375,
0.0130615234375,
-0.03167724609375,
-0.0303497314453125,
-0.0237274169921875,
-0.0211334228515625,
0.09185791015625,
0.01165771484375,
-0.04620361328125,
0.01446533203125,
-0.006061553955078125,
-0.015625,
-0.028076171875,
-0.00972747802734375,
-0.0299224853515625,
-0.01297760009765625,
-0.0270843505859375,
-0.0458984375,
0.0182647705078125,
-0.041290283203125,
-0.1102294921875,
0.138427734375,
0.0528564453125,
0.059661865234375,
-0.01555633544921875,
0.04425048828125,
-0.033203125,
0.022796630859375,
-0.0252532958984375,
0.06640625,
0.048004150390625,
0.0273284912109375,
0.040924072265625,
0.01953125,
0.040069580078125,
-0.0255126953125,
0.069091796875,
0.01549530029296875,
0.036590576171875,
-0.0228729248046875,
0.044891357421875,
0.047515869140625,
-0.02264404296875,
-0.0191192626953125,
0.00527191162109375,
0.033843994140625,
0.0653076171875,
-0.0546875,
0.0160980224609375,
0.007579803466796875,
0.00524139404296875,
0.0283050537109375,
-0.005352020263671875,
-0.02618408203125,
0.0053863525390625,
0.0238189697265625,
-0.05633544921875,
0.00635528564453125,
0.0244598388671875,
0.010162353515625,
0.02362060546875,
0.039276123046875,
0.02606201171875,
0.0233612060546875,
0.042755126953125,
-0.0281829833984375,
0.0543212890625,
0.0007987022399902344,
0.042633056640625,
0.02667236328125,
0.017486572265625,
0.05517578125,
0.003448486328125,
0.0238494873046875,
0.0267486572265625,
-0.007320404052734375,
0.035247802734375,
0.0169830322265625,
0.0167999267578125,
-0.0469970703125,
0.0167236328125,
0.03173828125,
0.05084228515625,
-0.0504150390625,
-0.0247344970703125,
0.013824462890625,
0.0230255126953125,
0.0281219482421875,
0.00452423095703125,
0.054962158203125,
-0.062255859375,
-0.0205230712890625,
-0.0256195068359375,
0.0228729248046875,
0.031829833984375,
-0.0036487579345703125,
-0.01116943359375,
0.00691986083984375,
-0.0229339599609375,
0.04547119140625,
-0.035614013671875,
0.00754547119140625,
0.0144195556640625,
0.00037789344787597656,
0.0079345703125,
0.03118896484375,
0.0654296875,
0.0026874542236328125,
-0.013275146484375,
-0.004032135009765625,
-0.0194549560546875,
0.01189422607421875,
-0.015625,
-0.004848480224609375,
-0.027557373046875,
0.0296478271484375,
-0.0246124267578125,
-0.0067291259765625,
0.02032470703125,
0.0252532958984375,
-0.038421630859375,
-0.03216552734375,
0.0108489990234375,
-0.033538818359375,
0.046600341796875,
-0.0229034423828125,
0.00016641616821289062,
-0.008544921875,
-0.0203704833984375,
-0.04327392578125,
0.006557464599609375,
0.03515625,
-0.0147857666015625,
0.0088653564453125,
-0.00380706787109375,
-0.034881591796875,
0.041900634765625,
-0.025390625,
0.04229736328125,
-0.008331298828125,
-0.09991455078125,
-0.02337646484375,
-0.0208892822265625,
-0.032012939453125,
0.027099609375,
0.032623291015625,
-0.03216552734375,
0.0360107421875,
0.0257110595703125,
-0.038421630859375,
0.03192138671875,
-0.005035400390625,
0.00058746337890625,
-0.0014896392822265625,
-0.00907135009765625,
-0.01320648193359375,
-0.0308380126953125,
-0.0107421875,
0.0038967132568359375,
-0.000039577484130859375,
-0.0205230712890625,
0.07928466796875,
-0.0161895751953125,
-0.004627227783203125,
-0.05078125,
0.026336669921875,
-0.035980224609375,
-0.033233642578125,
0.031494140625,
0.0284881591796875,
-0.010955810546875,
-0.004901885986328125,
-0.06829833984375,
0.05419921875,
-0.01776123046875,
0.0168914794921875,
0.06817626953125,
-0.036651611328125,
-0.01221466064453125,
-0.00377655029296875,
-0.0103759765625,
-0.0130767822265625,
-0.0233612060546875,
0.0254058837890625,
0.037445068359375,
-0.004299163818359375,
0.00669097900390625,
-0.033935546875,
0.0217437744140625,
-0.00023925304412841797,
-0.046783447265625,
0.02423095703125,
-0.052459716796875,
0.0020656585693359375,
0.016357421875,
0.039215087890625,
-0.01226043701171875,
0.0225372314453125,
-0.016845703125,
0.01169586181640625,
0.01406097412109375,
0.02490234375,
0.0261688232421875,
-0.017547607421875,
0.01181793212890625,
0.03314208984375,
0.044464111328125,
0.00614166259765625,
0.004878997802734375,
0.01010894775390625,
-0.018463134765625,
0.00899505615234375,
-0.04254150390625,
-0.0293426513671875,
-0.02191162109375,
-0.036590576171875,
0.01788330078125,
-0.04302978515625,
-0.08673095703125,
-0.09375,
0.01502227783203125,
-0.009735107421875,
-0.01151275634765625,
-0.0517578125,
0.032623291015625,
-0.0088043212890625,
0.033416748046875,
-0.057891845703125,
-0.038299560546875,
0.0200958251953125,
0.0301971435546875,
-0.020904541015625,
-0.01080322265625,
-0.0229339599609375,
0.00782012939453125,
-0.01076507568359375,
-0.00861358642578125,
0.03350830078125,
0.0261077880859375,
-0.03363037109375,
-0.0212249755859375,
-0.033660888671875,
0.01326751708984375,
-0.076904296875,
-0.03582763671875,
-0.01526641845703125,
0.0294036865234375,
0.0245513916015625,
-0.05950927734375,
-0.03076171875,
-0.006244659423828125,
0.0306854248046875,
-0.02447509765625,
0.01235198974609375,
0.0169677734375,
-0.0239715576171875,
-0.06805419921875,
0.038238525390625,
-0.018951416015625,
-0.0309906005859375,
0.0190277099609375,
0.0031528472900390625,
-0.017547607421875,
0.02508544921875,
0.0166015625,
-0.0301513671875,
0.00174713134765625,
-0.0025177001953125,
0.019683837890625,
0.014739990234375,
0.017120361328125,
0.029388427734375,
-0.037384033203125,
0.018035888671875,
-0.0017852783203125,
0.00974273681640625,
0.0157318115234375,
0.02642822265625,
0.0189056396484375,
0.0655517578125,
-0.00968170166015625,
0.060638427734375,
-0.0270538330078125,
-0.03778076171875,
-0.0205078125,
-0.0225982666015625,
-0.000797271728515625,
0.003963470458984375,
0.06298828125,
0.0615234375,
0.0091705322265625,
-0.04351806640625,
-0.08087158203125,
-0.0601806640625,
0.0164947509765625,
-0.053192138671875,
0.00545501708984375,
-0.09991455078125,
-0.01141357421875,
-0.003017425537109375,
-0.01033782958984375,
0.009063720703125,
-0.0175628662109375,
-0.033203125,
0.0021610260009765625,
0.001987457275390625,
0.00949859619140625,
-0.0306549072265625,
0.042205810546875,
0.00020587444305419922,
-0.027984619140625,
-0.045989990234375,
-0.0034542083740234375,
-0.0036258697509765625,
-0.0260467529296875,
-0.01447296142578125,
0.03179931640625,
-0.01806640625,
-0.0282135009765625,
0.0386962890625,
-0.001506805419921875,
0.05047607421875,
-0.06591796875,
-0.051544189453125,
-0.016265869140625,
0.039886474609375,
0.00954437255859375,
0.054931640625,
-0.030914306640625,
0.061553955078125,
0.0341796875,
0.0156402587890625,
-0.0086669921875,
-0.05712890625,
-0.0313720703125,
0.0233306884765625,
0.036346435546875,
-0.0226287841796875,
0.0628662109375,
-0.020904541015625,
-0.02252197265625,
0.02960205078125,
0.004024505615234375,
-0.0638427734375,
0.03814697265625,
-0.00946807861328125,
0.0504150390625,
0.02398681640625
] |
c362eac33900be8eafd0dbcc1eb23a8d7590fc93
|
Wordpress Stackexchange
Q: get attachments for all posts of particular post type I'm making a widget that shows a set of images from recent custom posts. I want to run the following query:
SELECT p.*
FROM wp_posts p
WHERE post_type='attachment'
AND post_mime_type LIKE 'image%'
AND post_parent IN (
SELECT ID
FROM wp_posts
WHERE post_type ='my_custom_post_type'
)
ORDER BY post_date DESC
LIMIT 10;
and receive an array of attachment objects. I am unclear on the canonical WordPress method for doing something like this. Where should I start?
A: It seems like a bit of a waste to run through two loops just to use some built in API functions that weren't designed for a use case like this.
I think you're better off to use your SQL combined with the wpdb class -- faster and cleaner.
Example (with modified SQL):
<?php
function wpse52315_get_attach()
{
global $wpdb;
$res = $wpdb->get_results("select p1.*
FROM {$wpdb->posts} p1, {$wpdb->posts} p2
WHERE p1.post_parent = p2.ID
AND p1.post_mime_type LIKE 'image%'
AND p2.post_type = 'your_cpt'
ORDER BY p2.post_date
LIMIT 10;"
);
return $res;
}
|
Q: get attachments for all posts of particular post type I'm making a widget that shows a set of images from recent custom posts. I want to run the following query:
SELECT p.*
FROM wp_posts p
WHERE post_type='attachment'
AND post_mime_type LIKE 'image%'
AND post_parent IN (
SELECT ID
FROM wp_posts
WHERE post_type ='my_custom_post_type'
)
ORDER BY post_date DESC
LIMIT 10;
and receive an array of attachment objects. I am unclear on the canonical WordPress method for doing something like this. Where should I start?
A: It seems like a bit of a waste to run through two loops just to use some built in API functions that weren't designed for a use case like this.
I think you're better off to use your SQL combined with the wpdb class -- faster and cleaner.
Example (with modified SQL):
<?php
function wpse52315_get_attach()
{
global $wpdb;
$res = $wpdb->get_results("select p1.*
FROM {$wpdb->posts} p1, {$wpdb->posts} p2
WHERE p1.post_parent = p2.ID
AND p1.post_mime_type LIKE 'image%'
AND p2.post_type = 'your_cpt'
ORDER BY p2.post_date
LIMIT 10;"
);
return $res;
}
A: What I recommend is one instance of WP_Query for looping through all the custom post type post and then get_posts() to retrieve the attachments for each post. Here's an untested code snippet that should do what you want:
// Setup array for storing objects
$my_attachment_objects = array();
// Arguments for custom WP_Query loop
$my_cpts_args = array(
'post_type' => 'my_custom_post_type',
'posts_per_page' => 10
);
// Make the new instance of the WP_Query class
$my_cpts = new WP_Query( $my_cpts_args );
// And Loop!
if( $my_cpts->have_posts() ) : while( $my_cpts->have_posts() ) : $my_cpts->the_post();
// arguments for get_posts
$attachment_args = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'post_status' => null, // attachments don't have statuses
'post_parent' => $post->ID
);
// get the posts
$this_posts_attachments = get_posts( $attachment_args );
// append those posts onto the array
$my_attachment_objects[$post->ID] = $this_posts_attachments; // make an array with the post_id as the key, just in case that's useful
endwhile; endif; wp_reset_postdata();
Hope this helps.
A: Maybe something like this:
<?php
$args = array( 'post_type' => 'portfolio', 'posts_per_page' => 10 );
$loop = new WP_Query( array ( 'orderby' => 'title', 'order' => 'DESC' ) );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
echo '<div class="entry-content">'; the_content();
echo '</div>';
endwhile;
?>
A: If all you're interested in is the number of attachments for a particular post type, you can modify Chris' function slightly to the following:
<?php
function myprefix_image_count() {
global $wpdb;
$res = $wpdb->get_var("select COUNT(*)
FROM {$wpdb->posts} p1, {$wpdb->posts} p2
WHERE p1.post_parent = p2.ID
AND p1.post_mime_type LIKE 'image%'
AND p2.post_type = 'your_cpt_name'
ORDER BY p2.post_date;"
);
$imageCount = (int)$res;
return $imageCount;
}
?>
|
wordpress
|
{
"language": "en",
"length": 437,
"provenance": "stackexchange_00019.jsonl.gz:420017",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52315"
}
|
[
0.03521728515625,
-0.0009012222290039062,
-0.0007123947143554688,
-0.0195770263671875,
0.0188140869140625,
-0.0209808349609375,
0.0504150390625,
-0.0180816650390625,
0.020111083984375,
0.0256805419921875,
-0.01015472412109375,
-0.019012451171875,
-0.0330810546875,
-0.024749755859375,
-0.04888916015625,
-0.02947998046875,
0.05535888671875,
-0.024566650390625,
0.057586669921875,
0.004169464111328125,
-0.0079803466796875,
0.038726806640625,
0.05938720703125,
0.0092620849609375,
0.003505706787109375,
0.016082763671875,
0.08013916015625,
-0.0259246826171875,
0.0227813720703125,
-0.0023097991943359375,
0.0210723876953125,
-0.02392578125,
0.0114593505859375,
0.003810882568359375,
0.0243072509765625,
0.0124053955078125,
0.0305938720703125,
-0.0012912750244140625,
-0.01029205322265625,
0.0501708984375,
0.002407073974609375,
0.00946044921875,
-0.0028209686279296875,
-0.0284881591796875,
-0.0362548828125,
-0.0030422210693359375,
0.0086822509765625,
0.006160736083984375,
0.0193328857421875,
-0.0158233642578125,
0.0152435302734375,
-0.0023250579833984375,
0.0312347412109375,
-0.03192138671875,
-0.0235443115234375,
-0.0102691650390625,
-0.010223388671875,
-0.005336761474609375,
0.0104522705078125,
-0.040863037109375,
-0.027984619140625,
0.0008516311645507812,
0.03277587890625,
0.0372314453125,
-0.004024505615234375,
0.00312042236328125,
0.04241943359375,
-0.0004127025604248047,
0.005664825439453125,
-0.0161285400390625,
0.0114288330078125,
0.02069091796875,
-0.006687164306640625,
-0.031402587890625,
0.0099029541015625,
-0.00821685791015625,
-0.01065826416015625,
-0.03656005859375,
0.013214111328125,
0.01216888427734375,
0.01025390625,
-0.0162506103515625,
-0.0697021484375,
0.022552490234375,
0.0013742446899414062,
0.047149658203125,
-0.01517486572265625,
-0.029327392578125,
-0.01104736328125,
-0.030181884765625,
-0.0162353515625,
-0.039825439453125,
-0.01861572265625,
0.00803375244140625,
-0.0037784576416015625,
-0.03515625,
0.036651611328125,
0.0248870849609375,
0.00036263465881347656,
0.00006979703903198242,
-0.0133514404296875,
-0.04559326171875,
0.01152801513671875,
-0.0135040283203125,
0.025787353515625,
-0.0168914794921875,
-0.009368896484375,
-0.0255279541015625,
0.05889892578125,
0.039093017578125,
-0.01190948486328125,
0.07879638671875,
-0.0016241073608398438,
0.0010633468627929688,
-0.0164337158203125,
0.0164337158203125,
-0.00911712646484375,
-0.004871368408203125,
-0.0182342529296875,
-0.01099395751953125,
-0.01346588134765625,
-0.00786590576171875,
0.050140380859375,
-0.038726806640625,
-0.0045318603515625,
-0.020233154296875,
-0.04656982421875,
-0.030670166015625,
0.0082550048828125,
0.020233154296875,
-0.0162506103515625,
-0.002841949462890625,
0.0005459785461425781,
0.0255279541015625,
0.01119232177734375,
-0.00411224365234375,
-0.00647735595703125,
0.01904296875,
0.0105438232421875,
-0.0005350112915039062,
0.0367431640625,
-0.03802490234375,
-0.01983642578125,
0.048004150390625,
-0.004734039306640625,
0.005382537841796875,
0.00861358642578125,
0.01305389404296875,
0.0013475418090820312,
-0.0211181640625,
-0.0023593902587890625,
-0.03009033203125,
0.054779052734375,
-0.011077880859375,
-0.06427001953125,
-0.0181427001953125,
-0.007587432861328125,
-0.027130126953125,
-0.0288543701171875,
-0.05657958984375,
0.0313720703125,
-0.006561279296875,
-0.0035648345947265625,
-0.00015819072723388672,
-0.040985107421875,
0.018890380859375,
-0.0278778076171875,
-0.015655517578125,
0.024139404296875,
0.04779052734375,
0.001544952392578125,
-0.04937744140625,
0.034210205078125,
0.033294677734375,
-0.02337646484375,
0.037689208984375,
-0.0268096923828125,
-0.0100860595703125,
0.03472900390625,
0.0156097412109375,
-0.015869140625,
-0.0298919677734375,
0.0438232421875,
-0.00556182861328125,
-0.046844482421875,
0.02508544921875,
0.022003173828125,
0.028228759765625,
0.0017900466918945312,
0.0227203369140625,
0.03350830078125,
0.048370361328125,
-0.039306640625,
0.0231475830078125,
-0.0170440673828125,
-0.017730712890625,
-0.033782958984375,
-0.0028228759765625,
-0.02593994140625,
0.0266876220703125,
-0.0281219482421875,
0.0067901611328125,
0.00330352783203125,
0.017791748046875,
-0.027923583984375,
0.02008056640625,
-0.0261077880859375,
0.037750244140625,
-0.030487060546875,
0.035675048828125,
0.023345947265625,
0.020660400390625,
-0.04058837890625,
-0.01849365234375,
0.024383544921875,
0.034576416015625,
0.03192138671875,
0.059478759765625,
-0.01154327392578125,
0.052459716796875,
-0.048919677734375,
-0.0467529296875,
-0.036865234375,
0.0340576171875,
0.05023193359375,
0.042388916015625,
-0.0192718505859375,
0.0249481201171875,
0.06982421875,
0.055816650390625,
-0.0303802490234375,
-0.041015625,
-0.0029582977294921875,
0.0013799667358398438,
-0.0244140625,
-0.005725860595703125,
-0.005809783935546875,
-0.055084228515625,
0.00984954833984375,
0.049072265625,
0.040313720703125,
0.026885986328125,
-0.01110076904296875,
-0.016876220703125,
0.0941162109375,
-0.0095062255859375,
0.001712799072265625,
-0.005767822265625,
0.00930023193359375,
0.03875732421875,
-0.007282257080078125,
0.01392364501953125,
0.01229095458984375,
-0.025634765625,
0.05401611328125,
0.0220794677734375,
0.02294921875,
0.037933349609375,
-0.0165863037109375,
0.030487060546875,
-0.01708984375,
0.039947509765625,
0.0124359130859375,
0.0173797607421875,
0.026031494140625,
0.0167236328125,
0.04632568359375,
0.0285186767578125,
-0.0244140625,
0.006870269775390625,
0.005840301513671875,
0.016693115234375,
0.0094146728515625,
0.040802001953125,
0.02032470703125,
-0.003963470458984375,
-0.0143585205078125,
-0.01213836669921875,
0.0289154052734375,
0.004100799560546875,
0.00946807861328125,
0.0213623046875,
-0.036468505859375,
-0.00347137451171875,
-0.01273345947265625,
-0.051666259765625,
0.0023441314697265625,
0.046173095703125,
-0.034515380859375,
0.00438690185546875,
0.0237579345703125,
0.0509033203125,
0.0225067138671875,
-0.0162811279296875,
0.009979248046875,
0.0190887451171875,
0.027130126953125,
-0.048492431640625,
0.0537109375,
-0.042388916015625,
0.02459716796875,
0.05987548828125,
-0.0167083740234375,
0.013458251953125,
-0.0179595947265625,
-0.0126800537109375,
-0.02044677734375,
0.028045654296875,
-0.004695892333984375,
-0.05902099609375,
-0.015655517578125,
0.024169921875,
0.0158233642578125,
0.07330322265625,
-0.02801513671875,
-0.045928955078125,
-0.001495361328125,
0.0202484130859375,
-0.06488037109375,
-0.061859130859375,
-0.01287078857421875,
-0.0718994140625,
-0.014892578125,
-0.028411865234375,
-0.03643798828125,
0.0214691162109375,
-0.023773193359375,
0.003993988037109375,
-0.006961822509765625,
-0.005062103271484375,
-0.07244873046875,
-0.05450439453125,
-0.06829833984375,
-0.03424072265625,
-0.0173797607421875,
0.0238037109375,
-0.003170013427734375,
0.042938232421875,
0.006053924560546875,
-0.0601806640625,
0.0035724639892578125,
0.038116455078125,
-0.0015096664428710938,
0.0215606689453125,
-0.0330810546875,
0.000484466552734375,
0.03466796875,
-0.0113677978515625,
0.010498046875,
0.0134429931640625,
-0.0008883476257324219,
-0.009307861328125,
0.00875091552734375,
0.0159759521484375,
0.045806884765625,
-0.0010986328125,
-0.03411865234375,
0.037445068359375,
0.035125732421875,
-0.0263824462890625,
-0.00655364990234375,
-0.0311279296875,
-0.0308074951171875,
0.01776123046875,
-0.0012407302856445312,
0.0209808349609375,
-0.01459503173828125,
0.01995849609375,
0.02850341796875,
0.01486968994140625,
0.0008502006530761719,
-0.033721923828125,
0.07196044921875,
0.0243072509765625,
0.057373046875,
-0.026214599609375,
0.01418304443359375,
-0.0139007568359375,
0.0228118896484375,
0.01751708984375,
0.0126190185546875,
0.0005431175231933594,
0.01153564453125,
-0.0175018310546875,
-0.08294677734375,
0.0703125,
0.0032215118408203125,
0.0017147064208984375,
-0.03485107421875,
-0.04486083984375,
0.0097503662109375,
0.1104736328125,
-0.0259246826171875,
-0.0153045654296875,
-0.036346435546875,
0.01052093505859375,
-0.0182342529296875,
-0.07958984375,
0.005947113037109375,
0.00020956993103027344,
-0.050537109375,
-0.00804901123046875,
-0.01422119140625,
-0.025726318359375,
-0.0128936767578125,
-0.0087432861328125,
-0.043304443359375,
-0.034027099609375,
0.0306243896484375,
-0.0031452178955078125,
-0.00826263427734375,
0.025634765625,
-0.03369140625,
0.0193023681640625,
-0.042327880859375,
-0.001644134521484375,
-0.11810302734375,
-0.0222930908203125,
0.0281219482421875,
0.06396484375,
-0.0235443115234375,
-0.008819580078125,
-0.0221099853515625,
0.060211181640625,
0.018218994140625,
0.0007295608520507812,
-0.0124664306640625,
-0.0026721954345703125,
-0.05078125,
-0.0265960693359375,
-0.0129241943359375,
-0.03839111328125,
-0.0263671875,
-0.07470703125,
-0.040252685546875,
-0.07275390625,
-0.0217437744140625,
0.0115814208984375,
-0.01244354248046875,
0.009185791015625,
-0.007472991943359375,
0.00594329833984375,
-0.02801513671875,
0.06866455078125,
-0.0204315185546875,
-0.01239013671875,
-0.0345458984375,
-0.071533203125,
0.021514892578125,
0.02972412109375,
-0.0021152496337890625,
0.0008087158203125,
0.047515869140625,
0.016357421875,
-0.03118896484375,
-0.045135498046875,
-0.0305633544921875,
0.0279998779296875,
-0.024139404296875,
0.03753662109375,
0.033966064453125,
-0.02569580078125,
0.05364990234375,
0.0057830810546875,
0.03204345703125,
-0.050567626953125,
0.0469970703125,
-0.005420684814453125,
0.00970458984375,
0.01238250732421875,
0.011810302734375,
0.0203857421875,
0.0231781005859375,
-0.004352569580078125,
-0.07098388671875,
-0.00803375244140625,
0.0743408203125,
-0.01183319091796875,
0.0501708984375,
-0.033050537109375,
-0.0182037353515625,
0.005237579345703125,
-0.00786590576171875,
0.02447509765625,
0.002483367919921875,
-0.004871368408203125,
-0.015625,
0.0164031982421875,
0.0259552001953125,
0.019012451171875,
0.056396484375,
-0.0040740966796875,
0.056060791015625,
0.00325775146484375,
0.002429962158203125,
-0.024383544921875,
0.003032684326171875,
-0.02239990234375,
-0.0245513916015625,
-0.00908660888671875,
-0.038482666015625,
-0.01751708984375,
0.0297393798828125,
0.02215576171875,
-0.013916015625,
0.0295257568359375,
0.017913818359375,
-0.03228759765625,
-0.0248260498046875,
-0.044464111328125,
0.005527496337890625,
-0.06304931640625,
0.03338623046875,
0.014495849609375,
-0.00812530517578125,
0.0259857177734375,
0.0309600830078125,
0.0098724365234375,
0.01983642578125,
-0.0170135498046875,
0.0123138427734375,
0.0029964447021484375,
0.025909423828125,
0.0100555419921875,
0.01203155517578125,
-0.0009236335754394531,
0.0128021240234375,
0.0224151611328125,
-0.04205322265625,
-0.00527191162109375,
0.00797271728515625,
0.05810546875,
-0.0396728515625,
-0.034149169921875,
0.032135009765625,
-0.033660888671875,
-0.03350830078125,
0.035064697265625,
0.07318115234375,
0.00783538818359375,
-0.0264129638671875,
-0.0218963623046875,
0.01024627685546875,
0.04156494140625,
-0.032958984375,
0.042999267578125,
-0.01953125,
0.048492431640625,
0.0127105712890625,
-0.0163421630859375,
0.026641845703125,
0.0323486328125,
-0.0170745849609375,
-0.02777099609375,
-0.049957275390625,
0.00954437255859375,
-0.00403594970703125,
0.01013946533203125,
-0.012298583984375,
-0.0014743804931640625,
-0.004161834716796875,
0.031707763671875,
-0.025390625,
-0.0231475830078125,
-0.03997802734375,
0.0027675628662109375,
0.056427001953125,
0.035308837890625,
0.02972412109375,
-0.02191162109375,
-0.04632568359375,
-0.0299835205078125,
0.0251617431640625,
-0.03277587890625,
-0.0157318115234375,
-0.0197296142578125,
-0.00632476806640625,
0.032196044921875,
-0.0092926025390625,
-0.0245208740234375,
0.0027484893798828125,
-0.0004811286926269531,
0.0031871795654296875,
0.028961181640625,
-0.004138946533203125,
0.09283447265625,
-0.0182647705078125,
0.060028076171875,
0.01499176025390625,
0.024017333984375,
-0.0531005859375,
0.00019860267639160156,
-0.006763458251953125,
-0.07818603515625,
0.00038123130798339844,
0.0163421630859375,
-0.0177459716796875,
-0.016571044921875,
-0.038909912109375,
-0.0005035400390625,
0.0313720703125,
-0.03900146484375,
-0.0228424072265625,
-0.021820068359375,
0.02679443359375,
-0.045318603515625,
0.0379638671875,
-0.004077911376953125,
-0.031829833984375,
-0.006744384765625,
0.00020503997802734375,
0.010284423828125,
0.00666046142578125,
-0.0224456787109375,
0.0018405914306640625,
0.021728515625,
0.00235748291015625,
0.006763458251953125,
0.0472412109375,
0.0218048095703125,
0.0465087890625,
-0.00562286376953125,
0.028106689453125,
0.01282501220703125,
0.03204345703125,
-0.02703857421875,
-0.01971435546875,
0.07403564453125,
0.01436614990234375,
-0.0521240234375,
0.034088134765625,
-0.0380859375,
0.0016946792602539062,
-0.039215087890625,
0.027587890625,
0.0323486328125,
0.006496429443359375,
0.01032257080078125,
-0.0231475830078125,
0.002960205078125,
-0.002368927001953125,
-0.00571441650390625,
-0.01409912109375,
0.0127105712890625,
-0.03411865234375,
-0.0345458984375,
-0.0189971923828125,
-0.01435089111328125,
0.0214996337890625,
-0.004398345947265625,
0.0325927734375,
-0.00927734375,
-0.0164947509765625,
-0.04498291015625,
0.00911712646484375,
-0.01300811767578125,
0.0015401840209960938,
0.007640838623046875,
-0.03485107421875,
-0.0156097412109375,
-0.0635986328125,
-0.0269317626953125,
-0.03985595703125,
-0.01323699951171875,
-0.01458740234375,
-0.0031108856201171875,
0.04150390625,
0.059906005859375,
-0.002758026123046875,
0.0010881423950195312,
0.0361328125,
-0.04473876953125,
-0.055450439453125,
-0.01088714599609375,
-0.0196380615234375,
0.054534912109375,
-0.0102996826171875,
0.0225830078125,
-0.0290679931640625,
0.0165557861328125,
0.00452423095703125,
-0.035614013671875,
0.01538848876953125,
-0.07928466796875,
0.0360107421875,
0.05572509765625,
0.04705810546875,
-0.019317626953125,
0.0081939697265625,
-0.01473236083984375,
-0.0278778076171875,
-0.024658203125,
-0.00376129150390625,
-0.053955078125,
-0.005649566650390625,
-0.0015478134155273438,
-0.048980712890625,
0.06243896484375,
-0.0220489501953125,
0.029510498046875,
0.031951904296875,
0.0105438232421875,
-0.00954437255859375,
-0.0050811767578125,
-0.02264404296875,
0.07025146484375,
-0.01116180419921875,
0.026458740234375,
-0.0443115234375,
-0.0032939910888671875,
0.01453399658203125,
0.0340576171875,
0.06298828125,
0.00865936279296875,
-0.07147216796875,
-0.0193328857421875,
0.050323486328125,
0.05755615234375,
0.027679443359375,
0.055023193359375,
0.01442718505859375,
0.03497314453125,
0.058441162109375,
-0.01141357421875,
0.038909912109375,
-0.005252838134765625,
-0.00872802734375,
0.037078857421875,
0.00679779052734375,
0.0117034912109375,
-0.0011987686157226562,
0.0125579833984375,
-0.01328277587890625,
-0.010955810546875,
0.0304412841796875,
-0.037841796875,
0.0114898681640625,
0.03125,
0.0655517578125,
-0.08990478515625,
-0.051116943359375,
-0.0208892822265625,
0.049957275390625,
0.012237548828125,
0.0146636962890625,
0.0216827392578125,
0.01456451416015625,
0.0048675537109375,
-0.0032176971435546875,
0.006259918212890625,
0.015869140625,
-0.021697998046875,
0.025848388671875,
-0.01018524169921875,
0.00807952880859375,
-0.072998046875,
-0.01336669921875,
0.0667724609375,
0.04132080078125,
-0.03314208984375,
-0.0477294921875,
0.03485107421875,
0.0216064453125,
-0.0011043548583984375,
0.02880859375,
0.0071868896484375,
-0.0216217041015625,
0.0335693359375,
-0.0343017578125,
0.0077972412109375,
0.004795074462890625,
0.0277862548828125,
-0.00962066650390625,
-0.0039215087890625,
-0.0277862548828125,
-0.0179595947265625,
-0.01081085205078125,
0.00469970703125,
0.03497314453125,
0.0257110595703125,
0.00095367431640625,
0.02447509765625,
-0.0066375732421875,
0.001399993896484375,
-0.00666046142578125,
-0.02374267578125,
-0.0362548828125,
0.0167236328125,
0.004016876220703125,
-0.0203704833984375,
-0.01049041748046875,
0.022064208984375,
0.048309326171875,
-0.01519775390625,
0.02117919921875,
-0.00018894672393798828,
-0.0205230712890625,
0.00568389892578125,
-0.01486968994140625,
-0.01470184326171875,
-0.0010585784912109375,
-0.0278472900390625,
-0.0073699951171875,
0.0034656524658203125,
-0.0055084228515625,
0.01348876953125,
-0.0035648345947265625,
0.0225830078125,
-0.0009551048278808594,
0.050262451171875,
-0.0019168853759765625,
0.0191650390625,
0.075439453125,
0.0102386474609375,
0.021453857421875,
0.017791748046875,
-0.105712890625,
-0.026702880859375,
-0.04388427734375,
-0.0538330078125,
0.035125732421875,
0.0367431640625,
-0.00727081298828125,
0.0000813603401184082,
-0.0212249755859375,
-0.02197265625,
-0.0214996337890625,
0.021240234375,
-0.0017528533935546875,
-0.01157379150390625,
0.0107879638671875,
-0.016632080078125,
-0.07977294921875,
-0.037750244140625,
-0.032501220703125,
0.004673004150390625,
0.0092010498046875,
0.034912109375,
0.021881103515625,
0.0157318115234375,
0.007167816162109375,
0.049102783203125,
-0.0238037109375,
-0.00905609130859375,
0.036468505859375,
0.004596710205078125,
0.0104827880859375,
-0.0275421142578125,
0.0218505859375,
0.018035888671875,
0.0433349609375,
-0.0300140380859375,
-0.01690673828125,
-0.0026416778564453125,
0.0185546875,
-0.0199432373046875,
0.01220703125,
-0.0206756591796875,
0.01206207275390625,
-0.0235443115234375,
-0.048858642578125,
0.06341552734375,
0.01654052734375,
0.0214385986328125,
0.0212860107421875,
0.03265380859375,
0.009521484375,
0.042999267578125,
0.010162353515625,
0.084716796875,
0.043182373046875,
-0.060821533203125,
-0.029296875,
-0.023406982421875,
-0.016204833984375,
0.0014276504516601562,
-0.00963592529296875,
0.04498291015625,
-0.0008172988891601562,
-0.0025272369384765625,
-0.01386260986328125,
0.0023555755615234375,
0.0259246826171875,
-0.023101806640625,
-0.004039764404296875,
0.0250244140625,
-0.017608642578125,
-0.021484375,
-0.037139892578125,
-0.0311279296875,
-0.03717041015625,
0.013427734375,
0.03179931640625,
0.025726318359375,
0.0227203369140625,
-0.0010700225830078125,
-0.012725830078125,
0.0242767333984375,
0.0328369140625,
-0.08184814453125,
0.03857421875,
0.01065826416015625,
-0.01258087158203125,
0.00577545166015625,
-0.0230255126953125,
0.0028972625732421875,
0.0235595703125,
0.0156097412109375,
-0.059417724609375,
-0.033660888671875,
0.053955078125,
-0.03546142578125,
0.026763916015625,
0.028839111328125,
-0.0377197265625,
-0.0184478759765625,
0.037994384765625,
0.0254974365234375,
0.078369140625,
0.01220703125,
-0.01861572265625,
-0.01377105712890625,
0.034576416015625,
-0.03778076171875,
-0.03692626953125,
0.017852783203125,
-0.0248870849609375,
-0.0143890380859375,
-0.040313720703125,
0.026153564453125,
0.040008544921875,
-0.0182647705078125,
-0.0693359375,
0.1011962890625,
-0.04644775390625,
-0.007144927978515625,
-0.072021484375,
0.054962158203125,
0.01538848876953125,
0.006649017333984375,
-0.006984710693359375,
-0.038543701171875,
-0.005340576171875,
0.00585174560546875,
-0.01043701171875,
-0.0057373046875,
0.0086822509765625,
-0.0158538818359375,
-0.05706787109375,
-0.00638580322265625,
-0.0021724700927734375,
-0.0292510986328125,
0.001491546630859375,
0.00521087646484375,
0.04376220703125,
0.0557861328125,
-0.009857177734375,
0.033294677734375,
0.0008192062377929688,
-0.03448486328125,
-0.0162506103515625,
-0.01486968994140625,
-0.0328369140625,
0.01532745361328125,
0.048431396484375,
0.106689453125,
0.0147705078125,
-0.059844970703125,
0.0011529922485351562,
-0.017913818359375,
-0.061492919921875,
-0.016387939453125,
0.0287017822265625,
-0.038909912109375,
0.003078460693359375,
-0.015472412109375,
-0.002239227294921875,
-0.01511383056640625,
0.01320648193359375,
-0.016448974609375,
-0.014068603515625,
0.026123046875,
-0.0165557861328125,
-0.01593017578125,
0.055511474609375,
0.034271240234375,
-0.04119873046875,
-0.00213623046875,
-0.00258636474609375,
-0.020904541015625,
0.0103607177734375,
-0.004634857177734375,
-0.0054779052734375,
0.02935791015625,
-0.0006961822509765625,
-0.00444793701171875,
0.032684326171875,
-0.02740478515625,
0.0194244384765625,
0.0217742919921875,
-0.050537109375,
-0.0020732879638671875,
0.027740478515625,
-0.0200042724609375,
-0.049224853515625,
0.033935546875,
0.03424072265625,
0.04437255859375,
-0.0008268356323242188,
0.0106658935546875,
0.0034313201904296875,
0.01363372802734375,
0.005443572998046875,
-0.018524169921875,
0.04833984375,
-0.03570556640625,
-0.000012099742889404297,
-0.0239105224609375,
-0.034027099609375,
-0.049041748046875,
0.012725830078125,
0.04669189453125,
-0.03692626953125,
0.023590087890625
] |
182be90fd20aae808957f6c05d83af513ba0c844
|
Wordpress Stackexchange
Q: Setting WPLANG from a plugin For a single site wordpress, the language must be set from wp-config.php's WPLANG, but is it possible to set from my plugin which override the default value?
A: In wp-includes/l10n.php you will find the function get_locale(). It offers a filter; you can set the language and ignore the constant:
function get_locale() {
global $locale;
if ( isset( $locale ) )
return apply_filters( 'locale', $locale );
// WPLANG is defined in wp-config.
if ( defined( 'WPLANG' ) )
$locale = WPLANG;
// If multisite, check options.
if ( is_multisite() ) {
// Don't check blog option when installing.
if ( defined( 'WP_INSTALLING' ) || ( false === $ms_locale = get_option( 'WPLANG' ) ) )
$ms_locale = get_site_option('WPLANG');
if ( $ms_locale !== false )
$locale = $ms_locale;
}
if ( empty( $locale ) )
$locale = 'en_US';
return apply_filters( 'locale', $locale );
}
To change it per plugin use the filter 'locale'. Example:
add_filter( 'locale', 'wpse_52419_change_language' );
function wpse_52419_change_language( $locale )
{
return 'de_DE';
}
|
Q: Setting WPLANG from a plugin For a single site wordpress, the language must be set from wp-config.php's WPLANG, but is it possible to set from my plugin which override the default value?
A: In wp-includes/l10n.php you will find the function get_locale(). It offers a filter; you can set the language and ignore the constant:
function get_locale() {
global $locale;
if ( isset( $locale ) )
return apply_filters( 'locale', $locale );
// WPLANG is defined in wp-config.
if ( defined( 'WPLANG' ) )
$locale = WPLANG;
// If multisite, check options.
if ( is_multisite() ) {
// Don't check blog option when installing.
if ( defined( 'WP_INSTALLING' ) || ( false === $ms_locale = get_option( 'WPLANG' ) ) )
$ms_locale = get_site_option('WPLANG');
if ( $ms_locale !== false )
$locale = $ms_locale;
}
if ( empty( $locale ) )
$locale = 'en_US';
return apply_filters( 'locale', $locale );
}
To change it per plugin use the filter 'locale'. Example:
add_filter( 'locale', 'wpse_52419_change_language' );
function wpse_52419_change_language( $locale )
{
return 'de_DE';
}
|
wordpress
|
{
"language": "en",
"length": 169,
"provenance": "stackexchange_00019.jsonl.gz:420045",
"question_score": "11",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52419"
}
|
[
0.01392364501953125,
-0.00984954833984375,
-0.01490020751953125,
-0.006954193115234375,
0.006626129150390625,
-0.0240325927734375,
0.042388916015625,
-0.004360198974609375,
0.01654052734375,
0.004547119140625,
0.0181121826171875,
-0.025909423828125,
0.005565643310546875,
-0.0504150390625,
0.0136871337890625,
-0.0009455680847167969,
0.031402587890625,
-0.004802703857421875,
-0.004119873046875,
-0.00354766845703125,
-0.0124053955078125,
0.00624847412109375,
-0.011962890625,
0.038970947265625,
0.045135498046875,
-0.06939697265625,
0.0736083984375,
-0.033966064453125,
0.0172576904296875,
-0.02838134765625,
0.029541015625,
0.023956298828125,
0.0224609375,
0.00460052490234375,
-0.045654296875,
-0.0699462890625,
-0.018585205078125,
0.003692626953125,
-0.045623779296875,
0.051025390625,
0.034393310546875,
-0.017791748046875,
-0.0640869140625,
0.07568359375,
-0.0307769775390625,
-0.07354736328125,
0.0548095703125,
-0.0149993896484375,
-0.0044403076171875,
0.01263427734375,
0.032745361328125,
-0.02777099609375,
0.037689208984375,
-0.07177734375,
-0.01776123046875,
-0.01251983642578125,
-0.0278472900390625,
0.0214691162109375,
0.01763916015625,
0.02001953125,
-0.00984954833984375,
0.0035037994384765625,
0.004695892333984375,
-0.017059326171875,
0.00600433349609375,
-0.007297515869140625,
-0.0233001708984375,
0.0223846435546875,
-0.033782958984375,
0.003025054931640625,
0.0274505615234375,
-0.0391845703125,
0.0036106109619140625,
-0.02197265625,
-0.0193634033203125,
0.0234527587890625,
-0.0198974609375,
-0.0316162109375,
0.037689208984375,
-0.0294342041015625,
0.0274658203125,
-0.004970550537109375,
-0.031646728515625,
-0.0341796875,
0.03411865234375,
0.0010318756103515625,
0.00853729248046875,
-0.01189422607421875,
-0.06524658203125,
-0.010223388671875,
-0.03704833984375,
0.0016069412231445312,
-0.129150390625,
-0.0070343017578125,
0.032623291015625,
-0.038787841796875,
0.0189666748046875,
0.050201416015625,
-0.034149169921875,
-0.00983428955078125,
-0.01021575927734375,
-0.0210723876953125,
-0.00553131103515625,
-0.0251007080078125,
0.0008592605590820312,
-0.001922607421875,
-0.018096923828125,
0.03289794921875,
0.048431396484375,
0.050537109375,
0.00560760498046875,
0.029815673828125,
-0.0272979736328125,
-0.0291748046875,
-0.0180816650390625,
0.0235443115234375,
-0.0372314453125,
-0.0014286041259765625,
0.0035457611083984375,
-0.00494384765625,
0.01102447509765625,
0.02142333984375,
-0.00684356689453125,
-0.0222930908203125,
-0.0187225341796875,
-0.04986572265625,
-0.0307769775390625,
-0.0037899017333984375,
-0.0181732177734375,
0.0259246826171875,
-0.0277252197265625,
-0.007556915283203125,
0.06329345703125,
0.049346923828125,
0.016845703125,
-0.0238189697265625,
0.060211181640625,
0.0093841552734375,
0.01158905029296875,
0.00446319580078125,
-0.0023193359375,
0.0165252685546875,
-0.006805419921875,
-0.002552032470703125,
-0.025970458984375,
-0.01474761962890625,
0.00940704345703125,
0.04339599609375,
0.0016994476318359375,
-0.03717041015625,
0.0306243896484375,
0.005580902099609375,
0.0118865966796875,
-0.0020503997802734375,
-0.022674560546875,
-0.02252197265625,
0.006572723388671875,
-0.0195465087890625,
-0.01421356201171875,
-0.026611328125,
-0.0036830902099609375,
-0.038604736328125,
-0.024169921875,
-0.006649017333984375,
-0.035675048828125,
0.045135498046875,
0.003818511962890625,
0.005718231201171875,
0.005825042724609375,
-0.0291290283203125,
0.0063934326171875,
0.0301971435546875,
-0.0257720947265625,
-0.0153656005859375,
0.01294708251953125,
-0.001422882080078125,
-0.0797119140625,
0.051025390625,
0.033050537109375,
0.00299835205078125,
0.036041259765625,
-0.016937255859375,
0.0718994140625,
0.047821044921875,
-0.044097900390625,
-0.043701171875,
0.040618896484375,
0.045440673828125,
0.03033447265625,
0.034576416015625,
0.0313720703125,
-0.01468658447265625,
-0.01522064208984375,
-0.01042938232421875,
0.0087432861328125,
-0.01027679443359375,
0.0010061264038085938,
0.0126190185546875,
0.00225830078125,
-0.01003265380859375,
0.037353515625,
-0.0301361083984375,
0.038848876953125,
0.0020542144775390625,
-0.041107177734375,
0.0203857421875,
-0.035736083984375,
0.023895263671875,
0.0125274658203125,
-0.0238494873046875,
0.006927490234375,
-0.012115478515625,
0.015716552734375,
-0.053558349609375,
-0.050018310546875,
0.033477783203125,
0.00771331787109375,
0.04815673828125,
0.0280609130859375,
0.00792694091796875,
0.0521240234375,
-0.03851318359375,
0.035797119140625,
0.021453857421875,
0.007747650146484375,
-0.00605010986328125,
-0.0021648406982421875,
-0.00142669677734375,
0.018768310546875,
0.01235198974609375,
-0.007465362548828125,
0.005939483642578125,
-0.023223876953125,
0.006244659423828125,
0.0086669921875,
0.0178070068359375,
0.01134490966796875,
-0.048583984375,
0.0011339187622070312,
0.0308074951171875,
0.038726806640625,
0.0191650390625,
0.0035724639892578125,
0.0031108856201171875,
0.0234832763671875,
-0.0179595947265625,
0.0302886962890625,
-0.0173797607421875,
0.029937744140625,
0.040557861328125,
-0.04217529296875,
-0.008514404296875,
0.02593994140625,
-0.03643798828125,
-0.002140045166015625,
0.052154541015625,
-0.04449462890625,
-0.06591796875,
0.057342529296875,
-0.021392822265625,
0.0234832763671875,
-0.01253509521484375,
-0.025177001953125,
0.0097808837890625,
0.0045318603515625,
-0.015472412109375,
-0.00949859619140625,
-0.0062255859375,
-0.0223846435546875,
0.01131439208984375,
0.0271759033203125,
-0.043182373046875,
0.00930023193359375,
-0.0006780624389648438,
-0.067138671875,
0.0162353515625,
-0.0259552001953125,
0.0232696533203125,
0.004924774169921875,
-0.0176544189453125,
-0.01013946533203125,
0.04705810546875,
-0.01263427734375,
-0.026611328125,
-0.032958984375,
-0.042327880859375,
-0.01030731201171875,
-0.0131988525390625,
-0.00527191162109375,
-0.0270843505859375,
0.0204315185546875,
-0.0223388671875,
-0.039459228515625,
0.0191192626953125,
-0.00012063980102539062,
-0.04486083984375,
0.0479736328125,
-0.018768310546875,
0.0138702392578125,
-0.0253753662109375,
0.0280303955078125,
0.04400634765625,
0.017181396484375,
-0.030059814453125,
0.00873565673828125,
-0.0243377685546875,
0.0010461807250976562,
0.00394439697265625,
-0.0247650146484375,
0.006229400634765625,
-0.07489013671875,
0.016998291015625,
-0.0210723876953125,
-0.021759033203125,
-0.07159423828125,
-0.054473876953125,
-0.06689453125,
-0.06561279296875,
-0.1104736328125,
-0.034820556640625,
0.003353118896484375,
-0.017913818359375,
0.048095703125,
-0.01435089111328125,
0.0089569091796875,
-0.043792724609375,
-0.0008034706115722656,
0.0009717941284179688,
0.0178985595703125,
-0.01312255859375,
-0.0221710205078125,
-0.0157928466796875,
-0.03997802734375,
-0.01007843017578125,
0.01142120361328125,
-0.00708770751953125,
0.0009775161743164062,
0.0245208740234375,
0.013275146484375,
-0.00975799560546875,
0.00902557373046875,
0.036285400390625,
-0.028045654296875,
-0.0279998779296875,
-0.03936767578125,
-0.01296234130859375,
0.055328369140625,
-0.020751953125,
-0.0249481201171875,
0.0266571044921875,
0.017364501953125,
-0.002277374267578125,
0.00428009033203125,
0.01407623291015625,
0.044769287109375,
-0.031646728515625,
-0.039154052734375,
0.028106689453125,
0.01244354248046875,
-0.0303192138671875,
-0.03448486328125,
0.006038665771484375,
-0.03564453125,
0.06585693359375,
0.00719451904296875,
-0.0267486572265625,
0.0206451416015625,
0.0142974853515625,
-0.0032806396484375,
-0.01311492919921875,
0.051666259765625,
-0.03350830078125,
0.0173187255859375,
0.0004200935363769531,
-0.033599853515625,
-0.0252227783203125,
0.0198211669921875,
-0.0274505615234375,
0.0008001327514648438,
-0.005626678466796875,
-0.014678955078125,
-0.00807952880859375,
-0.01297760009765625,
-0.01593017578125,
-0.0249481201171875,
0.042572021484375,
-0.037933349609375,
-0.027099609375,
-0.00016045570373535156,
-0.0168304443359375,
0.0216217041015625,
0.05810546875,
-0.0239105224609375,
-0.00830841064453125,
0.007778167724609375,
0.0249481201171875,
-0.049163818359375,
-0.0482177734375,
-0.03192138671875,
-0.01422882080078125,
-0.07489013671875,
0.0021457672119140625,
-0.006153106689453125,
-0.0196075439453125,
-0.014862060546875,
0.00848388671875,
-0.032928466796875,
-0.04071044921875,
0.028533935546875,
-0.00972747802734375,
-0.0115814208984375,
0.015625,
-0.0158843994140625,
-0.00009435415267944336,
-0.00981903076171875,
-0.019989013671875,
-0.07769775390625,
-0.0130462646484375,
-0.05145263671875,
0.07037353515625,
0.026458740234375,
-0.0390625,
-0.0198974609375,
0.025238037109375,
0.00983428955078125,
0.01446533203125,
0.0129547119140625,
0.0131683349609375,
0.0158538818359375,
0.0035305023193359375,
0.020050048828125,
-0.00882720947265625,
0.000225067138671875,
0.004962921142578125,
-0.054229736328125,
0.0244903564453125,
0.00927734375,
0.014007568359375,
0.042572021484375,
-0.053741455078125,
-0.0673828125,
-0.024749755859375,
-0.006664276123046875,
-0.0225982666015625,
-0.036376953125,
0.024932861328125,
-0.003108978271484375,
-0.039581298828125,
0.0780029296875,
0.03863525390625,
0.0081634521484375,
-0.0160980224609375,
0.05572509765625,
-0.0022373199462890625,
-0.0538330078125,
-0.0816650390625,
-0.0033626556396484375,
0.0192108154296875,
-0.0004596710205078125,
0.0797119140625,
0.03900146484375,
-0.004123687744140625,
0.0872802734375,
-0.00348663330078125,
-0.00019085407257080078,
0.0038738250732421875,
0.038787841796875,
0.0160980224609375,
-0.01513671875,
0.026519775390625,
0.01148223876953125,
-0.05694580078125,
0.0214080810546875,
0.018096923828125,
-0.02301025390625,
0.0301666259765625,
0.02813720703125,
0.0164947509765625,
-0.0289764404296875,
-0.0238494873046875,
-0.064208984375,
0.023773193359375,
0.0026912689208984375,
-0.01354217529296875,
-0.01318359375,
0.021697998046875,
0.0096588134765625,
0.033599853515625,
-0.00772857666015625,
0.035736083984375,
0.037872314453125,
0.04522705078125,
0.011077880859375,
0.037933349609375,
-0.0003592967987060547,
-0.024505615234375,
-0.018890380859375,
0.03790283203125,
0.0020503997802734375,
-0.0338134765625,
0.0455322265625,
0.00376129150390625,
0.0421142578125,
0.0374755859375,
-0.013519287109375,
-0.005390167236328125,
0.0247802734375,
-0.0225982666015625,
-0.00980377197265625,
0.01898193359375,
0.0042572021484375,
-0.053680419921875,
0.006580352783203125,
0.0291900634765625,
0.002166748046875,
0.0230255126953125,
0.052459716796875,
0.005611419677734375,
0.03192138671875,
-0.01468658447265625,
-0.006954193115234375,
0.01229095458984375,
0.0276947021484375,
0.02783203125,
-0.038909912109375,
0.01378631591796875,
-0.01171112060546875,
0.0152740478515625,
0.01251220703125,
0.0217437744140625,
0.0256500244140625,
0.0004646778106689453,
-0.037353515625,
-0.025146484375,
0.0171661376953125,
-0.0127410888671875,
-0.005062103271484375,
0.0179290771484375,
-0.015960693359375,
-0.059844970703125,
-0.00799560546875,
0.02178955078125,
0.0341796875,
-0.034027099609375,
-0.00243377685546875,
-0.02874755859375,
-0.01120758056640625,
-0.01544189453125,
0.026214599609375,
-0.048828125,
0.01519012451171875,
0.01617431640625,
-0.0007801055908203125,
-0.02490234375,
-0.01172637939453125,
-0.0804443359375,
0.01532745361328125,
-0.005859375,
-0.006649017333984375,
-0.002033233642578125,
-0.04315185546875,
0.0369873046875,
-0.01395416259765625,
-0.0083160400390625,
-0.015167236328125,
0.036895751953125,
0.01141357421875,
-0.00212860107421875,
0.002288818359375,
-0.0191497802734375,
-0.043182373046875,
-0.036956787109375,
0.00608062744140625,
-0.0179290771484375,
-0.0245208740234375,
0.001705169677734375,
0.0099945068359375,
0.0194854736328125,
-0.013763427734375,
-0.0116119384765625,
0.002170562744140625,
0.0225677490234375,
0.016998291015625,
0.0247039794921875,
-0.031768798828125,
0.0997314453125,
0.016876220703125,
0.0020847320556640625,
0.002254486083984375,
0.0599365234375,
0.0000934600830078125,
0.006023406982421875,
0.0191192626953125,
-0.01224517822265625,
-0.01514434814453125,
-0.00879669189453125,
-0.037811279296875,
-0.025665283203125,
0.0269775390625,
-0.01255035400390625,
-0.006244659423828125,
0.00841522216796875,
0.01045989990234375,
-0.0160980224609375,
-0.0097198486328125,
-0.0036144256591796875,
0.018096923828125,
-0.0026035308837890625,
-0.038116455078125,
0.0150299072265625,
-0.0224456787109375,
0.0096282958984375,
0.03338623046875,
-0.047149658203125,
0.0275115966796875,
0.030242919921875,
-0.01549530029296875,
0.0211334228515625,
0.0233154296875,
0.0384521484375,
0.043365478515625,
0.019622802734375,
0.03363037109375,
-0.0250091552734375,
-0.0239715576171875,
0.0237884521484375,
0.0029010772705078125,
-0.001739501953125,
-0.040924072265625,
0.00592041015625,
-0.024658203125,
-0.00731658935546875,
0.00801849365234375,
0.05029296875,
0.0478515625,
-0.09423828125,
0.00933837890625,
0.01235198974609375,
0.01091766357421875,
0.0007653236389160156,
-0.00414276123046875,
-0.03057861328125,
-0.0234832763671875,
0.071044921875,
-0.068359375,
-0.037872314453125,
0.0284271240234375,
0.00726318359375,
0.011962890625,
-0.0015554428100585938,
0.07037353515625,
0.0303192138671875,
-0.013458251953125,
0.01425933837890625,
-0.002838134765625,
0.027587890625,
-0.005657196044921875,
0.0037174224853515625,
0.03778076171875,
-0.052154541015625,
-0.10614013671875,
-0.0152740478515625,
-0.0169830322265625,
-0.04766845703125,
0.056243896484375,
-0.0199127197265625,
0.021453857421875,
0.06878662109375,
-0.030181884765625,
0.0228424072265625,
0.0259857177734375,
-0.00913238525390625,
0.00875091552734375,
-0.0186004638671875,
0.0186004638671875,
0.0283050537109375,
-0.04742431640625,
0.02099609375,
-0.0113525390625,
-0.0110015869140625,
-0.0009489059448242188,
-0.040924072265625,
-0.005268096923828125,
0.032867431640625,
-0.01398468017578125,
0.008697509765625,
0.030364990234375,
0.0164794921875,
-0.0142364501953125,
0.01290130615234375,
-0.075439453125,
-0.0799560546875,
-0.0005936622619628906,
-0.08245849609375,
0.01415252685546875,
-0.008392333984375,
-0.0677490234375,
0.070556640625,
0.01453399658203125,
0.033721923828125,
0.002895355224609375,
0.0154571533203125,
-0.0156707763671875,
0.004329681396484375,
-0.02911376953125,
0.0335693359375,
-0.0010499954223632812,
0.03399658203125,
-0.037841796875,
0.002620697021484375,
0.0176544189453125,
0.0276336669921875,
0.0167388916015625,
0.01134490966796875,
0.0003654956817626953,
0.00537109375,
0.0277099609375,
0.026580810546875,
-0.00812530517578125,
0.016143798828125,
0.0007076263427734375,
0.0455322265625,
0.012908935546875,
-0.06103515625,
0.03546142578125,
-0.07568359375,
0.006526947021484375,
0.0089569091796875,
0.009429931640625,
0.010284423828125,
0.00514984130859375,
-0.0105438232421875,
-0.026580810546875,
0.00661468505859375,
0.0188751220703125,
-0.02593994140625,
0.012298583984375,
0.04010009765625,
0.01430511474609375,
0.030487060546875,
0.0003535747528076172,
-0.0161590576171875,
0.0362548828125,
-0.028839111328125,
-0.0117950439453125,
0.03912353515625,
0.01447296142578125,
0.00374603271484375,
-0.00013017654418945312,
-0.0146026611328125,
-0.001804351806640625,
0.026214599609375,
-0.01084136962890625,
0.0020961761474609375,
0.007633209228515625,
0.006229400634765625,
0.08099365234375,
0.004352569580078125,
-0.021636962890625,
-0.0286407470703125,
-0.037261962890625,
0.0014801025390625,
-0.01739501953125,
-0.021209716796875,
-0.007396697998046875,
-0.04290771484375,
-0.0203857421875,
0.020172119140625,
-0.00274658203125,
-0.0010824203491210938,
0.0311279296875,
-0.002044677734375,
0.005168914794921875,
0.035675048828125,
-0.0200958251953125,
0.016448974609375,
-0.050018310546875,
0.0012922286987304688,
0.01342010498046875,
0.067138671875,
0.0196533203125,
0.0469970703125,
-0.002887725830078125,
-0.034515380859375,
-0.0130462646484375,
0.05804443359375,
0.001422882080078125,
-0.01233673095703125,
-0.02783203125,
-0.046234130859375,
-0.0123291015625,
0.0283660888671875,
0.05584716796875,
-0.01300811767578125,
0.0709228515625,
0.0230865478515625,
-0.073974609375,
0.000007450580596923828,
0.022735595703125,
-0.0224609375,
0.015960693359375,
-0.0183563232421875,
0.052093505859375,
0.034149169921875,
0.004070281982421875,
-0.0201416015625,
0.060028076171875,
0.03338623046875,
-0.042236328125,
0.04412841796875,
-0.0152130126953125,
-0.039581298828125,
0.03277587890625,
0.01507568359375,
0.107666015625,
-0.01334381103515625,
-0.052337646484375,
-0.01093292236328125,
-0.01177978515625,
-0.0266876220703125,
0.0079345703125,
0.031280517578125,
-0.0027599334716796875,
0.0160675048828125,
-0.046875,
-0.033905029296875,
0.05767822265625,
-0.0183563232421875,
0.0005927085876464844,
-0.00731658935546875,
-0.005615234375,
-0.044708251953125,
-0.03814697265625,
-0.02435302734375,
-0.0229034423828125,
0.039276123046875,
0.0089874267578125,
0.04302978515625,
-0.004077911376953125,
0.03509521484375,
-0.0164642333984375,
-0.0142669677734375,
0.021453857421875,
-0.020721435546875,
0.01837158203125,
0.03082275390625,
0.01108551025390625,
-0.0247344970703125,
-0.03759765625,
-0.0260009765625,
0.0174713134765625,
-0.041290283203125,
0.00652313232421875,
-0.048431396484375,
0.0247955322265625,
-0.013763427734375,
0.057891845703125,
-0.0193023681640625,
-0.04931640625,
-0.0467529296875,
0.005260467529296875,
0.044891357421875,
0.06207275390625,
0.0002703666687011719,
0.00005888938903808594,
-0.032806396484375,
-0.014007568359375,
0.016845703125,
0.0010957717895507812,
-0.016357421875,
0.0149383544921875,
-0.031585693359375,
-0.005306243896484375,
-0.040863037109375,
-0.040008544921875,
-0.0233001708984375,
-0.00305938720703125,
0.0056915283203125,
-0.046051025390625,
0.01236724853515625,
-0.0118560791015625,
-0.03387451171875,
-0.015655517578125,
-0.0513916015625,
-0.00601959228515625,
0.016845703125,
0.0242156982421875,
-0.02874755859375,
-0.01861572265625,
-0.0182037353515625,
-0.0178070068359375,
-0.007465362548828125,
0.00801849365234375,
-0.0092315673828125,
-0.05926513671875,
-0.02606201171875,
0.006801605224609375,
0.017547607421875,
-0.020538330078125,
-0.004245758056640625,
-0.0107269287109375,
-0.03570556640625,
0.04498291015625,
-0.0229949951171875,
-0.039764404296875,
0.002475738525390625,
0.0161590576171875,
-0.039215087890625,
-0.04583740234375,
-0.058685302734375,
-0.007572174072265625,
-0.05731201171875,
-0.0024394989013671875,
0.01468658447265625,
0.007556915283203125,
-0.02484130859375,
0.0268707275390625,
-0.01971435546875,
0.06805419921875,
-0.04608154296875,
-0.0211944580078125,
0.04034423828125,
-0.022674560546875,
-0.018463134765625,
-0.1007080078125,
-0.0052032470703125,
-0.10479736328125,
0.0162506103515625,
-0.006137847900390625,
-0.0130767822265625,
-0.0015630722045898438,
-0.05767822265625,
-0.0916748046875,
0.005588531494140625,
-0.011444091796875,
-0.038238525390625,
-0.0282440185546875,
0.018585205078125,
-0.006855010986328125,
-0.0008459091186523438,
-0.01404571533203125,
-0.010955810546875,
-0.0251922607421875,
-0.0037021636962890625,
0.004573822021484375,
0.05145263671875,
-0.01073455810546875,
0.0106964111328125,
-0.01389312744140625,
0.02020263671875,
0.02349853515625,
-0.007015228271484375,
0.028289794921875,
-0.046539306640625,
0.0256805419921875,
0.036712646484375,
-0.04290771484375,
-0.074462890625,
-0.00499725341796875,
-0.007808685302734375,
0.007022857666015625,
-0.044281005859375,
-0.046295166015625,
-0.038726806640625,
0.10888671875,
0.0222015380859375,
0.034149169921875,
-0.0164031982421875,
0.0110015869140625,
0.016387939453125,
-0.0196380615234375,
0.0076904296875,
0.017364501953125,
-0.051239013671875,
-0.027374267578125,
0.015777587890625,
0.01419830322265625,
0.0182342529296875,
-0.0020694732666015625,
0.006618499755859375,
-0.027557373046875,
0.004703521728515625,
-0.0294036865234375,
-0.0231781005859375,
-0.050079345703125,
0.048065185546875,
-0.025115966796875,
0.00238037109375,
0.0159912109375,
0.031890869140625,
0.0112457275390625,
0.036407470703125,
-0.0233154296875,
0.01641845703125,
-0.00015342235565185547,
0.01367950439453125,
0.01629638671875,
0.0027561187744140625,
0.0124664306640625,
0.0118255615234375,
-0.0296173095703125,
0.0213775634765625,
0.01094818115234375,
0.054229736328125,
-0.005519866943359375,
-0.00748443603515625,
0.03155517578125,
-0.0390625,
-0.030059814453125,
0.0170440673828125,
-0.005359649658203125,
0.00627899169921875,
-0.08941650390625,
0.045745849609375,
-0.04827880859375,
-0.034942626953125,
0.0174407958984375,
0.0283203125,
0.0026874542236328125,
-0.0292816162109375,
0.05352783203125,
-0.01238250732421875,
0.0010662078857421875,
0.0204315185546875
] |
6c8e9310eb883e4be3dacd1db1002a876811db75
|
Wordpress Stackexchange
Q: Remove ?ver= from wp_register_script I'm getting nags on google speed test regarding the querystrings in my scripts. So, I'm trying to remove them by passing false as the argument for that parameter. However, it does not seem to have effect:
wp_register_script('myscript', get_bloginfo('template_directory').'/scripts.myversionnumber.js',false,false,true);
wp_enqueue_script('myscript');
PS: the "myversionnumber" part of the js filename is my means of controlling cache/versioning rather than the ?ver= approach which apparently trips up some proxy servers (according to Google pagespeed test):
Remove query strings from static resources Enabling public caching in
the HTTP headers for static resources allows the browser to download
resources from a nearby proxy server rather than from a remote origin
server. Learn more
Suggestions for this page
Resources with a "?" in the URL are not cached by some proxy caching
servers. Remove the query string and encode the parameters into the
URL for the following resources:
A: You can pass null as the version value to wp_register_script or wp_enqueue_script and it should drop the query string.
<?php
wp_enqueue_script(
'myscript',
'/path/to/script.js',
array(),
null
);
|
Q: Remove ?ver= from wp_register_script I'm getting nags on google speed test regarding the querystrings in my scripts. So, I'm trying to remove them by passing false as the argument for that parameter. However, it does not seem to have effect:
wp_register_script('myscript', get_bloginfo('template_directory').'/scripts.myversionnumber.js',false,false,true);
wp_enqueue_script('myscript');
PS: the "myversionnumber" part of the js filename is my means of controlling cache/versioning rather than the ?ver= approach which apparently trips up some proxy servers (according to Google pagespeed test):
Remove query strings from static resources Enabling public caching in
the HTTP headers for static resources allows the browser to download
resources from a nearby proxy server rather than from a remote origin
server. Learn more
Suggestions for this page
Resources with a "?" in the URL are not cached by some proxy caching
servers. Remove the query string and encode the parameters into the
URL for the following resources:
A: You can pass null as the version value to wp_register_script or wp_enqueue_script and it should drop the query string.
<?php
wp_enqueue_script(
'myscript',
'/path/to/script.js',
array(),
null
);
A: Foreword
I solved this a lot differently from SickHippie and chrisguitarguy and I guess it's not the way it is supposed to be solved, but it's working really good for me.
The code...
I put this snippet of code at the end of my theme's functions.php file:
function remove_cssjs_querystring( $src ) {
if( strpos( $src, '?rev=' ) ) // copy/paste this line and the next one to take away what you want from the end of your css/js
$src = remove_query_arg( 'rev', $src );
if( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_querystring', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_querystring', 10, 2 );
Where the idea came from...
I was loooking for it on Google and I found this article, but I kept having a problem with css/js: at this point my code still had (here and there) at the end something like .../some-stylesheet.css?rev=... and I thought about extending the code snippet a little bit to include anything that could have been after .css.
A: I think you have to pass NULL as the 4th parameter.
wp_register_script(
'myscript',
get_bloginfo('template_directory').'/scripts.myversionnumber.js',
false,
NULL,
true);
wp_enqueue_script('myscript');
|
wordpress
|
{
"language": "en",
"length": 364,
"provenance": "stackexchange_00019.jsonl.gz:420054",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52452"
}
|
[
0.0265960693359375,
0.01226043701171875,
-0.043670654296875,
-0.0142364501953125,
0.026092529296875,
-0.0562744140625,
0.0487060546875,
0.017364501953125,
-0.0172119140625,
0.01812744140625,
0.0087890625,
-0.00774383544921875,
-0.056304931640625,
-0.0321044921875,
-0.025054931640625,
-0.047271728515625,
0.0477294921875,
-0.0009145736694335938,
0.021697998046875,
-0.004817962646484375,
-0.0014743804931640625,
0.03326416015625,
0.02899169921875,
0.10516357421875,
0.0132598876953125,
-0.0294647216796875,
0.105224609375,
-0.01898193359375,
-0.007564544677734375,
-0.0226287841796875,
0.01255035400390625,
0.00795745849609375,
0.0006337165832519531,
0.039764404296875,
-0.0167236328125,
-0.00972747802734375,
-0.00418853759765625,
0.0272369384765625,
0.0301361083984375,
-0.005889892578125,
0.0172882080078125,
-0.0140228271484375,
0.003917694091796875,
-0.035888671875,
-0.0177154541015625,
-0.0188140869140625,
0.032806396484375,
-0.003726959228515625,
0.0211029052734375,
0.01120758056640625,
0.00580596923828125,
0.05145263671875,
0.006504058837890625,
0.04296875,
-0.00971221923828125,
0.017181396484375,
-0.025726318359375,
0.01149749755859375,
0.0163116455078125,
0.055084228515625,
0.00940704345703125,
0.027679443359375,
-0.01995849609375,
-0.04541015625,
-0.018768310546875,
-0.01013946533203125,
0.01036834716796875,
0.0166778564453125,
-0.047943115234375,
-0.0404052734375,
0.02447509765625,
-0.016143798828125,
-0.01308441162109375,
-0.0093994140625,
-0.0024280548095703125,
-0.0015840530395507812,
-0.025390625,
-0.02215576171875,
0.026275634765625,
0.006877899169921875,
-0.005908966064453125,
-0.039581298828125,
-0.0279693603515625,
0.0184783935546875,
-0.0164031982421875,
0.029632568359375,
-0.0172882080078125,
-0.0004837512969970703,
-0.05755615234375,
-0.03033447265625,
-0.044830322265625,
-0.06976318359375,
0.00875091552734375,
-0.034576416015625,
-0.03948974609375,
-0.004547119140625,
0.041168212890625,
0.038787841796875,
0.0250244140625,
0.003063201904296875,
-0.009033203125,
-0.0214080810546875,
-0.02874755859375,
-0.0190277099609375,
0.016204833984375,
0.08197021484375,
-0.0202178955078125,
-0.00943756103515625,
0.0345458984375,
0.010009765625,
0.03857421875,
-0.019744873046875,
-0.01375579833984375,
0.0280609130859375,
-0.052642822265625,
-0.00698089599609375,
-0.036956787109375,
-0.03662109375,
-0.0296630859375,
0.004596710205078125,
0.0156707763671875,
0.0275726318359375,
0.018157958984375,
-0.0276947021484375,
0.0269317626953125,
0.0065765380859375,
-0.0289154052734375,
-0.0178375244140625,
-0.042816162109375,
0.0411376953125,
-0.00910186767578125,
-0.0006875991821289062,
0.0469970703125,
0.036651611328125,
-0.0087127685546875,
-0.0340576171875,
0.033721923828125,
-0.01096343994140625,
-0.01413726806640625,
0.0247955322265625,
-0.030242919921875,
-0.046661376953125,
0.00119781494140625,
-0.024017333984375,
-0.0159912109375,
-0.01221466064453125,
0.00887298583984375,
0.031463623046875,
0.0166778564453125,
0.00214385986328125,
-0.029022216796875,
-0.0005025863647460938,
0.054901123046875,
-0.0125274658203125,
-0.046905517578125,
-0.035186767578125,
-0.01076507568359375,
-0.0305938720703125,
0.0012426376342773438,
-0.03680419921875,
-0.0246124267578125,
-0.01499176025390625,
-0.007389068603515625,
-0.03955078125,
-0.04156494140625,
-0.01416778564453125,
0.0288543701171875,
-0.00208282470703125,
0.0127716064453125,
0.053985595703125,
-0.026397705078125,
-0.038360595703125,
-0.01776123046875,
0.007595062255859375,
-0.0157623291015625,
0.0102691650390625,
0.023406982421875,
0.01229095458984375,
0.01953125,
0.003116607666015625,
-0.046295166015625,
-0.049346923828125,
0.0440673828125,
-0.049713134765625,
-0.0784912109375,
0.024261474609375,
0.0244293212890625,
0.021820068359375,
0.003753662109375,
-0.008758544921875,
0.143798828125,
0.0489501953125,
-0.035675048828125,
0.004268646240234375,
-0.00012814998626708984,
-0.0015363693237304688,
0.01708984375,
0.0071563720703125,
0.00852203369140625,
-0.0220947265625,
0.04571533203125,
0.0074005126953125,
0.0097198486328125,
-0.0222625732421875,
-0.0684814453125,
0.0229644775390625,
-0.02996826171875,
0.042816162109375,
-0.04974365234375,
0.037384033203125,
0.0278472900390625,
0.0279388427734375,
-0.046783447265625,
0.042816162109375,
0.0212554931640625,
-0.01377105712890625,
0.00007718801498413086,
0.0657958984375,
-0.017547607421875,
0.039642333984375,
-0.004974365234375,
-0.034881591796875,
0.0172271728515625,
0.031341552734375,
0.014862060546875,
-0.0112457275390625,
-0.01422119140625,
-0.01490020751953125,
0.0526123046875,
-0.015869140625,
0.0633544921875,
0.0278167724609375,
0.01312255859375,
0.04718017578125,
0.0094146728515625,
-0.005657196044921875,
0.0120849609375,
-0.08160400390625,
0.022247314453125,
0.038238525390625,
0.028656005859375,
0.0216217041015625,
-0.04443359375,
-0.0211029052734375,
0.012237548828125,
-0.05718994140625,
-0.0140228271484375,
-0.0006108283996582031,
-0.00954437255859375,
-0.0036411285400390625,
0.010772705078125,
-0.0310821533203125,
0.039825439453125,
-0.04144287109375,
0.004917144775390625,
0.0280914306640625,
0.0159454345703125,
0.015655517578125,
0.006011962890625,
0.00318145751953125,
-0.0008106231689453125,
0.016357421875,
-0.01186370849609375,
0.01306915283203125,
0.0212249755859375,
0.0129241943359375,
0.01331329345703125,
0.0225372314453125,
-0.01024627685546875,
0.0174560546875,
0.0211334228515625,
-0.04876708984375,
-0.0099334716796875,
-0.008056640625,
0.0384521484375,
-0.042083740234375,
-0.04345703125,
0.022064208984375,
-0.0029239654541015625,
-0.01788330078125,
0.00836944580078125,
0.00786590576171875,
-0.04248046875,
0.0037059783935546875,
0.006313323974609375,
-0.0179443359375,
0.0015516281127929688,
0.053131103515625,
0.0205535888671875,
0.017333984375,
0.0391845703125,
-0.0055694580078125,
-0.010162353515625,
0.02471923828125,
0.0245819091796875,
-0.046234130859375,
0.0654296875,
-0.031494140625,
0.02801513671875,
0.0025768280029296875,
0.07501220703125,
0.0623779296875,
0.01226043701171875,
0.0079803466796875,
-0.002033233642578125,
0.04193115234375,
0.0159454345703125,
-0.005527496337890625,
-0.0023479461669921875,
0.0160675048828125,
-0.058563232421875,
-0.007160186767578125,
0.01380157470703125,
-0.01294708251953125,
0.00769805908203125,
-0.02032470703125,
-0.01029205322265625,
-0.005664825439453125,
-0.1375732421875,
-0.1151123046875,
0.015716552734375,
0.0245361328125,
-0.0043487548828125,
0.03155517578125,
0.017364501953125,
-0.0271453857421875,
0.044097900390625,
0.00714111328125,
0.0054779052734375,
-0.052734375,
-0.057220458984375,
-0.0562744140625,
-0.06573486328125,
0.0274505615234375,
0.006412506103515625,
0.0018062591552734375,
0.006580352783203125,
0.055755615234375,
0.0191497802734375,
-0.0390625,
0.0394287109375,
-0.0076751708984375,
0.0005946159362792969,
0.02239990234375,
0.0233001708984375,
-0.051483154296875,
-0.01483917236328125,
-0.0118408203125,
0.007091522216796875,
0.0277099609375,
-0.007465362548828125,
0.0186920166015625,
-0.006069183349609375,
-0.038665771484375,
0.036163330078125,
0.0032253265380859375,
-0.0262298583984375,
-0.01041412353515625,
0.04248046875,
-0.060211181640625,
-0.04296875,
0.0213470458984375,
-0.03363037109375,
0.011322021484375,
0.0100250244140625,
-0.0163726806640625,
0.02764892578125,
0.0177001953125,
0.058197021484375,
0.01161956787109375,
0.029052734375,
-0.032623291015625,
0.043212890625,
0.0184173583984375,
0.0650634765625,
-0.05108642578125,
0.0723876953125,
-0.006793975830078125,
0.019195556640625,
0.033294677734375,
0.01383209228515625,
0.033935546875,
-0.04888916015625,
0.0139923095703125,
0.0261688232421875,
0.00927734375,
-0.03375244140625,
0.047393798828125,
-0.040374755859375,
-0.00232696533203125,
-0.062164306640625,
0.0335693359375,
0.01448822021484375,
-0.024261474609375,
-0.00463104248046875,
0.0269012451171875,
-0.057342529296875,
-0.07568359375,
0.00963592529296875,
0.006206512451171875,
-0.01494598388671875,
0.004199981689453125,
-0.01491546630859375,
-0.006870269775390625,
-0.0250701904296875,
-0.0200042724609375,
-0.0181732177734375,
-0.0221710205078125,
0.060211181640625,
-0.038848876953125,
-0.0020351409912109375,
0.01239013671875,
0.012786865234375,
-0.043548583984375,
-0.05810546875,
0.0100250244140625,
-0.06591796875,
-0.0124053955078125,
-0.005889892578125,
0.0692138671875,
0.0200042724609375,
-0.0219573974609375,
-0.01238250732421875,
0.060211181640625,
0.004459381103515625,
-0.005275726318359375,
0.01605224609375,
-0.00861358642578125,
-0.0287628173828125,
0.0063629150390625,
0.01013946533203125,
-0.033721923828125,
-0.003414154052734375,
-0.01361846923828125,
-0.06011962890625,
-0.0469970703125,
-0.019073486328125,
-0.025115966796875,
0.042449951171875,
-0.0396728515625,
-0.041839599609375,
-0.01959228515625,
0.0100860595703125,
-0.0289154052734375,
-0.01360321044921875,
-0.00922393798828125,
0.01560211181640625,
-0.0194549560546875,
0.046966552734375,
0.00628662109375,
0.0165557861328125,
-0.01541900634765625,
0.03131103515625,
0.0235137939453125,
-0.032470703125,
0.039642333984375,
0.019744873046875,
0.01248931884765625,
-0.011749267578125,
0.064453125,
0.0018634796142578125,
-0.01568603515625,
0.077880859375,
-0.01824951171875,
0.01390838623046875,
-0.002628326416015625,
0.053253173828125,
0.0125885009765625,
-0.011871337890625,
0.0253753662109375,
0.032501220703125,
-0.0628662109375,
0.0014886856079101562,
0.0177001953125,
-0.02777099609375,
0.0245513916015625,
0.018341064453125,
-0.007175445556640625,
0.00917816162109375,
-0.01165771484375,
-0.0276031494140625,
0.0029926300048828125,
-0.0382080078125,
0.007049560546875,
0.016204833984375,
0.006763458251953125,
0.012359619140625,
0.053009033203125,
-0.0025768280029296875,
-0.026519775390625,
0.040740966796875,
-0.04193115234375,
0.048614501953125,
-0.040283203125,
-0.018463134765625,
-0.0416259765625,
0.007778167724609375,
-0.033294677734375,
-0.006053924560546875,
-0.042236328125,
-0.0202789306640625,
0.0128936767578125,
0.0548095703125,
-0.0014514923095703125,
0.04022216796875,
0.04449462890625,
0.034271240234375,
-0.007793426513671875,
-0.0295257568359375,
0.033966064453125,
0.01097869873046875,
-0.03466796875,
0.00852203369140625,
0.01007843017578125,
-0.023468017578125,
-0.0155029296875,
0.0279541015625,
-0.0008778572082519531,
-0.0036869049072265625,
-0.01097869873046875,
0.037933349609375,
-0.01108551025390625,
0.03399658203125,
0.0230255126953125,
-0.0163726806640625,
0.029754638671875,
-0.02783203125,
-0.0177459716796875,
-0.026458740234375,
-0.0021820068359375,
0.01123046875,
0.0247650146484375,
0.002727508544921875,
-0.004878997802734375,
0.0150146484375,
-0.024658203125,
-0.01708984375,
0.0264892578125,
-0.00591278076171875,
-0.0003123283386230469,
-0.0379638671875,
-0.07073974609375,
0.0294952392578125,
0.0142822265625,
0.01343536376953125,
0.0016269683837890625,
-0.01082611083984375,
0.01003265380859375,
0.018402099609375,
-0.0015087127685546875,
-0.0271759033203125,
-0.03790283203125,
0.044952392578125,
-0.01084136962890625,
-0.041748046875,
-0.0252532958984375,
0.007678985595703125,
-0.0287017822265625,
-0.0093536376953125,
0.06402587890625,
-0.0145263671875,
0.0007915496826171875,
-0.01078033447265625,
-0.0007262229919433594,
0.021026611328125,
0.0005402565002441406,
0.040618896484375,
0.0189208984375,
-0.01189422607421875,
-0.0167694091796875,
-0.054412841796875,
-0.0275726318359375,
-0.0340576171875,
-0.03704833984375,
-0.005825042724609375,
0.004886627197265625,
-0.021575927734375,
0.01428985595703125,
-0.017120361328125,
-0.003570556640625,
-0.005260467529296875,
0.01044464111328125,
0.005138397216796875,
0.044036865234375,
-0.0265045166015625,
0.0246734619140625,
0.015960693359375,
-0.0016603469848632812,
-0.00846099853515625,
0.00286865234375,
0.01971435546875,
-0.0014581680297851562,
0.03497314453125,
-0.03173828125,
-0.02203369140625,
-0.01800537109375,
-0.01690673828125,
-0.0208587646484375,
0.015380859375,
-0.00977325439453125,
0.0230560302734375,
0.0243377685546875,
0.0026988983154296875,
-0.010406494140625,
0.009765625,
0.0255279541015625,
0.039764404296875,
0.0194091796875,
0.006622314453125,
0.0266265869140625,
-0.00902557373046875,
0.046844482421875,
-0.03704833984375,
-0.023895263671875,
-0.035125732421875,
-0.006183624267578125,
-0.04736328125,
0.005992889404296875,
0.03497314453125,
0.036590576171875,
0.0665283203125,
-0.041595458984375,
0.04681396484375,
0.065185546875,
-0.00782012939453125,
-0.007808685302734375,
0.024932861328125,
0.020416259765625,
-0.01549530029296875,
0.020172119140625,
0.00991058349609375,
-0.001537322998046875,
-0.001499176025390625,
0.040069580078125,
0.05194091796875,
-0.039306640625,
-0.0020732879638671875,
0.0028133392333984375,
-0.031768798828125,
-0.00020444393157958984,
0.0015277862548828125,
0.017913818359375,
-0.025543212890625,
-0.0020542144775390625,
0.016204833984375,
-0.011749267578125,
-0.0033130645751953125,
-0.005649566650390625,
-0.0260009765625,
-0.0158233642578125,
-0.00478363037109375,
0.026123046875,
-0.0286102294921875,
0.0531005859375,
0.05517578125,
0.02288818359375,
-0.0277862548828125,
0.00004661083221435547,
0.04705810546875,
-0.053375244140625,
-0.10736083984375,
-0.0230865478515625,
-0.01715087890625,
-0.0545654296875,
0.0032176971435546875,
0.01389312744140625,
0.050689697265625,
0.0241851806640625,
0.016632080078125,
-0.0386962890625,
0.00807952880859375,
-0.0225372314453125,
0.00882720947265625,
-0.04541015625,
0.0234832763671875,
0.010955810546875,
-0.0325927734375,
0.0109100341796875,
0.0033092498779296875,
-0.0389404296875,
-0.0023040771484375,
0.00569915771484375,
0.0430908203125,
-0.01605224609375,
-0.031829833984375,
0.010955810546875,
0.0070037841796875,
-0.006134033203125,
-0.0181884765625,
0.01837158203125,
-0.0799560546875,
-0.06878662109375,
0.0062408447265625,
-0.0850830078125,
-0.026519775390625,
-0.0225830078125,
-0.01342010498046875,
0.1014404296875,
-0.0177001953125,
0.0093231201171875,
0.0169525146484375,
0.046844482421875,
-0.007686614990234375,
0.039825439453125,
-0.0016994476318359375,
0.01568603515625,
0.0140380859375,
0.01415252685546875,
0.0018682479858398438,
-0.0008916854858398438,
0.023681640625,
0.04833984375,
0.0467529296875,
-0.00690460205078125,
0.0228729248046875,
-0.02685546875,
0.01245880126953125,
0.056732177734375,
0.013275146484375,
-0.0194549560546875,
0.023193359375,
0.02886962890625,
0.01995849609375,
-0.0241851806640625,
0.019500732421875,
-0.0214385986328125,
-0.01678466796875,
0.049591064453125,
0.01312255859375,
0.0159759521484375,
0.0032863616943359375,
0.0189361572265625,
-0.05535888671875,
0.032867431640625,
0.040496826171875,
0.038055419921875,
-0.0073394775390625,
0.0289459228515625,
-0.00994873046875,
0.029541015625,
-0.052520751953125,
-0.007160186767578125,
0.01181793212890625,
0.001956939697265625,
-0.008819580078125,
0.057159423828125,
0.01448822021484375,
0.031036376953125,
0.007793426513671875,
0.003387451171875,
0.0031604766845703125,
0.0143890380859375,
0.0247802734375,
0.022613525390625,
0.0279693603515625,
0.00751495361328125,
0.0193634033203125,
0.007171630859375,
0.0283966064453125,
-0.029327392578125,
-0.039337158203125,
0.01076507568359375,
-0.006664276123046875,
-0.004436492919921875,
-0.027801513671875,
-0.0257110595703125,
-0.059661865234375,
-0.007293701171875,
0.00917816162109375,
0.0115203857421875,
0.0233306884765625,
-0.0249176025390625,
0.0233154296875,
0.0509033203125,
-0.0186920166015625,
0.0357666015625,
-0.03955078125,
-0.007022857666015625,
0.00847625732421875,
0.08001708984375,
0.0634765625,
0.02044677734375,
-0.0260772705078125,
-0.055572509765625,
-0.014404296875,
0.047698974609375,
0.01287078857421875,
0.014862060546875,
-0.024749755859375,
-0.0171051025390625,
-0.00018906593322753906,
0.014892578125,
0.019683837890625,
0.013519287109375,
0.057708740234375,
0.0411376953125,
-0.049041748046875,
0.005939483642578125,
0.04266357421875,
-0.0183258056640625,
0.047760009765625,
-0.01178741455078125,
0.037841796875,
0.007183074951171875,
-0.01102447509765625,
-0.0291900634765625,
0.035614013671875,
0.02294921875,
-0.02069091796875,
0.00994873046875,
-0.0003933906555175781,
-0.0280609130859375,
0.0297698974609375,
-0.0090789794921875,
0.057403564453125,
-0.0012121200561523438,
0.0225067138671875,
-0.0079803466796875,
0.0174560546875,
0.0004286766052246094,
-0.01282501220703125,
0.0160369873046875,
-0.01617431640625,
0.0491943359375,
0.033538818359375,
0.0161895751953125,
-0.0030345916748046875,
-0.034393310546875,
0.02740478515625,
-0.03759765625,
0.01212310791015625,
0.0110015869140625,
-0.01505279541015625,
-0.0006017684936523438,
0.0165557861328125,
-0.00603485107421875,
-0.01812744140625,
0.053955078125,
-0.005931854248046875,
-0.013671875,
0.038818359375,
-0.0219879150390625,
0.037017822265625,
0.0379638671875,
-0.0281219482421875,
-0.0142059326171875,
0.021209716796875,
-0.01611328125,
-0.055023193359375,
0.05438232421875,
0.005214691162109375,
0.018310546875,
0.055145263671875,
-0.0041046142578125,
-0.0020580291748046875,
-0.01617431640625,
-0.041778564453125,
-0.0452880859375,
-0.0231475830078125,
0.03143310546875,
0.02008056640625,
-0.0355224609375,
-0.048248291015625,
-0.010833740234375,
0.01739501953125,
0.03826904296875,
-0.030731201171875,
0.031402587890625,
-0.022918701171875,
0.051025390625,
0.037139892578125,
0.039886474609375,
0.0396728515625,
0.004314422607421875,
-0.02764892578125,
0.0305938720703125,
0.0268707275390625,
-0.0285491943359375,
0.007053375244140625,
0.0070037841796875,
-0.061676025390625,
0.0225982666015625,
0.017974853515625,
0.021148681640625,
0.01873779296875,
-0.033538818359375,
-0.0428466796875,
-0.006103515625,
-0.008636474609375,
-0.0169219970703125,
-0.005458831787109375,
-0.0218505859375,
0.00897216796875,
-0.003116607666015625,
-0.045928955078125,
-0.01123809814453125,
0.015899658203125,
0.022125244140625,
0.0214080810546875,
-0.0648193359375,
0.043212890625,
-0.0469970703125,
0.035552978515625,
-0.0165252685546875,
0.035308837890625,
-0.031646728515625,
-0.0308990478515625,
-0.03515625,
-0.044342041015625,
-0.043609619140625,
0.08551025390625,
-0.0025234222412109375,
-0.0081939697265625,
0.015472412109375,
0.024658203125,
0.01218414306640625,
-0.016510009765625,
-0.028076171875,
0.04443359375,
-0.09051513671875,
0.0017404556274414062,
0.006977081298828125,
0.043914794921875,
-0.0308380126953125,
-0.078125,
-0.012481689453125,
0.006412506103515625,
0.0257415771484375,
-0.022735595703125,
0.0096282958984375,
0.0019102096557617188,
-0.02337646484375,
-0.050872802734375,
0.05731201171875,
-0.00872039794921875,
-0.018890380859375,
-0.037506103515625,
-0.017913818359375,
0.01305389404296875,
0.007297515869140625,
-0.0189056396484375,
-0.006290435791015625,
-0.04364013671875,
0.011871337890625,
0.023681640625,
0.0472412109375,
0.020660400390625,
0.0203094482421875,
-0.03546142578125,
0.0210113525390625,
-0.019500732421875,
0.039337158203125,
-0.020782470703125,
0.0277557373046875,
0.022552490234375,
0.042327880859375,
0.012939453125,
0.062744140625,
0.0163116455078125,
-0.0748291015625,
-0.01259613037109375,
0.023223876953125,
-0.028961181640625,
0.009368896484375,
0.058135986328125,
0.05682373046875,
0.022308349609375,
-0.036590576171875,
-0.051055908203125,
-0.01047515869140625,
0.0152435302734375,
-0.035614013671875,
0.033966064453125,
-0.0838623046875,
-0.006969451904296875,
-0.0008306503295898438,
0.005214691162109375,
-0.0270538330078125,
-0.0294647216796875,
-0.032135009765625,
-0.0239105224609375,
0.0013818740844726562,
0.0103759765625,
0.006328582763671875,
-0.040557861328125,
0.0340576171875,
-0.01239776611328125,
0.0165557861328125,
0.0121917724609375,
0.0394287109375,
0.02716064453125,
0.036407470703125,
0.000789642333984375,
-0.0030307769775390625,
-0.00047016143798828125,
0.0312347412109375,
0.0158538818359375,
-0.0298614501953125,
-0.0044708251953125,
-0.0175018310546875,
-0.011138916015625,
0.01244354248046875,
0.01203155517578125,
0.0088043212890625,
-0.0156402587890625,
-0.0038890838623046875,
0.0011377334594726562,
0.00146484375,
-0.035125732421875,
0.0037212371826171875,
-0.021697998046875,
0.0196075439453125,
0.0160369873046875,
-0.0008921623229980469,
0.0709228515625,
0.0038585662841796875,
-0.01044464111328125,
-0.02227783203125,
-0.040069580078125,
-0.05712890625,
0.02313232421875,
-0.0760498046875,
-0.026885986328125,
0.0196685791015625
] |
adfca9721345b367d775d280de086406e911167a
|
Wordpress Stackexchange
Q: Counting words in a post How can I count words in a post? Something like the one displayed just below the post?
Can someone please show me the code for getting this. I have been searching everywhere.
A: How hard did you search? I searched Google for "wordpress count words in post" and found a function for it in the first result!
Put this in functions.php:
function prefix_wcount(){
ob_start();
the_content();
$content = ob_get_clean();
return sizeof(explode(" ", $content));
}
Then call it in the template like this:
<?php echo prefix_wcount(); ?>
|
Q: Counting words in a post How can I count words in a post? Something like the one displayed just below the post?
Can someone please show me the code for getting this. I have been searching everywhere.
A: How hard did you search? I searched Google for "wordpress count words in post" and found a function for it in the first result!
Put this in functions.php:
function prefix_wcount(){
ob_start();
the_content();
$content = ob_get_clean();
return sizeof(explode(" ", $content));
}
Then call it in the template like this:
<?php echo prefix_wcount(); ?>
A: Just count the spaces and add 1:
// No need to count markup.
$text = trim( strip_tags( get_the_content() ) );
$word_number = substr_count( "$text ", ' ' );
Another way, taking the old American double space tradition into account:
$word_number = preg_match_all( '~\s+~', "$text ", $m );
A: Easy and straightforward approach.
$word_count = str_word_count(trim(strip_tags($post->post_content)));
|
wordpress
|
{
"language": "en",
"length": 147,
"provenance": "stackexchange_00019.jsonl.gz:420056",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52456"
}
|
[
0.014984130859375,
-0.018341064453125,
0.010040283203125,
0.03326416015625,
-0.021453857421875,
-0.03271484375,
0.05767822265625,
-0.0293121337890625,
0.0088348388671875,
0.01116180419921875,
-0.037841796875,
0.0057373046875,
-0.036895751953125,
-0.007778167724609375,
-0.02239990234375,
-0.0372314453125,
0.0321044921875,
-0.0007281303405761719,
0.03717041015625,
-0.00711822509765625,
0.0028476715087890625,
0.033050537109375,
0.027069091796875,
0.0273895263671875,
0.02069091796875,
0.0098114013671875,
0.10833740234375,
-0.03765869140625,
0.0194091796875,
-0.0243072509765625,
0.02423095703125,
-0.004604339599609375,
0.0166015625,
0.00948333740234375,
-0.0199737548828125,
-0.0168304443359375,
-0.01318359375,
0.00714874267578125,
-0.00797271728515625,
0.017364501953125,
0.034149169921875,
-0.00951385498046875,
0.0284271240234375,
0.0025501251220703125,
0.018463134765625,
-0.022125244140625,
0.0252838134765625,
-0.07086181640625,
0.0295867919921875,
-0.0253143310546875,
0.002735137939453125,
0.01050567626953125,
0.0216827392578125,
-0.054656982421875,
-0.023529052734375,
0.0112762451171875,
0.043365478515625,
-0.0014772415161132812,
0.042327880859375,
-0.048492431640625,
-0.056732177734375,
-0.00409698486328125,
0.045166015625,
-0.0161285400390625,
-0.0164031982421875,
-0.00010663270950317383,
-0.0011529922485351562,
0.01441192626953125,
-0.0190582275390625,
-0.040771484375,
0.01009368896484375,
-0.0054931640625,
0.006046295166015625,
-0.0258026123046875,
0.01727294921875,
-0.034271240234375,
-0.011962890625,
-0.039581298828125,
0.0024127960205078125,
0.038055419921875,
-0.0188140869140625,
0.01439666748046875,
0.00479888916015625,
-0.00250244140625,
-0.045440673828125,
-0.020782470703125,
-0.0216217041015625,
-0.002384185791015625,
-0.029632568359375,
-0.039947509765625,
-0.01018524169921875,
0.0306549072265625,
-0.0504150390625,
-0.00452423095703125,
-0.03021240234375,
-0.0241546630859375,
0.04296875,
0.043670654296875,
-0.0110626220703125,
-0.039093017578125,
0.0146636962890625,
-0.0384521484375,
-0.03338623046875,
-0.0018405914306640625,
0.034332275390625,
0.0229339599609375,
-0.03631591796875,
0.05029296875,
0.08209228515625,
0.03564453125,
0.0123291015625,
0.0161285400390625,
-0.01318359375,
-0.031982421875,
-0.0235595703125,
0.0244140625,
-0.020843505859375,
-0.016937255859375,
0.007381439208984375,
-0.0218048095703125,
-0.00922393798828125,
-0.0146026611328125,
0.01251983642578125,
0.0186004638671875,
0.02386474609375,
0.006206512451171875,
-0.019439697265625,
-0.00499725341796875,
0.03369140625,
0.0357666015625,
-0.01190948486328125,
0.01605224609375,
-0.0018835067749023438,
-0.026580810546875,
-0.036895751953125,
-0.006511688232421875,
0.02984619140625,
-0.0092926025390625,
-0.0255279541015625,
0.023895263671875,
-0.01806640625,
-0.034088134765625,
-0.0186767578125,
-0.028900146484375,
0.045257568359375,
0.033447265625,
0.03436279296875,
0.0159759521484375,
-0.018798828125,
-0.0556640625,
0.056121826171875,
-0.00333404541015625,
0.007717132568359375,
0.013702392578125,
-0.028076171875,
0.013824462890625,
-0.045501708984375,
0.0166473388671875,
0.000054836273193359375,
0.01334381103515625,
0.030731201171875,
-0.0163421630859375,
-0.02496337890625,
0.01459503173828125,
-0.021728515625,
0.0306549072265625,
-0.01427459716796875,
0.007648468017578125,
0.020294189453125,
0.005207061767578125,
0.0161895751953125,
0.00270843505859375,
0.0288543701171875,
-0.008514404296875,
-0.0192413330078125,
-0.0147705078125,
-0.019500732421875,
-0.024200439453125,
0.0206756591796875,
0.059295654296875,
0.029327392578125,
-0.0012197494506835938,
0.025787353515625,
0.0108795166015625,
0.009124755859375,
-0.01239776611328125,
0.030975341796875,
0.006259918212890625,
-0.015228271484375,
0.0226593017578125,
-0.006679534912109375,
0.03814697265625,
0.00852203369140625,
0.008636474609375,
-0.0180816650390625,
-0.033966064453125,
-0.01221466064453125,
0.00266265869140625,
-0.026947021484375,
0.0014524459838867188,
0.039703369140625,
-0.0213165283203125,
0.01739501953125,
-0.033782958984375,
-0.02105712890625,
-0.0273895263671875,
0.002376556396484375,
0.0134124755859375,
0.01421356201171875,
0.024566650390625,
0.01502227783203125,
-0.021270751953125,
0.0010242462158203125,
-0.03619384765625,
-0.039276123046875,
-0.0219573974609375,
-0.007965087890625,
-0.025543212890625,
-0.0107269287109375,
-0.020721435546875,
0.0037746429443359375,
0.031494140625,
-0.006378173828125,
0.038055419921875,
0.051300048828125,
-0.050323486328125,
-0.00945281982421875,
-0.049713134765625,
-0.004749298095703125,
-0.0204620361328125,
-0.07562255859375,
0.0638427734375,
0.01148223876953125,
0.017059326171875,
-0.02783203125,
-0.019927978515625,
-0.03466796875,
-0.018310546875,
0.003620147705078125,
0.058074951171875,
0.03436279296875,
0.0404052734375,
-0.00849151611328125,
0.006072998046875,
0.09942626953125,
-0.007717132568359375,
-0.0034847259521484375,
0.003070831298828125,
0.00942230224609375,
0.0531005859375,
0.0191192626953125,
0.01535797119140625,
0.00836944580078125,
-0.036102294921875,
0.00455474853515625,
0.042266845703125,
-0.0021820068359375,
-0.0014514923095703125,
-0.0172119140625,
0.019012451171875,
-0.005023956298828125,
-0.0277099609375,
-0.010498046875,
-0.033447265625,
-0.037017822265625,
0.01482391357421875,
0.0023288726806640625,
0.0097808837890625,
-0.04656982421875,
0.0147247314453125,
0.047760009765625,
0.054290771484375,
0.00026679039001464844,
-0.004291534423828125,
-0.0253448486328125,
-0.0024814605712890625,
-0.03826904296875,
0.0228271484375,
0.0269775390625,
-0.033966064453125,
-0.023223876953125,
0.003780364990234375,
-0.026611328125,
-0.00894927978515625,
-0.01459503173828125,
-0.04547119140625,
0.01763916015625,
0.00787353515625,
-0.0193634033203125,
-0.007511138916015625,
0.0025310516357421875,
0.06378173828125,
-0.0007581710815429688,
0.02716064453125,
-0.004970550537109375,
0.0224761962890625,
-0.00638580322265625,
-0.066650390625,
0.04150390625,
-0.055999755859375,
0.056732177734375,
0.0731201171875,
-0.010009765625,
0.0099029541015625,
0.01971435546875,
0.005886077880859375,
0.03277587890625,
0.01244354248046875,
-0.00015032291412353516,
0.006011962890625,
-0.053802490234375,
0.0006246566772460938,
0.0189208984375,
0.0202178955078125,
-0.006832122802734375,
-0.040985107421875,
-0.0167694091796875,
0.008148193359375,
-0.09796142578125,
-0.07958984375,
-0.0222930908203125,
-0.0753173828125,
-0.030426025390625,
0.00856781005859375,
-0.057403564453125,
0.0222625732421875,
0.0298919677734375,
0.00212860107421875,
-0.042205810546875,
-0.00963592529296875,
-0.029022216796875,
-0.059112548828125,
-0.06451416015625,
-0.0277862548828125,
0.000010907649993896484,
0.0131683349609375,
0.0038585662841796875,
0.059417724609375,
0.0024356842041015625,
-0.10137939453125,
-0.024932861328125,
0.0263214111328125,
-0.017974853515625,
0.0251922607421875,
0.0225982666015625,
0.002872467041015625,
-0.048004150390625,
0.0272369384765625,
-0.004688262939453125,
0.004627227783203125,
-0.0248260498046875,
-0.01776123046875,
0.0023174285888671875,
-0.0010986328125,
0.02801513671875,
0.03265380859375,
-0.0186309814453125,
0.022003173828125,
0.042633056640625,
-0.033294677734375,
-0.0078582763671875,
0.01168060302734375,
-0.02593994140625,
-0.03350830078125,
-0.0209197998046875,
-0.0079193115234375,
-0.0289459228515625,
0.023193359375,
0.01275634765625,
0.0013074874877929688,
-0.00875091552734375,
0.004436492919921875,
0.0670166015625,
-0.0017948150634765625,
0.0053253173828125,
-0.0258941650390625,
-0.044219970703125,
-0.026275634765625,
0.040740966796875,
-0.027252197265625,
0.023223876953125,
-0.02117919921875,
0.0567626953125,
-0.03509521484375,
-0.072265625,
0.06976318359375,
0.04443359375,
-0.0215606689453125,
0.0017614364624023438,
-0.059295654296875,
0.02691650390625,
0.092529296875,
-0.01776123046875,
-0.03887939453125,
-0.020294189453125,
0.0233154296875,
-0.0016345977783203125,
-0.049041748046875,
0.0386962890625,
-0.0285186767578125,
-0.03265380859375,
0.0058746337890625,
-0.0137786865234375,
-0.00020933151245117188,
-0.0526123046875,
0.053253173828125,
-0.045623779296875,
-0.0013484954833984375,
0.0260467529296875,
-0.0526123046875,
-0.00853729248046875,
-0.0209503173828125,
-0.037445068359375,
-0.0338134765625,
-0.0159912109375,
-0.038330078125,
-0.0223541259765625,
0.00037407875061035156,
-0.029541015625,
0.017913818359375,
0.0244598388671875,
-0.0220947265625,
0.01045989990234375,
0.022857666015625,
0.031890869140625,
0.0274658203125,
-0.004238128662109375,
-0.017486572265625,
0.0177154541015625,
0.011199951171875,
0.0185699462890625,
-0.0158843994140625,
-0.0024166107177734375,
-0.006561279296875,
0.004787445068359375,
0.0546875,
-0.0274200439453125,
0.005687713623046875,
-0.026397705078125,
-0.01403045654296875,
0.01396942138671875,
-0.016357421875,
-0.01654052734375,
0.027740478515625,
-0.0259857177734375,
0.01419830322265625,
-0.0074310302734375,
0.0011310577392578125,
0.039886474609375,
0.0401611328125,
-0.02203369140625,
0.00669097900390625,
0.05230712890625,
0.01288604736328125,
-0.021240234375,
-0.071044921875,
0.0015687942504882812,
0.049835205078125,
0.0257720947265625,
-0.01025390625,
-0.008087158203125,
-0.0450439453125,
0.060211181640625,
0.025543212890625,
-0.007343292236328125,
-0.0140228271484375,
0.004528045654296875,
0.00420379638671875,
-0.016632080078125,
0.0042572021484375,
-0.01016998291015625,
0.06439208984375,
-0.0072479248046875,
-0.0298004150390625,
0.0007681846618652344,
0.038177490234375,
0.037689208984375,
-0.0418701171875,
0.03314208984375,
-0.0127410888671875,
-0.059112548828125,
0.01495361328125,
-0.007648468017578125,
0.003414154052734375,
0.0018949508666992188,
0.005062103271484375,
0.03155517578125,
0.03387451171875,
0.023712158203125,
0.0037250518798828125,
0.0301513671875,
-0.0300750732421875,
0.03350830078125,
0.003246307373046875,
-0.01277923583984375,
0.0017910003662109375,
-0.0044403076171875,
0.026885986328125,
-0.01375579833984375,
-0.05523681640625,
0.017425537109375,
-0.0167999267578125,
-0.005664825439453125,
0.032379150390625,
-0.00305938720703125,
0.02984619140625,
0.0245819091796875,
-0.017059326171875,
0.0145721435546875,
0.0113983154296875,
-0.00858306884765625,
-0.039093017578125,
0.00159454345703125,
-0.014617919921875,
0.00016570091247558594,
0.0304412841796875,
0.043182373046875,
-0.048370361328125,
0.052764892578125,
-0.005718231201171875,
0.026397705078125,
0.04931640625,
0.03192138671875,
0.01763916015625,
-0.036376953125,
-0.01885986328125,
0.0205078125,
0.0033931732177734375,
-0.02764892578125,
-0.039459228515625,
0.0291900634765625,
0.04034423828125,
-0.018218994140625,
0.0153350830078125,
0.0072784423828125,
0.002635955810546875,
-0.00897216796875,
-0.006237030029296875,
0.0186004638671875,
-0.0246734619140625,
0.0197296142578125,
0.030731201171875,
0.0005474090576171875,
-0.0086212158203125,
0.0144805908203125,
-0.033355712890625,
-0.0169677734375,
0.013427734375,
-0.056182861328125,
0.020599365234375,
-0.0167694091796875,
-0.0191497802734375,
-0.03668212890625,
-0.004367828369140625,
0.005970001220703125,
-0.00809478759765625,
-0.044097900390625,
-0.0046844482421875,
-0.0167388916015625,
0.0400390625,
-0.002025604248046875,
0.0205535888671875,
-0.0124664306640625,
-0.016876220703125,
0.046661376953125,
0.00852203369140625,
0.0290679931640625,
-0.0132904052734375,
-0.04876708984375,
-0.0171966552734375,
-0.03912353515625,
-0.019805908203125,
0.020660400390625,
0.00997161865234375,
-0.043365478515625,
-0.0036029815673828125,
-0.00666046142578125,
-0.00307464599609375,
-0.0015163421630859375,
-0.0038700103759765625,
-0.01293182373046875,
0.0281219482421875,
0.01250457763671875,
-0.005401611328125,
0.00013518333435058594,
0.038909912109375,
0.01220703125,
0.0355224609375,
0.0189056396484375,
0.03662109375,
0.01012420654296875,
-0.05023193359375,
0.039794921875,
-0.035247802734375,
-0.049652099609375,
0.0014734268188476562,
-0.0235137939453125,
-0.033782958984375,
-0.037078857421875,
-0.01280975341796875,
-0.00579833984375,
-0.002864837646484375,
0.0144195556640625,
-0.01447296142578125,
0.01229095458984375,
0.0217437744140625,
-0.01348114013671875,
0.013092041015625,
0.004276275634765625,
0.03155517578125,
-0.0209808349609375,
-0.0143280029296875,
0.00829315185546875,
-0.01088714599609375,
0.0063323974609375,
0.0163421630859375,
-0.01512908935546875,
0.03125,
0.04998779296875,
-0.004726409912109375,
0.006526947021484375,
0.0416259765625,
-0.01187896728515625,
-0.029876708984375,
0.0161285400390625,
-0.01517486572265625,
-0.01158905029296875,
0.0584716796875,
0.01221466064453125,
-0.0121002197265625,
0.058135986328125,
-0.0325927734375,
0.012359619140625,
0.032745361328125,
0.034698486328125,
-0.036651611328125,
0.005939483642578125,
0.0017147064208984375,
-0.0284576416015625,
0.026397705078125,
-0.004779815673828125,
-0.01267242431640625,
-0.01314544677734375,
0.07318115234375,
-0.0020198822021484375,
-0.0010862350463867188,
0.03948974609375,
0.0061798095703125,
-0.0064849853515625,
0.00628662109375,
0.034149169921875,
0.012115478515625,
-0.05731201171875,
0.022918701171875,
0.0389404296875,
0.0141754150390625,
-0.0521240234375,
0.00473785400390625,
-0.0251007080078125,
0.026763916015625,
-0.03387451171875,
0.0284576416015625,
-0.04376220703125,
0.056854248046875,
-0.03460693359375,
-0.006641387939453125,
-0.0028362274169921875,
0.06243896484375,
-0.046295166015625,
0.0116729736328125,
0.0509033203125,
-0.053192138671875,
-0.033966064453125,
-0.0021820068359375,
0.01442718505859375,
0.0306549072265625,
-0.0241546630859375,
0.022979736328125,
-0.04437255859375,
-0.007450103759765625,
-0.0074462890625,
-0.0007162094116210938,
0.08807373046875,
-0.026580810546875,
-0.0259552001953125,
0.01065826416015625,
0.01123046875,
0.01385498046875,
-0.0200958251953125,
0.04248046875,
-0.040374755859375,
0.024383544921875,
0.011474609375,
0.0360107421875,
-0.0154571533203125,
-0.031494140625,
-0.044891357421875,
0.11187744140625,
-0.01313018798828125,
0.00868988037109375,
-0.001983642578125,
0.055450439453125,
-0.01038360595703125,
0.051025390625,
-0.0673828125,
0.0450439453125,
-0.030975341796875,
0.0567626953125,
-0.06024169921875,
0.0050506591796875,
0.0006747245788574219,
0.013092041015625,
0.054779052734375,
0.00717926025390625,
0.0067138671875,
-0.0270233154296875,
0.04400634765625,
0.0697021484375,
0.005985260009765625,
-0.0015153884887695312,
0.032989501953125,
0.04669189453125,
0.051727294921875,
-0.035247802734375,
0.040069580078125,
-0.030242919921875,
0.0118865966796875,
0.047271728515625,
0.016937255859375,
-0.0006613731384277344,
0.00447845458984375,
0.004665374755859375,
-0.03533935546875,
0.002040863037109375,
0.030548095703125,
0.006458282470703125,
-0.030914306640625,
0.0989990234375,
0.044097900390625,
-0.06915283203125,
-0.0308990478515625,
-0.057769775390625,
0.04547119140625,
-0.0036220550537109375,
0.06939697265625,
0.011566162109375,
0.0268096923828125,
0.07373046875,
-0.043487548828125,
0.0290679931640625,
0.02740478515625,
-0.07208251953125,
0.007328033447265625,
-0.01258087158203125,
0.01558685302734375,
-0.049224853515625,
-0.0290069580078125,
0.032745361328125,
0.0200958251953125,
-0.014495849609375,
-0.00177001953125,
0.007221221923828125,
-0.0115966796875,
-0.0254669189453125,
-0.030670166015625,
-0.0195159912109375,
0.050872802734375,
0.0178375244140625,
0.02813720703125,
-0.046844482421875,
-0.0015077590942382812,
0.044921875,
0.025238037109375,
0.0195770263671875,
-0.00801849365234375,
-0.073974609375,
-0.01117706298828125,
-0.004852294921875,
0.0146331787109375,
0.049774169921875,
-0.00826263427734375,
0.04742431640625,
-0.06671142578125,
-0.0066680908203125,
0.0134735107421875,
0.00644683837890625,
0.0345458984375,
-0.02197265625,
0.032562255859375,
0.0206298828125,
0.0211334228515625,
-0.00792694091796875,
-0.008056640625,
0.0121002197265625,
0.032135009765625,
0.030853271484375,
-0.019073486328125,
-0.027008056640625,
0.03717041015625,
-0.02337646484375,
-0.048492431640625,
-0.0143585205078125,
-0.02294921875,
0.029266357421875,
0.003963470458984375,
0.01861572265625,
0.022491455078125,
0.0248260498046875,
-0.002407073974609375,
0.013671875,
0.01177978515625,
0.01267242431640625,
0.0242462158203125,
0.01305389404296875,
-0.010589599609375,
0.031585693359375,
-0.08599853515625,
0.01015472412109375,
-0.00006872415542602539,
-0.12115478515625,
0.0290985107421875,
0.0445556640625,
-0.07080078125,
0.0258026123046875,
0.02862548828125,
-0.0216827392578125,
0.0484619140625,
0.0012149810791015625,
-0.006595611572265625,
0.03387451171875,
0.0360107421875,
0.004116058349609375,
-0.053558349609375,
-0.034088134765625,
-0.0239715576171875,
0.050994873046875,
0.0311126708984375,
0.016815185546875,
0.00484466552734375,
0.047760009765625,
-0.014434814453125,
0.004608154296875,
0.0007162094116210938,
-0.01153564453125,
0.0112762451171875,
0.034271240234375,
0.0228118896484375,
-0.0256500244140625,
-0.0697021484375,
0.033477783203125,
0.0224456787109375,
0.0026187896728515625,
0.04315185546875,
-0.01319122314453125,
0.0007739067077636719,
-0.01934814453125,
0.03668212890625,
-0.018341064453125,
-0.0018644332885742188,
-0.0129241943359375,
-0.041229248046875,
0.0287017822265625,
0.009063720703125,
0.0306549072265625,
0.032470703125,
-0.017486572265625,
-0.04058837890625,
0.0157623291015625,
-0.044036865234375,
0.0278472900390625,
0.04168701171875,
-0.0181121826171875,
-0.0267486572265625,
0.032989501953125,
-0.0142974853515625,
-0.023651123046875,
0.03057861328125,
0.0226593017578125,
0.0198516845703125,
-0.07666015625,
-0.023712158203125,
-0.0202484130859375,
0.0335693359375,
-0.01151275634765625,
0.0102386474609375,
-0.03729248046875,
0.0093841552734375,
0.0008068084716796875,
0.042236328125,
-0.01629638671875,
-0.045623779296875,
-0.01343536376953125,
-0.018646240234375,
-0.0187835693359375,
-0.020843505859375,
0.007251739501953125,
-0.0267333984375,
0.035064697265625,
-0.0078887939453125,
0.01430511474609375,
-0.006755828857421875,
-0.0390625,
-0.0237274169921875,
0.004680633544921875,
-0.0294189453125,
0.0174407958984375,
0.059539794921875,
-0.0171966552734375,
-0.01187896728515625,
-0.03851318359375,
-0.02239990234375,
-0.036468505859375,
0.04925537109375,
0.05621337890625,
-0.0604248046875,
0.021820068359375,
0.041412353515625,
0.062255859375,
0.085205078125,
0.05126953125,
-0.0003314018249511719,
0.043212890625,
-0.004886627197265625,
-0.0362548828125,
-0.0880126953125,
0.01500701904296875,
-0.07977294921875,
0.003875732421875,
-0.005096435546875,
-0.000507354736328125,
0.026397705078125,
-0.0357666015625,
-0.1217041015625,
-0.0014619827270507812,
-0.0307769775390625,
-0.055633544921875,
-0.10888671875,
-0.0206298828125,
0.0026111602783203125,
0.00926971435546875,
-0.041534423828125,
0.00041747093200683594,
-0.07049560546875,
0.056732177734375,
0.0150299072265625,
0.013336181640625,
0.053192138671875,
-0.0071563720703125,
-0.00984954833984375,
0.0029315948486328125,
-0.0001270771026611328,
-0.001842498779296875,
0.03582763671875,
-0.0211029052734375,
0.0302734375,
0.037078857421875,
-0.04144287109375,
0.007122039794921875,
-0.0261383056640625,
-0.024749755859375,
-0.003376007080078125,
-0.0731201171875,
0.002361297607421875,
-0.020294189453125,
0.044921875,
0.0098724365234375,
0.01033782958984375,
-0.0299072265625,
0.0013217926025390625,
-0.0182952880859375,
-0.0215606689453125,
-0.036956787109375,
-0.00974273681640625,
-0.044189453125,
-0.02777099609375,
-0.034881591796875,
0.00969696044921875,
0.0031642913818359375,
-0.0296783447265625,
-0.00830841064453125,
-0.034454345703125,
-0.04010009765625,
-0.0006737709045410156,
-0.0364990234375,
-0.022064208984375,
0.041534423828125,
-0.0281219482421875,
-0.009002685546875,
0.0006747245788574219,
0.01873779296875,
-0.006847381591796875,
0.01007080078125,
-0.00021982192993164062,
-0.03741455078125,
0.0204925537109375,
0.03912353515625,
0.009185791015625,
0.00678253173828125,
0.002044677734375,
-0.0239410400390625,
-0.0241546630859375,
0.0075225830078125,
0.032196044921875,
0.01174163818359375,
-0.0489501953125,
0.01422119140625,
0.0114288330078125,
0.0183563232421875,
0.0012464523315429688,
-0.005184173583984375,
-0.0170440673828125,
0.033721923828125,
-0.011749267578125,
-0.00022363662719726562,
0.0012445449829101562,
-0.005680084228515625,
0.0109405517578125,
-0.006725311279296875,
-0.04541015625,
-0.023040771484375,
-0.024078369140625,
0.00146484375,
-0.01398468017578125,
-0.00327301025390625
] |
fbafc85021dacb84e80cd9a6d766e24df58b1e43
|
Wordpress Stackexchange
Q: Using pre_get_posts with WP_Query I was reading Stephen Harris's excellent answer to this question regarding the use of WP_query(), query_posts() and pre_get_posts.
He says "pre_get_posts is a filter, for altering any query. It is most often used to alter only the 'main query'."
It is possible to use pre_get_posts to filter only a specific secondary query created with WP_Query? eg.
$my_secondary_loop = new WP_Query(...);
if( $my_secondary_loop->have_posts() ):
while( $my_secondary_loop->have_posts() ): $my_secondary_loop->the_post();
//The secondary loop
endwhile;
endif;
wp_reset_postdata();
Any help much appreciated.
A:
pre_get_posts fires for every post query:
*
*get_posts()
*new WP_Query()
*That random recent posts widget your client installed without you knowing.
*Everything
-- @nacin
With that being said unless you exclude your filter use the conditional: is_main_query() then your filter will fire on your new WP_Query.
If you only want to target your specific new WP_Query then there is no way to do that.
|
Q: Using pre_get_posts with WP_Query I was reading Stephen Harris's excellent answer to this question regarding the use of WP_query(), query_posts() and pre_get_posts.
He says "pre_get_posts is a filter, for altering any query. It is most often used to alter only the 'main query'."
It is possible to use pre_get_posts to filter only a specific secondary query created with WP_Query? eg.
$my_secondary_loop = new WP_Query(...);
if( $my_secondary_loop->have_posts() ):
while( $my_secondary_loop->have_posts() ): $my_secondary_loop->the_post();
//The secondary loop
endwhile;
endif;
wp_reset_postdata();
Any help much appreciated.
A:
pre_get_posts fires for every post query:
*
*get_posts()
*new WP_Query()
*That random recent posts widget your client installed without you knowing.
*Everything
-- @nacin
With that being said unless you exclude your filter use the conditional: is_main_query() then your filter will fire on your new WP_Query.
If you only want to target your specific new WP_Query then there is no way to do that.
A: The simplest way is to add the action right before the query and remove it immediately after.
add_action('pre_get_posts', 'some_function_in_functionsphp');
$my_secondary_loop = new WP_Query(...);
remove_action('pre_get_posts', 'some_function_in_functionsphp');
if( $my_secondary_loop->have_posts() ):
while( $my_secondary_loop->have_posts() ): $my_secondary_loop->the_post();
//The secondary loop
endwhile;
endif;
wp_reset_postdata();
EDIT
Another technique you can use is to set your own query var and check for that in a hook:
// tell WordPress about our new query var
function wpse52480_query_vars( $query_vars ){
$query_vars[] = 'my_special_query';
return $query_vars;
}
add_filter( 'query_vars', 'wpse52480_query_vars' );
// check if our query var is set in any query
function wpse52480_pre_get_posts( $query ){
if( isset( $query->query_vars['my_special_query'] ) )
// do special stuff
return $query;
}
add_action( 'pre_get_posts', 'wpse52480_pre_get_posts' );
and in the template:
// set the query var (along with whatever others) to trigger the filter
$args = array(
'my_special_query' => true
);
$my_secondary_loop = new WP_Query( $args );
|
wordpress
|
{
"language": "en",
"length": 289,
"provenance": "stackexchange_00019.jsonl.gz:420060",
"question_score": "26",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52480"
}
|
[
0.08624267578125,
-0.01378631591796875,
0.0265350341796875,
-0.01490020751953125,
0.0277557373046875,
-0.0457763671875,
0.09014892578125,
-0.015960693359375,
0.0012655258178710938,
0.033050537109375,
-0.042449951171875,
0.030670166015625,
-0.029388427734375,
-0.0029544830322265625,
-0.01494598388671875,
-0.03192138671875,
0.0675048828125,
-0.046661376953125,
0.033966064453125,
-0.00457000732421875,
0.01300811767578125,
0.01322174072265625,
0.068115234375,
0.08563232421875,
0.00881195068359375,
-0.01241302490234375,
0.0618896484375,
-0.0030918121337890625,
0.004077911376953125,
-0.014617919921875,
0.0155181884765625,
-0.0277557373046875,
0.00453948974609375,
0.0186309814453125,
-0.012115478515625,
0.0016164779663085938,
-0.00934600830078125,
0.0034732818603515625,
0.00373077392578125,
0.0085601806640625,
0.004718780517578125,
-0.00867462158203125,
-0.061614990234375,
-0.004581451416015625,
-0.042877197265625,
-0.00537109375,
0.0017576217651367188,
-0.0022563934326171875,
0.0257415771484375,
0.0010242462158203125,
0.007213592529296875,
0.005489349365234375,
0.0230712890625,
-0.0233001708984375,
-0.0130157470703125,
0.00013554096221923828,
0.00878143310546875,
-0.005344390869140625,
0.05316162109375,
-0.01279449462890625,
-0.0499267578125,
-0.03778076171875,
0.027557373046875,
-0.04766845703125,
-0.01165771484375,
-0.0032749176025390625,
0.01171112060546875,
-0.0014829635620117188,
-0.004573822021484375,
-0.01155853271484375,
0.022186279296875,
-0.001155853271484375,
0.016357421875,
-0.0355224609375,
-0.0028705596923828125,
-0.006153106689453125,
0.0178070068359375,
0.01107025146484375,
0.005523681640625,
-0.004833221435546875,
0.015533447265625,
-0.043853759765625,
-0.060546875,
-0.0009589195251464844,
-0.004589080810546875,
-0.00986480712890625,
0.004901885986328125,
0.0087432861328125,
-0.01247406005859375,
-0.00597381591796875,
-0.0235748291015625,
-0.035888671875,
0.0007104873657226562,
-0.00004839897155761719,
-0.02880859375,
-0.021331787109375,
0.0285797119140625,
0.0155029296875,
-0.003387451171875,
0.0151214599609375,
-0.039215087890625,
-0.026031494140625,
0.0214996337890625,
-0.006649017333984375,
0.01922607421875,
0.0208740234375,
-0.0156402587890625,
0.045654296875,
0.0755615234375,
0.058563232421875,
0.0225830078125,
0.0400390625,
-0.00518035888671875,
-0.007518768310546875,
-0.06976318359375,
0.01837158203125,
-0.0025634765625,
-0.06658935546875,
0.0022487640380859375,
-0.0189971923828125,
0.01678466796875,
0.0250701904296875,
0.0012273788452148438,
-0.050018310546875,
0.0175628662109375,
-0.00954437255859375,
-0.02606201171875,
-0.0302581787109375,
-0.01727294921875,
0.07025146484375,
-0.015411376953125,
-0.0136260986328125,
0.03997802734375,
0.01708984375,
-0.0020751953125,
-0.046234130859375,
0.0290679931640625,
-0.01377105712890625,
0.011383056640625,
-0.002086639404296875,
0.033782958984375,
-0.033294677734375,
-0.0186920166015625,
0.0234527587890625,
0.0028591156005859375,
0.0309906005859375,
0.0304718017578125,
-0.0030384063720703125,
-0.018280029296875,
-0.0241851806640625,
-0.03729248046875,
0.01500701904296875,
0.004703521728515625,
-0.0014944076538085938,
0.00048089027404785156,
0.01093292236328125,
0.0032024383544921875,
-0.009613037109375,
-0.0088043212890625,
-0.0006437301635742188,
0.02191162109375,
-0.005954742431640625,
0.016937255859375,
0.01165008544921875,
-0.03857421875,
0.0172271728515625,
-0.024749755859375,
-0.01320648193359375,
0.0209808349609375,
0.01047515869140625,
0.07220458984375,
-0.01012420654296875,
0.0258636474609375,
-0.018524169921875,
-0.018768310546875,
-0.03680419921875,
0.0074615478515625,
-0.004261016845703125,
0.033599853515625,
0.028350830078125,
-0.032440185546875,
-0.0307464599609375,
0.040618896484375,
-0.01473236083984375,
-0.0628662109375,
0.060211181640625,
0.00992584228515625,
0.08306884765625,
-0.0014925003051757812,
0.0181121826171875,
0.044464111328125,
0.0235443115234375,
-0.041259765625,
0.046142578125,
-0.015655517578125,
-0.03997802734375,
0.002101898193359375,
0.00045680999755859375,
-0.01052093505859375,
-0.0009937286376953125,
-0.0096435546875,
-0.0017595291137695312,
-0.00991058349609375,
0.0231781005859375,
-0.1055908203125,
0.02734375,
-0.045501708984375,
0.0259552001953125,
-0.01512908935546875,
0.0251312255859375,
0.030731201171875,
0.039947509765625,
-0.05572509765625,
-0.006816864013671875,
-0.0284576416015625,
-0.00946044921875,
-0.0179901123046875,
0.03302001953125,
0.00809478759765625,
-0.003536224365234375,
0.014404296875,
-0.01445770263671875,
0.0003478527069091797,
0.009979248046875,
0.0867919921875,
-0.023956298828125,
0.0026683807373046875,
-0.03741455078125,
0.0732421875,
-0.0123748779296875,
-0.02587890625,
0.035552978515625,
0.0804443359375,
0.05841064453125,
-0.03765869140625,
0.0036411285400390625,
0.0149993896484375,
-0.0107879638671875,
-0.004627227783203125,
0.039398193359375,
0.0303802490234375,
0.020782470703125,
-0.001850128173828125,
-0.0037822723388671875,
0.037078857421875,
-0.066650390625,
0.004154205322265625,
-0.00931549072265625,
0.01352691650390625,
0.03570556640625,
-0.0153961181640625,
-0.028076171875,
0.0237274169921875,
-0.0255889892578125,
0.0124664306640625,
0.0293731689453125,
0.03619384765625,
0.061859130859375,
-0.033355712890625,
-0.0122222900390625,
-0.0010709762573242188,
-0.0192108154296875,
-0.046722412109375,
0.004947662353515625,
0.0002799034118652344,
0.0068817138671875,
0.0257110595703125,
0.0313720703125,
0.028717041015625,
-0.018951416015625,
-0.0101776123046875,
-0.049835205078125,
-0.0147857666015625,
-0.00978851318359375,
-0.019744873046875,
0.051177978515625,
-0.041107177734375,
0.0250244140625,
0.0018720626831054688,
0.005229949951171875,
0.02911376953125,
0.0552978515625,
0.014373779296875,
-0.01849365234375,
0.004222869873046875,
-0.002300262451171875,
0.00783538818359375,
0.01392364501953125,
0.01308441162109375,
-0.00444793701171875,
0.0262451171875,
-0.005001068115234375,
-0.029266357421875,
0.0281982421875,
-0.01219940185546875,
-0.021240234375,
0.0161285400390625,
-0.04150390625,
0.0274505615234375,
-0.024627685546875,
0.0235595703125,
0.053863525390625,
0.0216064453125,
-0.01068878173828125,
0.00021445751190185547,
0.0305938720703125,
-0.006282806396484375,
0.0214996337890625,
0.0014123916625976562,
0.014678955078125,
-0.060333251953125,
0.0232086181640625,
0.02459716796875,
0.061553955078125,
-0.002574920654296875,
-0.0312042236328125,
0.0052947998046875,
0.033355712890625,
0.001331329345703125,
-0.0175018310546875,
0.0009603500366210938,
-0.0101470947265625,
-0.016357421875,
0.0009751319885253906,
-0.001506805419921875,
0.016754150390625,
-0.0156707763671875,
-0.01119232177734375,
0.023406982421875,
-0.002010345458984375,
-0.050506591796875,
-0.01065826416015625,
-0.032806396484375,
0.029296875,
-0.0076446533203125,
-0.002086639404296875,
0.007598876953125,
0.0494384765625,
0.00804901123046875,
-0.062286376953125,
0.005657196044921875,
0.05108642578125,
-0.0286712646484375,
0.013275146484375,
-0.0283203125,
0.0016040802001953125,
0.01035308837890625,
-0.00269317626953125,
0.0147247314453125,
0.0110626220703125,
-0.0159454345703125,
-0.005870819091796875,
0.00606536865234375,
0.0302886962890625,
0.04010009765625,
-0.04986572265625,
-0.041900634765625,
0.045684814453125,
0.0181427001953125,
-0.004638671875,
0.01995849609375,
-0.04254150390625,
-0.03424072265625,
-0.027740478515625,
0.0143890380859375,
0.0228729248046875,
-0.033935546875,
-0.01093292236328125,
0.005710601806640625,
-0.030548095703125,
0.0163116455078125,
-0.035003662109375,
0.041717529296875,
0.01377105712890625,
0.0305328369140625,
-0.01012420654296875,
0.006229400634765625,
-0.0413818359375,
0.045074462890625,
0.02099609375,
0.006122589111328125,
0.0296630859375,
-0.043792724609375,
0.00963592529296875,
0.01432037353515625,
0.0325927734375,
-0.01276397705078125,
0.02410888671875,
-0.0206756591796875,
-0.0258941650390625,
-0.036163330078125,
0.055908203125,
-0.0535888671875,
-0.04010009765625,
0.007640838623046875,
0.031005859375,
-0.00879669189453125,
-0.055877685546875,
0.008056640625,
-0.035797119140625,
-0.049957275390625,
-0.0029964447021484375,
-0.001331329345703125,
-0.044342041015625,
-0.005084991455078125,
-0.00435638427734375,
-0.0284423828125,
-0.0254669189453125,
0.052947998046875,
-0.037628173828125,
0.03173828125,
-0.01027679443359375,
-0.0083770751953125,
-0.0018053054809570312,
-0.037750244140625,
-0.0173492431640625,
-0.043487548828125,
-0.005001068115234375,
0.020538330078125,
0.0207977294921875,
0.0012664794921875,
-0.0129241943359375,
-0.0297088623046875,
0.01045989990234375,
0.06463623046875,
0.013214111328125,
-0.0011081695556640625,
-0.039947509765625,
-0.007015228271484375,
0.004169464111328125,
0.00411224365234375,
-0.03692626953125,
-0.00807952880859375,
-0.0181121826171875,
0.0242767333984375,
-0.0092926025390625,
-0.05560302734375,
-0.02691650390625,
-0.0570068359375,
-0.011199951171875,
-0.0631103515625,
-0.024871826171875,
0.00496673583984375,
-0.0016832351684570312,
-0.024810791015625,
0.00312042236328125,
-0.01119232177734375,
-0.0452880859375,
0.0183563232421875,
0.01531982421875,
0.0060577392578125,
-0.0035552978515625,
0.044952392578125,
0.01496124267578125,
-0.0206756591796875,
0.006855010986328125,
-0.019439697265625,
0.0244140625,
-0.0287628173828125,
0.058746337890625,
0.0235137939453125,
-0.018585205078125,
0.08294677734375,
-0.0171966552734375,
-0.0233612060546875,
-0.0004146099090576172,
0.00815582275390625,
0.00478363037109375,
-0.0168304443359375,
-0.0124664306640625,
-0.0237884521484375,
0.04278564453125,
0.03057861328125,
0.003925323486328125,
-0.0271759033203125,
0.0234222412109375,
0.0518798828125,
-0.005558013916015625,
-0.01312255859375,
-0.05621337890625,
0.008544921875,
-0.0004718303680419922,
0.05035400390625,
0.029541015625,
0.01215362548828125,
0.005390167236328125,
-0.03314208984375,
-0.003021240234375,
-0.0012254714965820312,
-0.005298614501953125,
0.0438232421875,
-0.00447845458984375,
0.06329345703125,
-0.004314422607421875,
-0.004306793212890625,
-0.020904541015625,
-0.006824493408203125,
0.022216796875,
-0.019622802734375,
-0.047149658203125,
0.043975830078125,
-0.020965576171875,
0.0010538101196289062,
0.043365478515625,
-0.015838623046875,
0.0180511474609375,
0.0198974609375,
-0.031768798828125,
-0.0192413330078125,
0.041778564453125,
-0.049652099609375,
-0.04486083984375,
0.0253448486328125,
-0.0028076171875,
0.015625,
0.0276947021484375,
0.06793212890625,
0.0132598876953125,
0.0594482421875,
-0.0457763671875,
0.05963134765625,
0.03955078125,
0.0015859603881835938,
-0.0196990966796875,
0.04193115234375,
0.03973388671875,
-0.0213775634765625,
0.0125885009765625,
-0.01523590087890625,
-0.0281219482421875,
0.00514984130859375,
0.0097198486328125,
-0.002506256103515625,
0.01459503173828125,
0.024261474609375,
0.0129547119140625,
-0.0187530517578125,
0.033203125,
0.076904296875,
0.0241241455078125,
-0.0275421142578125,
-0.025299072265625,
0.024871826171875,
0.032684326171875,
0.0020771026611328125,
0.00528717041015625,
0.00284576416015625,
0.053375244140625,
-0.0450439453125,
0.02838134765625,
0.0014562606811523438,
0.00229644775390625,
-0.001918792724609375,
-0.07623291015625,
-0.02764892578125,
-0.0219573974609375,
0.057769775390625,
-0.0276641845703125,
-0.0249481201171875,
0.0295257568359375,
-0.037078857421875,
0.0232391357421875,
-0.03460693359375,
0.0130615234375,
-0.04736328125,
0.01267242431640625,
0.054229736328125,
0.05352783203125,
-0.042572021484375,
-0.023681640625,
-0.050262451171875,
-0.036102294921875,
-0.033172607421875,
-0.027862548828125,
-0.046539306640625,
0.0273895263671875,
-0.003444671630859375,
0.034820556640625,
0.0093536376953125,
-0.0167083740234375,
-0.02691650390625,
-0.0159759521484375,
0.00728607177734375,
0.047882080078125,
-0.01413726806640625,
0.0789794921875,
-0.01033782958984375,
0.06158447265625,
0.021636962890625,
0.04248046875,
-0.006435394287109375,
-0.036956787109375,
-0.025604248046875,
-0.06475830078125,
-0.0247039794921875,
0.021728515625,
-0.036163330078125,
0.03961181640625,
0.024261474609375,
0.0012302398681640625,
0.0261688232421875,
-0.00984954833984375,
0.0007615089416503906,
-0.005840301513671875,
-0.0011644363403320312,
-0.025787353515625,
-0.00957489013671875,
0.08349609375,
-0.006252288818359375,
0.0003230571746826172,
-0.018646240234375,
-0.0078582763671875,
-0.0029392242431640625,
-0.0101470947265625,
-0.01702880859375,
0.0222320556640625,
-0.02392578125,
0.04443359375,
0.039581298828125,
0.00034618377685546875,
0.03558349609375,
0.002490997314453125,
0.0202484130859375,
0.0169830322265625,
-0.026611328125,
-0.0016050338745117188,
0.03375244140625,
0.048431396484375,
-0.01264190673828125,
-0.00896453857421875,
0.04180908203125,
-0.0228729248046875,
0.0024662017822265625,
0.012908935546875,
0.046661376953125,
-0.0309295654296875,
0.005069732666015625,
0.033782958984375,
-0.0301971435546875,
-0.053924560546875,
0.040130615234375,
-0.023895263671875,
-0.0095367431640625,
0.04437255859375,
-0.016998291015625,
0.0214385986328125,
0.05389404296875,
0.0304107666015625,
-0.015289306640625,
-0.028472900390625,
0.039794921875,
0.0005617141723632812,
-0.004840850830078125,
0.00867462158203125,
0.01727294921875,
-0.017303466796875,
-0.035797119140625,
0.0443115234375,
-0.0261383056640625,
0.0160369873046875,
-0.08642578125,
-0.025146484375,
0.02392578125,
-0.0172882080078125,
0.01467132568359375,
0.0194244384765625,
0.01544189453125,
0.034515380859375,
0.02166748046875,
-0.01513671875,
0.00966644287109375,
-0.02947998046875,
-0.032867431640625,
-0.0052032470703125,
0.049530029296875,
0.03564453125,
-0.061614990234375,
0.033538818359375,
-0.0279388427734375,
-0.0203857421875,
-0.0066375732421875,
-0.0606689453125,
0.0305938720703125,
-0.028167724609375,
0.002849578857421875,
0.00724029541015625,
0.021331787109375,
0.004695892333984375,
0.0078582763671875,
-0.0200347900390625,
-0.02728271484375,
-0.00872039794921875,
-0.0173187255859375,
-0.03515625,
-0.0025691986083984375,
-0.0258636474609375,
-0.04412841796875,
0.060455322265625,
-0.0010986328125,
0.031768798828125,
0.038055419921875,
0.005710601806640625,
-0.0294036865234375,
-0.00965118408203125,
-0.07421875,
0.0687255859375,
0.012725830078125,
0.0985107421875,
-0.0968017578125,
-0.03961181640625,
0.0287322998046875,
0.0477294921875,
0.03448486328125,
0.005466461181640625,
-0.044219970703125,
-0.01092529296875,
0.0594482421875,
0.08734130859375,
0.043121337890625,
0.0219879150390625,
0.0084075927734375,
0.05072021484375,
0.0677490234375,
-0.0276947021484375,
0.026092529296875,
0.028289794921875,
-0.0145721435546875,
0.046142578125,
-0.00016617774963378906,
-0.0005817413330078125,
-0.0090179443359375,
0.045166015625,
-0.041595458984375,
-0.00637054443359375,
0.041473388671875,
-0.016998291015625,
-0.01568603515625,
0.0699462890625,
0.05194091796875,
-0.041290283203125,
-0.005916595458984375,
-0.04132080078125,
0.04736328125,
0.0140533447265625,
0.0380859375,
0.048614501953125,
0.012939453125,
0.0684814453125,
0.03643798828125,
0.02532958984375,
0.025665283203125,
-0.0086517333984375,
0.044708251953125,
0.0020771026611328125,
0.04132080078125,
-0.05950927734375,
0.02056884765625,
0.00896453857421875,
0.052825927734375,
-0.032318115234375,
-0.0266876220703125,
0.007503509521484375,
-0.0269775390625,
-0.01078033447265625,
-0.02471923828125,
-0.0316162109375,
0.0258941650390625,
0.02630615234375,
-0.006290435791015625,
0.0029144287109375,
-0.006778717041015625,
0.01146697998046875,
-0.015167236328125,
-0.007167816162109375,
0.0137176513671875,
0.002460479736328125,
-0.0007872581481933594,
-0.0634765625,
0.00917816162109375,
0.046966552734375,
0.0239410400390625,
0.03887939453125,
-0.031585693359375,
-0.022491455078125,
-0.00392913818359375,
0.00421142578125,
-0.00978851318359375,
0.0259552001953125,
-0.04840087890625,
-0.03204345703125,
-0.006622314453125,
0.0477294921875,
0.049896240234375,
0.013580322265625,
0.054290771484375,
0.01291656494140625,
-0.06292724609375,
0.0162811279296875,
0.0305633544921875,
-0.0215301513671875,
0.031341552734375,
-0.0236053466796875,
-0.01390838623046875,
0.0018949508666992188,
-0.0287628173828125,
-0.02301025390625,
-0.0204010009765625,
0.029632568359375,
0.004375457763671875,
0.0227813720703125,
-0.0014247894287109375,
-0.0037403106689453125,
0.05181884765625,
-0.055389404296875,
0.03265380859375,
-0.0136871337890625,
-0.047271728515625,
0.026824951171875,
-0.064208984375,
-0.04046630859375,
0.0022220611572265625,
0.010955810546875,
-0.0271453857421875,
0.0258026123046875,
-0.00933074951171875,
-0.0074310302734375,
0.014739990234375,
-0.01187896728515625,
0.020416259765625,
0.00978851318359375,
0.01049041748046875,
0.006343841552734375,
-0.03765869140625,
-0.011993408203125,
-0.00406646728515625,
-0.00264739990234375,
0.027984619140625,
-0.003124237060546875,
0.060150146484375,
0.0190887451171875,
0.0016813278198242188,
0.0310211181640625,
-0.03326416015625,
0.005191802978515625,
0.0077972412109375,
-0.0411376953125,
-0.00930023193359375,
0.0018224716186523438,
-0.01062774658203125,
-0.020172119140625,
0.056060791015625,
-0.053985595703125,
0.0213775634765625,
-0.040924072265625,
0.01690673828125,
-0.0634765625,
0.03948974609375,
-0.0193634033203125,
0.03387451171875,
-0.002960205078125,
-0.025146484375,
0.052093505859375,
-0.0135650634765625,
-0.03167724609375,
0.016021728515625,
0.017578125,
-0.023040771484375,
0.033050537109375,
-0.0296173095703125,
0.040252685546875,
0.032806396484375,
-0.0010662078857421875,
0.039886474609375,
0.001094818115234375,
-0.022613525390625,
0.0224151611328125,
0.02081298828125,
-0.015838623046875,
0.0021533966064453125,
0.01300048828125,
-0.01294708251953125,
-0.0251007080078125,
0.04193115234375,
0.003223419189453125,
0.005100250244140625,
-0.041839599609375,
0.01238250732421875,
0.007434844970703125,
-0.01319122314453125,
-0.0307769775390625,
-0.01192474365234375,
-0.034515380859375,
-0.016357421875,
0.00284576416015625,
-0.08538818359375,
-0.003322601318359375,
-0.0243072509765625,
0.059906005859375,
0.0159912109375,
-0.0758056640625,
0.036956787109375,
-0.0106201171875,
0.019439697265625,
0.0009722709655761719,
-0.01029205322265625,
-0.004245758056640625,
-0.015350341796875,
-0.01806640625,
-0.0160064697265625,
-0.033447265625,
0.0174713134765625,
-0.003757476806640625,
-0.007904052734375,
0.011993408203125,
0.0001844167709350586,
-0.02874755859375,
0.0236968994140625,
-0.02655029296875,
0.04632568359375,
-0.023101806640625,
-0.0162811279296875,
0.0309295654296875,
0.00399017333984375,
-0.02032470703125,
-0.07073974609375,
0.00788116455078125,
-0.049102783203125,
0.0238800048828125,
0.00406646728515625,
0.0305328369140625,
0.0501708984375,
-0.01477813720703125,
-0.0865478515625,
0.0718994140625,
-0.0277252197265625,
-0.024017333984375,
-0.0751953125,
0.0167999267578125,
0.0025882720947265625,
-0.0136566162109375,
-0.008544921875,
-0.03179931640625,
-0.04083251953125,
0.014984130859375,
-0.000911712646484375,
0.032012939453125,
0.0292816162109375,
0.01549530029296875,
-0.06341552734375,
-0.0235595703125,
-0.03741455078125,
0.0242156982421875,
-0.005764007568359375,
-0.0034427642822265625,
0.0167236328125,
0.0201568603515625,
-0.03424072265625,
0.0648193359375,
0.01198577880859375,
0.001949310302734375,
0.007965087890625,
0.003398895263671875,
-0.06097412109375,
-0.0167236328125,
0.091552734375,
0.04180908203125,
0.040557861328125,
-0.039337158203125,
0.004638671875,
-0.008544921875,
-0.024383544921875,
-0.0126953125,
0.0179290771484375,
-0.02996826171875,
-0.018951416015625,
-0.02685546875,
-0.0220184326171875,
-0.0003666877746582031,
-0.044708251953125,
-0.047607421875,
-0.005519866943359375,
-0.07073974609375,
0.00469970703125,
-0.00829315185546875,
-0.00643157958984375,
0.001445770263671875,
-0.0169677734375,
-0.0408935546875,
-0.0053253173828125,
0.00493621826171875,
-0.041229248046875,
-0.007465362548828125,
0.0255584716796875,
0.0034580230712890625,
-0.01038360595703125,
-0.033111572265625,
0.03411865234375,
-0.00847625732421875,
0.04913330078125,
-0.0243072509765625,
-0.0242919921875,
0.00746917724609375,
0.00838470458984375,
-0.0253753662109375,
0.0125885009765625,
0.0305938720703125,
0.0197296142578125,
0.051513671875,
0.00992584228515625,
0.08538818359375,
0.01351165771484375,
0.0496826171875,
0.00927734375,
-0.033599853515625,
0.004001617431640625,
-0.00673675537109375,
-0.015106201171875,
-0.01001739501953125,
-0.08636474609375,
-0.0234832763671875,
-0.038665771484375,
0.0281219482421875,
-0.033416748046875,
-0.0038585662841796875
] |
23c5dc2e9e8ab130483257d960644d1ff84a7405
|
Wordpress Stackexchange
Q: Where to find the source code of a widget? i would like to find the source code of the widgets, would you know where to find them? I found the class WP_Widget, but i would like to find, for example, the widget with the last articles.
Thanks
A: The default widgets are defined in wp-includes/default-widgets.php.
To find specific code search the Codex or use queryposts.com. The best tool is your IDE (integrated development environment). All IDEs offer a full text search in a set of files.
Here a screen shot from Eclipse PDT
As you can see it is really flexible – and it's fast too. See also this question for a basic guide on how to work with WordPress in an IDE.
|
Q: Where to find the source code of a widget? i would like to find the source code of the widgets, would you know where to find them? I found the class WP_Widget, but i would like to find, for example, the widget with the last articles.
Thanks
A: The default widgets are defined in wp-includes/default-widgets.php.
To find specific code search the Codex or use queryposts.com. The best tool is your IDE (integrated development environment). All IDEs offer a full text search in a set of files.
Here a screen shot from Eclipse PDT
As you can see it is really flexible – and it's fast too. See also this question for a basic guide on how to work with WordPress in an IDE.
A: Widgets can come from any number of sources: plugins, themes, or the core itself. As such, finding the code for a specific widget could prove troublesome if you do not know it's origin. You could grep for it using bits you know, or grep for all widgets using extends WP_Widget. If you know where it comes from (core, plugin, etc) it's a simple matter of thumbing (or greping, I suppose) through code.
|
wordpress
|
{
"language": "en",
"length": 197,
"provenance": "stackexchange_00019.jsonl.gz:420067",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52518"
}
|
[
-0.0027618408203125,
-0.04351806640625,
0.015045166015625,
0.032684326171875,
-0.051605224609375,
-0.006946563720703125,
0.0257415771484375,
-0.024169921875,
0.04156494140625,
0.038909912109375,
-0.064208984375,
-0.022064208984375,
-0.0171356201171875,
0.00975799560546875,
-0.057830810546875,
-0.054412841796875,
0.046417236328125,
-0.003875732421875,
0.04132080078125,
0.00926971435546875,
-0.0160064697265625,
0.036346435546875,
0.01861572265625,
0.064697265625,
0.00511932373046875,
-0.0147705078125,
0.09539794921875,
-0.039154052734375,
0.00775146484375,
-0.03594970703125,
0.0201263427734375,
0.021942138671875,
0.02557373046875,
-0.0105133056640625,
-0.01171112060546875,
-0.0152740478515625,
-0.0114593505859375,
-0.0086822509765625,
-0.0117340087890625,
0.025970458984375,
0.0231170654296875,
-0.024078369140625,
-0.00753021240234375,
0.0009756088256835938,
-0.0321044921875,
-0.017333984375,
0.01788330078125,
-0.01076507568359375,
0.0257415771484375,
-0.01445770263671875,
-0.0096893310546875,
0.008026123046875,
0.012115478515625,
-0.0606689453125,
-0.002872467041015625,
-0.0008654594421386719,
0.043731689453125,
-0.04852294921875,
0.05810546875,
-0.05523681640625,
-0.06622314453125,
-0.053466796875,
0.05633544921875,
0.0035266876220703125,
-0.042755126953125,
0.006114959716796875,
-0.00566864013671875,
-0.00231170654296875,
0.0167388916015625,
-0.044769287109375,
-0.0024738311767578125,
0.006999969482421875,
0.01335906982421875,
0.01337432861328125,
0.00930023193359375,
-0.0244293212890625,
0.006122589111328125,
-0.0013132095336914062,
0.0222015380859375,
0.0218658447265625,
0.048736572265625,
0.0231170654296875,
-0.014801025390625,
-0.02056884765625,
0.0146331787109375,
-0.0253448486328125,
0.0016241073608398438,
-0.030364990234375,
-0.01180267333984375,
-0.021575927734375,
-0.003936767578125,
0.0165252685546875,
-0.0347900390625,
-0.007537841796875,
-0.00476837158203125,
-0.04339599609375,
-0.00689697265625,
0.045135498046875,
-0.0276641845703125,
0.0249481201171875,
-0.0188446044921875,
-0.00988006591796875,
0.01256561279296875,
-0.04302978515625,
-0.004924774169921875,
0.031280517578125,
-0.0019426345825195312,
-0.00699615478515625,
0.01216888427734375,
0.0294036865234375,
-0.004177093505859375,
-0.04949951171875,
0.00499725341796875,
-0.025177001953125,
-0.01934814453125,
0.020721435546875,
-0.006328582763671875,
0.015533447265625,
0.0225677490234375,
0.0196533203125,
-0.01386260986328125,
0.01143646240234375,
0.055572509765625,
-0.016021728515625,
-0.0148162841796875,
0.008636474609375,
-0.01082611083984375,
-0.0693359375,
0.0190887451171875,
-0.0126190185546875,
-0.0309295654296875,
0.0017137527465820312,
0.02777099609375,
0.04931640625,
0.0310821533203125,
-0.0012264251708984375,
0.0217132568359375,
0.017181396484375,
0.008056640625,
-0.007205963134765625,
-0.0269775390625,
0.005901336669921875,
0.0313720703125,
-0.03338623046875,
0.039306640625,
-0.00495147705078125,
0.040985107421875,
0.0247955322265625,
-0.0019207000732421875,
0.0157318115234375,
-0.013946533203125,
0.056610107421875,
0.03875732421875,
0.016021728515625,
0.014373779296875,
-0.0240478515625,
0.09552001953125,
-0.061279296875,
-0.039154052734375,
-0.0804443359375,
-0.01666259765625,
-0.0242462158203125,
0.005847930908203125,
-0.0200042724609375,
-0.04852294921875,
0.05035400390625,
-0.0125732421875,
-0.0025177001953125,
0.0233917236328125,
-0.01036834716796875,
-0.01073455810546875,
-0.0220184326171875,
0.046905517578125,
0.024566650390625,
0.000013649463653564453,
0.04974365234375,
-0.04327392578125,
-0.03155517578125,
0.0231475830078125,
0.01087188720703125,
-0.0217742919921875,
-0.03662109375,
-0.0156097412109375,
0.02947998046875,
-0.044158935546875,
-0.00789642333984375,
0.0167694091796875,
0.06341552734375,
0.01558685302734375,
0.034393310546875,
0.0150604248046875,
-0.0064697265625,
-0.0277862548828125,
0.030303955078125,
-0.006381988525390625,
-0.00290679931640625,
-0.0250244140625,
0.0178070068359375,
-0.0254669189453125,
-0.0167694091796875,
-0.02166748046875,
0.007198333740234375,
-0.011016845703125,
0.030853271484375,
-0.06585693359375,
0.02349853515625,
-0.0291748046875,
0.03131103515625,
0.03326416015625,
0.0253143310546875,
-0.0033512115478515625,
0.020751953125,
0.006320953369140625,
-0.058197021484375,
-0.051300048828125,
0.0083770751953125,
0.005401611328125,
0.06756591796875,
0.0219268798828125,
0.0498046875,
0.00885009765625,
-0.03131103515625,
0.00933074951171875,
-0.01515960693359375,
0.040679931640625,
0.031585693359375,
-0.0234375,
0.0011758804321289062,
0.047119140625,
0.024139404296875,
-0.022247314453125,
-0.00888824462890625,
-0.0261383056640625,
-0.0010976791381835938,
-0.037384033203125,
-0.017181396484375,
-0.0496826171875,
-0.0096282958984375,
0.01049041748046875,
0.05413818359375,
0.049530029296875,
0.016876220703125,
-0.006664276123046875,
-0.032135009765625,
0.04071044921875,
-0.06756591796875,
0.0031681060791015625,
-0.024169921875,
0.0284423828125,
0.061767578125,
0.001674652099609375,
-0.00566864013671875,
0.01313018798828125,
-0.0244140625,
-0.0107421875,
0.0299530029296875,
-0.01349639892578125,
0.0239105224609375,
-0.0245361328125,
0.006809234619140625,
-0.006404876708984375,
-0.062744140625,
-0.0176239013671875,
-0.042022705078125,
0.0323486328125,
0.029449462890625,
0.05859375,
0.042694091796875,
-0.035430908203125,
0.005451202392578125,
0.0103607177734375,
0.0352783203125,
-0.00614166259765625,
0.01505279541015625,
0.04754638671875,
0.0240631103515625,
-0.023834228515625,
-0.0196075439453125,
-0.00011426210403442383,
0.01812744140625,
-0.002178192138671875,
0.042572021484375,
-0.041015625,
-0.0168914794921875,
-0.0007243156433105469,
-0.027313232421875,
-0.01751708984375,
-0.0048828125,
0.01422119140625,
0.03607177734375,
0.02166748046875,
0.048004150390625,
-0.01074981689453125,
0.05120849609375,
-0.01146697998046875,
0.005931854248046875,
0.054718017578125,
0.01467132568359375,
0.0147705078125,
0.00833892822265625,
0.053375244140625,
0.0477294921875,
-0.0174407958984375,
0.009490966796875,
0.007381439208984375,
0.019561767578125,
0.03668212890625,
-0.00986480712890625,
-0.00811767578125,
0.00981903076171875,
-0.07110595703125,
-0.01849365234375,
0.0196380615234375,
0.0452880859375,
-0.034271240234375,
-0.04827880859375,
-0.032257080078125,
0.0131378173828125,
-0.08441162109375,
-0.06781005859375,
0.00724029541015625,
-0.024749755859375,
-0.038909912109375,
-0.003948211669921875,
-0.010589599609375,
0.0105133056640625,
0.007137298583984375,
-0.00927734375,
-0.005886077880859375,
-0.0268096923828125,
-0.0687255859375,
-0.0516357421875,
-0.07867431640625,
-0.0007128715515136719,
-0.0079193115234375,
0.0307464599609375,
0.006488800048828125,
-0.0019550323486328125,
-0.01444244384765625,
-0.046295166015625,
-0.0322265625,
0.017120361328125,
-0.01064300537109375,
-0.0225982666015625,
-0.0045318603515625,
-0.06390380859375,
0.00867462158203125,
-0.017242431640625,
0.0106048583984375,
-0.0027923583984375,
0.036468505859375,
0.00537872314453125,
0.006282806396484375,
-0.0220794677734375,
0.0030612945556640625,
0.055908203125,
-0.00470733642578125,
-0.035736083984375,
0.032684326171875,
-0.04779052734375,
-0.033233642578125,
0.044647216796875,
-0.003093719482421875,
0.0634765625,
-0.047210693359375,
-0.032440185546875,
0.037353515625,
0.05743408203125,
0.03350830078125,
-0.0067291259765625,
-0.0062255859375,
-0.03106689453125,
0.051116943359375,
0.0187835693359375,
0.032440185546875,
-0.01161956787109375,
0.021331787109375,
-0.04022216796875,
0.006763458251953125,
0.0027828216552734375,
-0.0199127197265625,
0.00977325439453125,
-0.01538848876953125,
0.01055145263671875,
0.00594329833984375,
0.033843994140625,
-0.0036907196044921875,
0.0237884521484375,
0.006961822509765625,
-0.002399444580078125,
0.0038909912109375,
0.03277587890625,
-0.0005125999450683594,
-0.01372528076171875,
-0.006900787353515625,
0.0067596435546875,
-0.046051025390625,
-0.044219970703125,
-0.03363037109375,
-0.00623321533203125,
-0.10711669921875,
0.0311737060546875,
0.0216522216796875,
-0.03985595703125,
0.007053375244140625,
-0.007587432861328125,
-0.04937744140625,
-0.044952392578125,
0.01329803466796875,
-0.043060302734375,
0.029937744140625,
0.01226806640625,
0.02752685546875,
-0.01261138916015625,
0.00414276123046875,
-0.051971435546875,
-0.0643310546875,
0.00815582275390625,
-0.08203125,
0.07415771484375,
0.06610107421875,
-0.053985595703125,
-0.0064849853515625,
0.016845703125,
-0.0135498046875,
-0.0176544189453125,
0.0215301513671875,
0.04339599609375,
-0.006916046142578125,
-0.005886077880859375,
-0.003673553466796875,
-0.036224365234375,
-0.0195770263671875,
-0.0041351318359375,
-0.0401611328125,
0.0294342041015625,
-0.006439208984375,
0.03515625,
0.00884246826171875,
-0.03375244140625,
0.0135040283203125,
-0.04449462890625,
0.0006966590881347656,
0.0211944580078125,
-0.041717529296875,
0.05584716796875,
-0.0297393798828125,
-0.00043082237243652344,
0.03448486328125,
0.0211334228515625,
-0.0131683349609375,
0.0166015625,
0.05450439453125,
0.01346588134765625,
-0.041717529296875,
-0.05645751953125,
-0.0275726318359375,
0.0308837890625,
0.010101318359375,
0.007785797119140625,
0.01232147216796875,
-0.01195526123046875,
0.0271453857421875,
-0.01036834716796875,
0.0104217529296875,
-0.004291534423828125,
0.038909912109375,
0.00608062744140625,
0.003299713134765625,
-0.010955810546875,
0.0003070831298828125,
-0.0276336669921875,
0.01029205322265625,
-0.0121917724609375,
-0.0053863525390625,
0.04559326171875,
0.0241241455078125,
-0.030303955078125,
0.01506805419921875,
-0.01380157470703125,
0.01120758056640625,
-0.0197906494140625,
0.0128173828125,
0.0634765625,
0.034637451171875,
-0.001605987548828125,
0.00203704833984375,
0.0350341796875,
-0.01274871826171875,
0.046600341796875,
0.033233642578125,
0.0167999267578125,
0.016082763671875,
0.038055419921875,
-0.019927978515625,
0.00797271728515625,
-0.00783538818359375,
0.0313720703125,
0.0100555419921875,
-0.038726806640625,
0.0188140869140625,
-0.0048828125,
-0.0230255126953125,
0.033843994140625,
-0.0294342041015625,
0.03460693359375,
0.027099609375,
-0.05078125,
0.004974365234375,
-0.030303955078125,
-0.022613525390625,
-0.05535888671875,
-0.0167694091796875,
-0.0305023193359375,
0.000728607177734375,
-0.00867462158203125,
0.0335693359375,
-0.029937744140625,
0.0220489501953125,
-0.005657196044921875,
0.0360107421875,
0.007564544677734375,
0.03668212890625,
0.01490020751953125,
-0.00921630859375,
0.02386474609375,
-0.0161285400390625,
0.006988525390625,
-0.01265716552734375,
-0.0011386871337890625,
-0.0234375,
0.0138397216796875,
0.00815582275390625,
-0.004505157470703125,
0.0399169921875,
-0.018585205078125,
-0.0096893310546875,
0.01194000244140625,
0.0191497802734375,
0.0104522705078125,
-0.0093231201171875,
-0.04364013671875,
0.0030727386474609375,
0.0174102783203125,
-0.0250701904296875,
0.0440673828125,
-0.02862548828125,
0.00571441650390625,
0.0304412841796875,
-0.0556640625,
0.00803375244140625,
0.010955810546875,
-0.0057525634765625,
-0.01885986328125,
-0.0134429931640625,
-0.051910400390625,
-0.035247802734375,
0.0107574462890625,
0.004558563232421875,
-0.0014324188232421875,
-0.0256500244140625,
0.04315185546875,
-0.01305389404296875,
-0.0211944580078125,
-0.016876220703125,
0.0264129638671875,
0.004810333251953125,
-0.012359619140625,
-0.061737060546875,
-0.00653076171875,
-0.058746337890625,
-0.01352691650390625,
0.005428314208984375,
-0.023681640625,
-0.05621337890625,
-0.01708984375,
0.0118865966796875,
0.0171661376953125,
0.01372528076171875,
0.04083251953125,
0.0004112720489501953,
0.02886962890625,
-0.01056671142578125,
0.04559326171875,
-0.015594482421875,
0.10260009765625,
-0.045989990234375,
0.0986328125,
-0.00255584716796875,
0.035614013671875,
-0.045989990234375,
-0.007785797119140625,
0.049468994140625,
0.0287628173828125,
-0.0264129638671875,
-0.048583984375,
0.00359344482421875,
-0.0782470703125,
0.02764892578125,
-0.0303192138671875,
-0.018707275390625,
-0.01421356201171875,
-0.00974273681640625,
-0.0084381103515625,
0.035614013671875,
0.01727294921875,
-0.0076141357421875,
0.01065826416015625,
-0.033905029296875,
-0.0295562744140625,
-0.003101348876953125,
-0.04150390625,
0.0313720703125,
0.01270294189453125,
-0.01230621337890625,
0.029754638671875,
-0.09515380859375,
0.0762939453125,
0.056488037109375,
0.020294189453125,
0.054840087890625,
0.0037097930908203125,
0.031829833984375,
0.01038360595703125,
-0.00963592529296875,
-0.04937744140625,
-0.00916290283203125,
0.0411376953125,
0.0009403228759765625,
-0.0307769775390625,
0.0206451416015625,
-0.03436279296875,
-0.00426483154296875,
0.0006136894226074219,
0.035980224609375,
-0.00690460205078125,
0.01348876953125,
0.03424072265625,
0.0025177001953125,
-0.01824951171875,
0.0233917236328125,
-0.050018310546875,
-0.1043701171875,
0.0460205078125,
-0.0208282470703125,
0.00688934326171875,
0.00738525390625,
-0.0004658699035644531,
-0.021514892578125,
-0.017303466796875,
0.0248260498046875,
0.025604248046875,
-0.03369140625,
0.033172607421875,
0.0031871795654296875,
0.0162811279296875,
-0.0243988037109375,
0.01348876953125,
0.0054779052734375,
-0.02337646484375,
-0.05706787109375,
0.022613525390625,
-0.003570556640625,
-0.01016998291015625,
-0.01514434814453125,
-0.0164947509765625,
0.08197021484375,
0.06005859375,
-0.0151214599609375,
0.0278167724609375,
0.0110626220703125,
0.050567626953125,
0.0015993118286132812,
-0.0029449462890625,
0.0101470947265625,
0.045074462890625,
-0.03857421875,
0.023834228515625,
-0.016845703125,
0.00357818603515625,
-0.01345062255859375,
-0.01424407958984375,
0.098388671875,
-0.0462646484375,
-0.01287078857421875,
0.003986358642578125,
0.053466796875,
0.009521484375,
-0.01263427734375,
-0.01245880126953125,
-0.03643798828125,
0.0233154296875,
-0.022796630859375,
0.01134490966796875,
0.0287628173828125,
-0.01230621337890625,
-0.0218658447265625,
0.0203094482421875,
0.0165557861328125,
-0.002593994140625,
0.0372314453125,
0.01439666748046875,
-0.022796630859375,
0.01050567626953125,
-0.039306640625,
0.037109375,
-0.0285797119140625,
0.050567626953125,
-0.031494140625,
0.01039886474609375,
0.0121307373046875,
0.007251739501953125,
0.033538818359375,
0.0008215904235839844,
-0.004779815673828125,
0.00008475780487060547,
0.0236358642578125,
0.02679443359375,
-0.0233306884765625,
0.033416748046875,
0.0245513916015625,
-0.004070281982421875,
0.01605224609375,
-0.01418304443359375,
0.03631591796875,
-0.050750732421875,
0.0183563232421875,
0.021392822265625,
0.004474639892578125,
-0.0111236572265625,
0.0108489990234375,
0.01470184326171875,
-0.000461578369140625,
-0.002857208251953125,
0.00910186767578125,
-0.005161285400390625,
-0.020477294921875,
0.0643310546875,
0.035125732421875,
-0.049530029296875,
-0.07147216796875,
-0.018798828125,
0.031951904296875,
0.007965087890625,
0.0243682861328125,
0.039306640625,
0.038055419921875,
0.00823974609375,
-0.0263824462890625,
0.019989013671875,
0.00762939453125,
-0.0343017578125,
0.042999267578125,
0.048858642578125,
0.041595458984375,
-0.0224761962890625,
0.0107574462890625,
0.029632568359375,
0.06915283203125,
-0.038604736328125,
-0.019622802734375,
0.016510009765625,
0.01084136962890625,
-0.0007252693176269531,
-0.01033782958984375,
0.0222320556640625,
-0.0318603515625,
-0.003948211669921875,
-0.0274505615234375,
-0.025665283203125,
0.028961181640625,
0.03533935546875,
-0.017578125,
-0.043792724609375,
0.0118255615234375,
-0.03656005859375,
-0.0126953125,
0.014923095703125,
-0.0199432373046875,
0.00496673583984375,
-0.0006189346313476562,
0.0231781005859375,
-0.0322265625,
0.005947113037109375,
-0.019927978515625,
0.0226593017578125,
-0.03533935546875,
0.0545654296875,
-0.0447998046875,
-0.0305633544921875,
0.010406494140625,
0.03472900390625,
0.0214996337890625,
0.03924560546875,
0.037139892578125,
-0.01276397705078125,
-0.0391845703125,
0.00177764892578125,
0.0136566162109375,
-0.03759765625,
0.0030059814453125,
-0.00868988037109375,
-0.0016736984252929688,
0.026580810546875,
-0.02374267578125,
0.004543304443359375,
-0.011383056640625,
0.077880859375,
-0.0245513916015625,
0.043914794921875,
0.006725311279296875,
0.01065826416015625,
0.041412353515625,
-0.020843505859375,
0.00826263427734375,
-0.006885528564453125,
-0.075927734375,
-0.0131683349609375,
0.006687164306640625,
-0.03399658203125,
-0.0014982223510742188,
0.03399658203125,
-0.03204345703125,
0.00873565673828125,
0.01119232177734375,
0.0164947509765625,
-0.004467010498046875,
-0.035125732421875,
0.027984619140625,
-0.0283050537109375,
0.01103973388671875,
0.00621795654296875,
-0.049774169921875,
-0.0267486572265625,
-0.0247955322265625,
0.042388916015625,
0.061126708984375,
0.0076141357421875,
0.0261383056640625,
0.029388427734375,
-0.04736328125,
-0.036468505859375,
-0.0197601318359375,
-0.03045654296875,
-0.005573272705078125,
-0.01357269287109375,
-0.0215911865234375,
0.006195068359375,
-0.039215087890625,
-0.0006365776062011719,
0.039398193359375,
-0.03009033203125,
0.0027923583984375,
-0.016082763671875,
0.0219573974609375,
-0.0168609619140625,
-0.01050567626953125,
-0.041229248046875,
0.005146026611328125,
0.0095062255859375,
-0.010650634765625,
0.00807952880859375,
-0.0362548828125,
-0.01233673095703125,
-0.040802001953125,
-0.002956390380859375,
-0.05242919921875,
0.00899505615234375,
0.027374267578125,
0.01232147216796875,
0.0284423828125,
-0.021514892578125,
-0.031463623046875,
-0.033111572265625,
-0.024749755859375,
-0.01580810546875,
-0.01273345947265625,
0.0240325927734375,
-0.0261688232421875,
-0.031982421875,
0.019683837890625,
0.038665771484375,
0.0305633544921875,
-0.07025146484375,
0.01366424560546875,
0.04241943359375,
-0.0004734992980957031,
0.0357666015625,
-0.01059722900390625,
-0.01019287109375,
-0.03887939453125,
-0.01175689697265625,
0.025360107421875,
-0.021331787109375,
-0.005016326904296875,
-0.0207061767578125,
-0.006320953369140625,
0.041412353515625,
0.00975799560546875,
-0.01885986328125,
0.00981903076171875,
-0.02423095703125,
0.00409698486328125,
0.01024627685546875,
0.054046630859375,
-0.0117034912109375,
-0.00818634033203125,
-0.04022216796875,
0.01174163818359375,
-0.0025043487548828125,
0.0181121826171875,
0.023040771484375,
0.05548095703125,
0.062744140625,
-0.055267333984375,
0.0264892578125,
0.055145263671875,
0.033905029296875,
0.09295654296875,
0.002838134765625,
0.00849151611328125,
0.05743408203125,
0.010223388671875,
-0.0275421142578125,
-0.08184814453125,
-0.02410888671875,
-0.00635528564453125,
0.0202484130859375,
0.003696441650390625,
-0.03765869140625,
-0.038818359375,
-0.076416015625,
-0.11968994140625,
0.051544189453125,
-0.0117340087890625,
-0.057098388671875,
-0.03271484375,
-0.0074310302734375,
-0.00975799560546875,
-0.00519561767578125,
-0.0168304443359375,
-0.005245208740234375,
-0.02337646484375,
0.028106689453125,
-0.00299835205078125,
0.0246124267578125,
0.00478363037109375,
-0.0234832763671875,
-0.0654296875,
-0.011322021484375,
-0.01337432861328125,
0.01336669921875,
-0.0158538818359375,
-0.017364501953125,
0.0198822021484375,
0.053253173828125,
-0.0328369140625,
-0.04412841796875,
0.00278472900390625,
0.032989501953125,
0.0226287841796875,
-0.022918701171875,
-0.042449951171875,
-0.03729248046875,
0.036529541015625,
0.036590576171875,
0.010406494140625,
-0.0164947509765625,
0.066162109375,
0.051239013671875,
-0.0748291015625,
0.0022945404052734375,
0.0240936279296875,
-0.03594970703125,
-0.038665771484375,
-0.0098876953125,
-0.0302734375,
0.0234527587890625,
-0.0279693603515625,
-0.0257415771484375,
0.019134521484375,
0.007106781005859375,
-0.0044403076171875,
-0.00933074951171875,
-0.004863739013671875,
0.04901123046875,
-0.01451873779296875,
0.06805419921875,
-0.006557464599609375,
0.0251312255859375,
0.06536865234375,
0.039825439453125,
-0.00876617431640625,
-0.0175018310546875,
-0.008514404296875,
0.0109100341796875,
-0.0024547576904296875,
0.0055999755859375,
-0.0015735626220703125,
-0.0096588134765625,
-0.0268402099609375,
0.005283355712890625,
0.019195556640625,
-0.005374908447265625,
-0.016998291015625,
0.012786865234375,
0.0162200927734375,
0.06884765625,
0.00553131103515625,
0.022705078125,
-0.01309967041015625,
0.061492919921875,
-0.0017299652099609375,
-0.0235443115234375,
0.01398468017578125,
-0.030670166015625,
0.0225830078125,
-0.00861358642578125,
0.05242919921875,
-0.023590087890625,
0.0137176513671875,
0.034576416015625,
-0.0015363693237304688,
0.0224609375
] |
535849ec1c2f60aa24c788ccf9a82c8a5c2ab5b9
|
Wordpress Stackexchange
Q: Different fields in My Profile page depending on user role So I understand that I can user current_user_can to check the role of the current logged in user. But what I would like to do is show these different fields to the site Admin.
So for example the contributor role may have different custom fields than the subscriber. Each role would see their relative fields but the Admin would see a whole list of all fields in a contributor profile page and subscriber profile page.
Is there a way to allow the admin to only see certain fields of a user profile page?
I hope this makes sense to you out there!
Thanks in advance.
A: I'll post whole code which have to be in functions.php it's legit WP valid code, how it should be done :)
This should work, of course you have to put your role name in switch.
UPDATED FOR PERFORMANCE:
add_action( 'show_user_profile', 'user_fields_for_admin', 10);
add_action( 'edit_user_profile', 'user_fields_for_admin', 10);
function user_fields_for_admin( $user ){
switch ($user->roles[0]) {
case 'SOME ROLE':
echo '<b>This is the role specific fields</b>';
echo 'fields....';
break;
case 'SOME ANOTHER ROLE':
echo '<b>This is the role specific fields</b>';
echo 'fields....';
break;
}
}
|
Q: Different fields in My Profile page depending on user role So I understand that I can user current_user_can to check the role of the current logged in user. But what I would like to do is show these different fields to the site Admin.
So for example the contributor role may have different custom fields than the subscriber. Each role would see their relative fields but the Admin would see a whole list of all fields in a contributor profile page and subscriber profile page.
Is there a way to allow the admin to only see certain fields of a user profile page?
I hope this makes sense to you out there!
Thanks in advance.
A: I'll post whole code which have to be in functions.php it's legit WP valid code, how it should be done :)
This should work, of course you have to put your role name in switch.
UPDATED FOR PERFORMANCE:
add_action( 'show_user_profile', 'user_fields_for_admin', 10);
add_action( 'edit_user_profile', 'user_fields_for_admin', 10);
function user_fields_for_admin( $user ){
switch ($user->roles[0]) {
case 'SOME ROLE':
echo '<b>This is the role specific fields</b>';
echo 'fields....';
break;
case 'SOME ANOTHER ROLE':
echo '<b>This is the role specific fields</b>';
echo 'fields....';
break;
}
}
|
wordpress
|
{
"language": "en",
"length": 199,
"provenance": "stackexchange_00019.jsonl.gz:420074",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52547"
}
|
[
0.0513916015625,
-0.007083892822265625,
0.007122039794921875,
-0.03973388671875,
-0.00878143310546875,
-0.00582122802734375,
-0.011474609375,
-0.032623291015625,
-0.0247344970703125,
0.0040283203125,
0.007061004638671875,
0.004695892333984375,
-0.046295166015625,
-0.040008544921875,
0.012420654296875,
-0.042266845703125,
-0.002899169921875,
-0.008941650390625,
-0.01009368896484375,
-0.01363372802734375,
0.01033782958984375,
-0.007335662841796875,
-0.029296875,
-0.021148681640625,
0.0255889892578125,
-0.0367431640625,
-0.011260986328125,
-0.017486572265625,
0.03253173828125,
0.007419586181640625,
0.018707275390625,
-0.01318359375,
-0.008209228515625,
0.037139892578125,
0.003398895263671875,
-0.0123291015625,
0.0261383056640625,
0.0159912109375,
0.032867431640625,
0.01493072509765625,
0.0218353271484375,
-0.00150299072265625,
-0.0008749961853027344,
0.0213623046875,
-0.00634765625,
-0.05859375,
0.055328369140625,
-0.00380706787109375,
0.0296478271484375,
0.03961181640625,
0.0107269287109375,
-0.0232696533203125,
-0.0045013427734375,
-0.00667572021484375,
-0.0035266876220703125,
-0.0129547119140625,
-0.0250396728515625,
0.01198577880859375,
0.03485107421875,
0.0125732421875,
-0.01213836669921875,
-0.0199737548828125,
0.01255035400390625,
-0.04443359375,
-0.01174163818359375,
0.015716552734375,
0.00942230224609375,
0.0198516845703125,
-0.02667236328125,
-0.03668212890625,
0.0138702392578125,
-0.0247039794921875,
0.01105499267578125,
-0.022216796875,
-0.053070068359375,
0.01012420654296875,
0.013092041015625,
-0.00922393798828125,
0.007511138916015625,
-0.027435302734375,
-0.028289794921875,
-0.004039764404296875,
-0.0148468017578125,
0.0151214599609375,
-0.0160369873046875,
0.0304412841796875,
-0.0233001708984375,
-0.00948333740234375,
-0.004161834716796875,
0.005718231201171875,
-0.002758026123046875,
-0.0440673828125,
-0.037109375,
0.04150390625,
0.031494140625,
-0.034027099609375,
0.04693603515625,
0.055908203125,
0.00865936279296875,
-0.042572021484375,
0.0258331298828125,
-0.038665771484375,
-0.05731201171875,
-0.0035762786865234375,
0.00962066650390625,
0.0643310546875,
-0.0017518997192382812,
-0.014373779296875,
0.01129913330078125,
0.0098419189453125,
0.01366424560546875,
-0.01494598388671875,
-0.0028667449951171875,
0.003955841064453125,
-0.0205078125,
-0.0021839141845703125,
-0.04620361328125,
0.0099945068359375,
-0.0177459716796875,
0.01172637939453125,
-0.0113067626953125,
-0.0047454833984375,
0.044677734375,
-0.0682373046875,
0.00986480712890625,
-0.0168914794921875,
-0.05401611328125,
-0.0044097900390625,
0.005023956298828125,
0.027557373046875,
-0.037841796875,
-0.0203094482421875,
0.054290771484375,
0.05963134765625,
0.041168212890625,
-0.0268707275390625,
0.01172637939453125,
-0.00550079345703125,
-0.0133209228515625,
0.052398681640625,
-0.040191650390625,
-0.035400390625,
0.0200042724609375,
-0.0272216796875,
-0.04327392578125,
0.0246124267578125,
0.0038471221923828125,
0.003238677978515625,
-0.0020198822021484375,
-0.0235443115234375,
-0.0546875,
-0.01352691650390625,
-0.01122283935546875,
0.030059814453125,
0.057891845703125,
0.0309295654296875,
0.052337646484375,
-0.01114654541015625,
-0.01073455810546875,
0.0025615692138671875,
0.0460205078125,
-0.00278472900390625,
-0.003734588623046875,
-0.052459716796875,
-0.07049560546875,
-0.015960693359375,
-0.05804443359375,
-0.005550384521484375,
0.024169921875,
-0.08538818359375,
0.047821044921875,
-0.01702880859375,
0.044586181640625,
0.0293426513671875,
0.0364990234375,
0.0498046875,
-0.0191802978515625,
0.038604736328125,
0.007354736328125,
-0.039703369140625,
-0.0295562744140625,
-0.055206298828125,
0.01006317138671875,
0.0044097900390625,
-0.045196533203125,
0.035552978515625,
-0.0182037353515625,
-0.0112457275390625,
0.042449951171875,
-0.00560760498046875,
0.0137176513671875,
0.0450439453125,
-0.0019426345825195312,
-0.0233612060546875,
-0.00559234619140625,
-0.01514434814453125,
-0.00827789306640625,
0.001300811767578125,
-0.018402099609375,
0.01885986328125,
0.040679931640625,
-0.0189208984375,
0.00820159912109375,
-0.0182342529296875,
-0.01535797119140625,
-0.0295867919921875,
0.0018892288208007812,
0.01025390625,
-0.006900787353515625,
0.0130615234375,
0.0108642578125,
0.00981903076171875,
-0.014678955078125,
-0.04705810546875,
-0.030853271484375,
0.0035991668701171875,
0.0028820037841796875,
0.0159759521484375,
0.0246124267578125,
-0.008941650390625,
0.03173828125,
-0.03363037109375,
0.01024627685546875,
0.0195159912109375,
0.04461669921875,
0.00360870361328125,
-0.0019702911376953125,
-0.01061248779296875,
0.0838623046875,
0.01131439208984375,
0.031768798828125,
-0.0135040283203125,
0.0171356201171875,
0.021331787109375,
-0.011993408203125,
0.0178680419921875,
0.0321044921875,
-0.04150390625,
0.006237030029296875,
0.0302276611328125,
0.037078857421875,
0.0007123947143554688,
-0.0194549560546875,
-0.0260162353515625,
0.06475830078125,
-0.00701904296875,
0.025726318359375,
-0.032623291015625,
-0.0071258544921875,
0.05242919921875,
-0.024139404296875,
0.03857421875,
0.027557373046875,
-0.039398193359375,
-0.0219268798828125,
0.090576171875,
-0.058013916015625,
-0.013336181640625,
-0.0237274169921875,
0.0024547576904296875,
-0.0016918182373046875,
-0.036041259765625,
0.02008056640625,
-0.03515625,
0.00506591796875,
0.0023746490478515625,
0.015716552734375,
0.0032672882080078125,
-0.017059326171875,
0.0032367706298828125,
0.0214691162109375,
-0.0137786865234375,
0.007007598876953125,
0.0002856254577636719,
-0.01739501953125,
0.002605438232421875,
-0.0220489501953125,
-0.0002397298812866211,
-0.0025234222412109375,
-0.0203857421875,
-0.00550079345703125,
0.015411376953125,
-0.020172119140625,
-0.00753021240234375,
0.0006308555603027344,
-0.037628173828125,
0.0085906982421875,
0.029510498046875,
0.04534912109375,
0.00029540061950683594,
0.02490234375,
-0.00408172607421875,
-0.0221099853515625,
0.060028076171875,
-0.024505615234375,
-0.034149169921875,
-0.03875732421875,
-0.0811767578125,
0.048858642578125,
-0.0653076171875,
0.012969970703125,
0.07598876953125,
0.005970001220703125,
-0.0020427703857421875,
-0.0009756088256835938,
-0.035064697265625,
-0.02667236328125,
0.0310516357421875,
0.0019140243530273438,
-0.0355224609375,
-0.0168609619140625,
0.038909912109375,
0.0230712890625,
0.0131072998046875,
0.0207366943359375,
-0.0189056396484375,
0.0030059814453125,
0.0222320556640625,
-0.0261383056640625,
-0.0253143310546875,
-0.006565093994140625,
-0.09063720703125,
-0.01241302490234375,
0.01316070556640625,
-0.0528564453125,
0.006328582763671875,
0.053314208984375,
0.00489044189453125,
0.0147705078125,
-0.01326751708984375,
-0.059417724609375,
-0.0170440673828125,
-0.0572509765625,
0.052734375,
-0.0205535888671875,
0.0183563232421875,
0.0011377334594726562,
0.037017822265625,
-0.00550079345703125,
-0.040557861328125,
-0.01435089111328125,
0.0065765380859375,
0.002826690673828125,
-0.0012998580932617188,
-0.003704071044921875,
-0.0335693359375,
0.00811004638671875,
0.0126953125,
0.0248260498046875,
-0.0147247314453125,
0.01250457763671875,
-0.0350341796875,
0.01065826416015625,
-0.00652313232421875,
0.0296630859375,
-0.00870513916015625,
-0.031951904296875,
0.02703857421875,
0.035430908203125,
-0.0287322998046875,
0.00009703636169433594,
-0.0107269287109375,
-0.025421142578125,
0.0517578125,
0.0169830322265625,
-0.025970458984375,
0.00948333740234375,
0.00855255126953125,
0.0214385986328125,
0.031402587890625,
-0.053375244140625,
0.0054473876953125,
-0.004383087158203125,
0.024658203125,
0.032135009765625,
0.03594970703125,
-0.0241851806640625,
-0.0204010009765625,
0.0186004638671875,
-0.024871826171875,
0.0184478759765625,
-0.0270233154296875,
0.06500244140625,
-0.00927734375,
-0.06524658203125,
0.020172119140625,
-0.06707763671875,
0.0107879638671875,
-0.051483154296875,
0.0018682479858398438,
-0.013946533203125,
0.0838623046875,
-0.01345062255859375,
-0.00994873046875,
-0.0209503173828125,
0.0128631591796875,
-0.06732177734375,
-0.03424072265625,
-0.051544189453125,
0.01416778564453125,
-0.042449951171875,
-0.0172119140625,
-0.040008544921875,
0.000244140625,
-0.023681640625,
0.032318115234375,
-0.035186767578125,
-0.0430908203125,
0.0193328857421875,
-0.01273345947265625,
-0.02203369140625,
0.0185394287109375,
-0.035247802734375,
-0.00045680999755859375,
0.0031185150146484375,
-0.0288543701171875,
-0.07183837890625,
-0.041229248046875,
0.04315185546875,
0.057464599609375,
-0.01021575927734375,
-0.033843994140625,
0.01232147216796875,
0.0830078125,
0.01102447509765625,
0.0005297660827636719,
-0.00457000732421875,
-0.01043701171875,
0.01241302490234375,
0.016387939453125,
-0.014434814453125,
-0.005695343017578125,
-0.02154541015625,
-0.042205810546875,
0.00891876220703125,
0.01192474365234375,
-0.042388916015625,
0.016998291015625,
-0.039459228515625,
-0.00327301025390625,
-0.02618408203125,
-0.0022182464599609375,
-0.002899169921875,
0.01209259033203125,
-0.026641845703125,
0.0163726806640625,
0.002361297607421875,
-0.03076171875,
0.0005350112915039062,
-0.04229736328125,
-0.0232391357421875,
0.03326416015625,
0.0254669189453125,
0.020538330078125,
0.01525115966796875,
-0.0255279541015625,
0.00696563720703125,
0.0290374755859375,
-0.0246124267578125,
0.082275390625,
0.042694091796875,
-0.02301025390625,
0.07989501953125,
-0.00989532470703125,
0.0174407958984375,
-0.0280609130859375,
0.019195556640625,
-0.01403045654296875,
-0.0267486572265625,
0.01242828369140625,
-0.0263214111328125,
0.02130126953125,
-0.0175323486328125,
-0.0015325546264648438,
-0.0269775390625,
0.018035888671875,
0.04840087890625,
-0.007171630859375,
0.01120758056640625,
-0.037322998046875,
-0.050567626953125,
-0.00411224365234375,
-0.0400390625,
0.04718017578125,
0.04180908203125,
-0.0152435302734375,
0.05767822265625,
0.04974365234375,
-0.01276397705078125,
-0.003582000732421875,
0.0067291259765625,
0.0021343231201171875,
0.0247039794921875,
-0.0236968994140625,
-0.018951416015625,
-0.0231170654296875,
0.00154876708984375,
0.0633544921875,
-0.031982421875,
-0.0709228515625,
0.0179290771484375,
-0.032806396484375,
0.025177001953125,
0.039764404296875,
-0.0010519027709960938,
0.021881103515625,
0.0302581787109375,
0.01222991943359375,
0.0028247833251953125,
0.00974273681640625,
0.01263427734375,
-0.0208740234375,
0.034271240234375,
-0.01251220703125,
0.002651214599609375,
0.00983428955078125,
0.080810546875,
-0.015838623046875,
0.06414794921875,
-0.032806396484375,
0.07965087890625,
0.064453125,
-0.00872802734375,
-0.0086669921875,
0.0386962890625,
-0.00911712646484375,
-0.0213775634765625,
0.0020618438720703125,
0.0076904296875,
0.0266876220703125,
-0.00981903076171875,
-0.0023651123046875,
0.050384521484375,
0.00885009765625,
0.0037136077880859375,
-0.01398468017578125,
0.0063323974609375,
0.0535888671875,
-0.01885986328125,
-0.07427978515625,
-0.03338623046875,
0.0025177001953125,
0.043365478515625,
-0.05023193359375,
-0.00977325439453125,
0.00025534629821777344,
-0.0263214111328125,
-0.003124237060546875,
-0.01500701904296875,
-0.0526123046875,
0.00559234619140625,
0.0218658447265625,
-0.040924072265625,
-0.0200347900390625,
0.01212310791015625,
-0.043701171875,
-0.034027099609375,
0.00490570068359375,
-0.00923919677734375,
0.009490966796875,
0.0037822723388671875,
0.0034999847412109375,
-0.0460205078125,
0.014068603515625,
-0.04339599609375,
-0.01245880126953125,
0.03643798828125,
0.0008015632629394531,
-0.067626953125,
0.0199737548828125,
-0.060882568359375,
-0.005611419677734375,
-0.03350830078125,
-0.04840087890625,
-0.022918701171875,
-0.02178955078125,
0.0197906494140625,
0.00815582275390625,
0.01302337646484375,
-0.015655517578125,
-0.0176544189453125,
0.0174407958984375,
0.032257080078125,
0.00730133056640625,
-0.010711669921875,
0.042877197265625,
-0.0018072128295898438,
0.053466796875,
-0.0146942138671875,
-0.01180267333984375,
-0.0538330078125,
0.006938934326171875,
-0.0124969482421875,
-0.0209808349609375,
-0.0037403106689453125,
0.012054443359375,
-0.0036754608154296875,
0.007709503173828125,
0.041778564453125,
0.002094268798828125,
-0.00722503662109375,
-0.004268646240234375,
0.0060272216796875,
-0.0235595703125,
-0.014129638671875,
-0.0009503364562988281,
-0.0208892822265625,
-0.0117950439453125,
-0.0007314682006835938,
0.004276275634765625,
-0.004730224609375,
-0.039764404296875,
0.024169921875,
0.0280303955078125,
0.019287109375,
-0.010406494140625,
-0.03125,
0.03173828125,
0.051849365234375,
-0.0105743408203125,
0.03204345703125,
0.0323486328125,
0.0203399658203125,
0.0180816650390625,
0.0003705024719238281,
0.0009598731994628906,
0.01544952392578125,
0.027191162109375,
-0.011627197265625,
-0.0005059242248535156,
0.0021877288818359375,
-0.0182952880859375,
0.022430419921875,
0.08636474609375,
0.06475830078125,
-0.12548828125,
0.0260772705078125,
0.000637054443359375,
0.0213470458984375,
0.0693359375,
-0.002803802490234375,
-0.004314422607421875,
-0.0186004638671875,
0.0091094970703125,
0.004486083984375,
-0.0355224609375,
-0.004322052001953125,
-0.01036834716796875,
-0.0303192138671875,
0.0008392333984375,
0.01082611083984375,
0.01361083984375,
0.032684326171875,
-0.023834228515625,
-0.03302001953125,
-0.00923919677734375,
0.0211639404296875,
0.0017290115356445312,
-0.0203857421875,
-0.03533935546875,
-0.047821044921875,
-0.02783203125,
-0.0269012451171875,
-0.0204925537109375,
-0.0007333755493164062,
0.0202484130859375,
0.042205810546875,
0.072021484375,
-0.005580902099609375,
0.004913330078125,
0.054443359375,
-0.0060882568359375,
-0.0614013671875,
-0.046295166015625,
-0.0165863037109375,
0.02587890625,
-0.03204345703125,
0.03338623046875,
-0.00872802734375,
-0.034881591796875,
-0.0247650146484375,
-0.00428009033203125,
0.08355712890625,
-0.000033736228942871094,
-0.036895751953125,
-0.0013856887817382812,
0.034637451171875,
0.002197265625,
0.0222320556640625,
-0.01003265380859375,
-0.0272064208984375,
-0.03076171875,
-0.00567626953125,
-0.059783935546875,
0.0309295654296875,
0.031768798828125,
-0.0816650390625,
0.06402587890625,
0.01073455810546875,
0.054595947265625,
0.00666046142578125,
0.000965118408203125,
-0.0125885009765625,
-0.0246734619140625,
-0.034027099609375,
0.05328369140625,
0.05865478515625,
0.044403076171875,
-0.02642822265625,
-0.01248931884765625,
0.0196380615234375,
0.050445556640625,
0.048736572265625,
0.0225830078125,
-0.036468505859375,
-0.00768280029296875,
0.0134735107421875,
0.0031890869140625,
-0.0225067138671875,
0.0546875,
0.0018682479858398438,
0.0037899017333984375,
0.01323699951171875,
-0.0176239013671875,
0.03125,
-0.034271240234375,
-0.0186767578125,
0.00902557373046875,
0.025604248046875,
0.043548583984375,
0.004932403564453125,
0.05816650390625,
-0.042724609375,
0.004528045654296875,
0.04840087890625,
-0.025115966796875,
0.0278778076171875,
-0.0025806427001953125,
0.050537109375,
-0.00873565673828125,
0.04302978515625,
-0.0157470703125,
0.062408447265625,
0.035888671875,
0.0173492431640625,
0.0270843505859375,
0.0177001953125,
0.0482177734375,
-0.0112152099609375,
0.01311492919921875,
0.027496337890625,
-0.0106353759765625,
0.036956787109375,
0.0179290771484375,
0.00798797607421875,
-0.0200958251953125,
0.0595703125,
0.000244140625,
0.0310211181640625,
-0.0570068359375,
-0.05450439453125,
0.0250091552734375,
0.0096435546875,
-0.0033416748046875,
0.037384033203125,
-0.005832672119140625,
-0.01454925537109375,
0.04876708984375,
-0.051177978515625,
0.01424407958984375,
0.03045654296875,
-0.006381988525390625,
0.0011882781982421875,
0.013916015625,
-0.034576416015625,
0.0244903564453125,
-0.054107666015625,
-0.005733489990234375,
0.0231170654296875,
0.0291595458984375,
0.05316162109375,
0.0037021636962890625,
0.056365966796875,
-0.025299072265625,
-0.005619049072265625,
-0.0026454925537109375,
-0.0225830078125,
-0.00890350341796875,
-0.016510009765625,
-0.0237884521484375,
-0.03192138671875,
0.043853759765625,
-0.01198577880859375,
-0.055755615234375,
-0.031951904296875,
0.021392822265625,
-0.0039520263671875,
-0.0219573974609375,
0.0728759765625,
0.0023097991943359375,
-0.0020084381103515625,
-0.05181884765625,
-0.0063934326171875,
0.026397705078125,
-0.0019683837890625,
0.0297088623046875,
-0.0526123046875,
0.0672607421875,
-0.0300140380859375,
0.04742431640625,
0.0026264190673828125,
-0.00806427001953125,
0.01800537109375,
0.0002906322479248047,
0.03802490234375,
0.0030040740966796875,
-0.10357666015625,
0.01511383056640625,
-0.0828857421875,
-0.08551025390625,
0.049041748046875,
0.052947998046875,
-0.0292510986328125,
0.01666259765625,
0.03436279296875,
-0.004383087158203125,
-0.023040771484375,
-0.004627227783203125,
0.0206756591796875,
-0.01531982421875,
0.0158233642578125,
0.01139068603515625,
-0.0001577138900756836,
0.008270263671875,
0.00295257568359375,
0.0194854736328125,
0.0298614501953125,
0.0367431640625,
-0.007579803466796875,
0.032318115234375,
-0.032440185546875,
0.01061248779296875,
-0.0251617431640625,
-0.050262451171875,
0.08367919921875,
0.01453399658203125,
-0.023040771484375,
-0.013519287109375,
-0.02142333984375,
0.059478759765625,
0.01158905029296875,
-0.0114593505859375,
0.03411865234375,
0.00994873046875,
-0.00525665283203125,
-0.01222991943359375,
-0.00814056396484375,
-0.03094482421875,
-0.0093841552734375,
-0.0227813720703125,
-0.0169830322265625,
0.0195159912109375,
-0.004772186279296875,
0.007495880126953125,
-0.0016717910766601562,
0.0215301513671875,
-0.0390625,
-0.0005922317504882812,
0.0220489501953125,
-0.02728271484375,
0.01708984375,
0.0362548828125,
-0.00653076171875,
0.0247039794921875,
0.004795074462890625,
0.01390838623046875,
0.0264434814453125,
0.02532958984375,
0.0272674560546875,
0.007427215576171875,
-0.0115814208984375,
0.027313232421875,
0.033172607421875,
-0.0416259765625,
0.01158905029296875,
0.052459716796875,
-0.007720947265625,
-0.004871368408203125,
-0.0303192138671875,
-0.02655029296875,
-0.00600433349609375,
0.0018777847290039062,
0.0274658203125,
0.022064208984375,
-0.0413818359375,
-0.050567626953125,
-0.019866943359375,
0.03387451171875,
0.0087738037109375,
-0.04583740234375,
0.0213165283203125,
-0.0130615234375,
0.01276397705078125,
-0.02813720703125,
-0.047760009765625,
0.033538818359375,
0.06341552734375,
-0.0143890380859375,
0.0579833984375,
-0.028289794921875,
-0.08917236328125,
0.00579833984375,
0.02880859375,
0.05224609375,
0.00615692138671875,
-0.025970458984375,
0.0164031982421875,
-0.027130126953125,
0.0640869140625,
-0.043701171875,
-0.0249481201171875,
-0.0181121826171875,
0.020660400390625,
-0.01523590087890625,
-0.02716064453125,
0.039031982421875,
-0.0223846435546875,
-0.0484619140625,
-0.003070831298828125,
0.00994110107421875,
0.020233154296875,
-0.01509857177734375,
-0.0278167724609375,
0.09088134765625,
-0.01512908935546875,
-0.01230621337890625,
-0.03521728515625,
-0.003627777099609375,
-0.0029735565185546875,
0.0081024169921875,
-0.0031414031982421875,
-0.035308837890625,
-0.0290679931640625,
0.0144195556640625,
0.028564453125,
-0.0384521484375,
0.035736083984375,
0.01531982421875,
-0.07586669921875,
0.030548095703125,
0.0194244384765625,
0.0096893310546875,
0.01483917236328125,
-0.004650115966796875,
0.0034942626953125,
0.031280517578125,
-0.032958984375,
-0.0947265625,
-0.0250396728515625,
-0.0194244384765625,
0.004047393798828125,
-0.0019235610961914062,
-0.03143310546875,
-0.02850341796875,
0.023101806640625,
0.06524658203125,
0.0035266876220703125,
0.0017080307006835938,
0.00185394287109375,
-0.01013946533203125,
-0.0258941650390625,
-0.00955963134765625,
0.0146484375,
-0.07574462890625,
-0.016143798828125,
0.0163726806640625,
-0.0264739990234375,
-0.0154571533203125,
0.0283050537109375,
-0.037841796875,
0.00518798828125,
0.037933349609375,
0.003009796142578125,
-0.01806640625,
0.035064697265625,
0.02874755859375,
-0.046356201171875,
-0.045654296875,
0.0041656494140625,
-0.01520538330078125,
-0.0251312255859375,
-0.03173828125,
0.0021953582763671875,
-0.033477783203125,
-0.03363037109375,
0.05126953125,
-0.0221099853515625,
0.055633544921875,
-0.059356689453125,
-0.0298919677734375,
-0.0027008056640625,
0.0264129638671875,
-0.006992340087890625,
0.024322509765625,
-0.0284271240234375,
0.0401611328125,
-0.006870269775390625,
0.06793212890625,
0.0129852294921875,
0.044525146484375,
-0.0179290771484375,
0.06451416015625,
-0.004543304443359375,
-0.0269927978515625,
0.01181793212890625,
-0.0279388427734375,
-0.0150299072265625,
0.0210113525390625,
-0.049591064453125,
-0.0271759033203125,
0.0094757080078125,
0.047149658203125,
0.0026645660400390625,
0.01244354248046875
] |
a5a2a965c8b07a39f1c40798fbcbb6ee0e7a8ec3
|
Wordpress Stackexchange
Q: I'm getting a 404 message when I try to access wpadmin I can't access wp-admin at all after changing wp-config folder permission for hardening my security. The content for the site load find, I cant access wp-admin at all, all I get is 404 message.
A: Delete .htaccess
type in domain.com/wp-login.php
login.
Dashboard -> Settings -> Permalinks -> Save. (just automatically recreates your .htaccess again).
If the problem persists. Try disabling plugins. Enable plugins 1 by 1 until the problem occurs again. That will narrow down the faulty plugin.
|
Q: I'm getting a 404 message when I try to access wpadmin I can't access wp-admin at all after changing wp-config folder permission for hardening my security. The content for the site load find, I cant access wp-admin at all, all I get is 404 message.
A: Delete .htaccess
type in domain.com/wp-login.php
login.
Dashboard -> Settings -> Permalinks -> Save. (just automatically recreates your .htaccess again).
If the problem persists. Try disabling plugins. Enable plugins 1 by 1 until the problem occurs again. That will narrow down the faulty plugin.
A: If ALL you did was to change wp-config.php permissions, look on your folder (or on a fresh WP folder) for wp-config-sample.php, make a copy of it, and fill in the database connection lines again.
Then rename wp-config to wp-config-OLD.php and the copy of wp-config-sample to wp-config.php and you should be fine.
A: Don't delete .htaccess as it may include changes by other plugins like cache creators - at least copy it to .htaccess_bak
It should not be necessary to delete it.
go to yourdomain.com/wp-login.php and login. This should work.
Now rebuild the permalinks: Settings -> Permalinks -> Save
Log out and try again with yourdomain.com/wp-admin
I have to do this every second months, god knows why
A: We had this issue today on a few of our sites & the problem for us was caused by the NGINX caching that we set up on our servers yesterday.
Clearing the NGINX cache resolved this issue for us, hopefully this saves someone else a couple of hours in the future.
|
wordpress
|
{
"language": "en",
"length": 259,
"provenance": "stackexchange_00019.jsonl.gz:420080",
"question_score": "10",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52573"
}
|
[
0.0241851806640625,
-0.004726409912109375,
-0.0235137939453125,
-0.010589599609375,
0.00014650821685791016,
-0.036102294921875,
0.028045654296875,
-0.01052093505859375,
-0.0086517333984375,
0.031463623046875,
-0.0004458427429199219,
-0.0015735626220703125,
0.014373779296875,
-0.0197906494140625,
-0.0186614990234375,
-0.02490234375,
-0.00817108154296875,
-0.007701873779296875,
-0.00830078125,
-0.035675048828125,
0.0233917236328125,
-0.025848388671875,
-0.017425537109375,
-0.034515380859375,
-0.01593017578125,
-0.00783538818359375,
0.06787109375,
-0.039154052734375,
-0.00881195068359375,
-0.039642333984375,
-0.00021636486053466797,
0.0233001708984375,
0.005306243896484375,
0.01041412353515625,
0.017822265625,
-0.01129913330078125,
-0.00409698486328125,
0.00033283233642578125,
0.006561279296875,
0.0189666748046875,
0.03045654296875,
-0.01245880126953125,
0.050872802734375,
0.0438232421875,
0.014068603515625,
-0.0280303955078125,
0.0227203369140625,
-0.06536865234375,
0.012542724609375,
-0.0136566162109375,
0.00982666015625,
0.04229736328125,
0.0295257568359375,
-0.033905029296875,
-0.0208892822265625,
-0.017730712890625,
0.007236480712890625,
0.03338623046875,
0.01082611083984375,
-0.02777099609375,
-0.0256500244140625,
0.0229339599609375,
0.00638580322265625,
0.010040283203125,
-0.00708770751953125,
-0.001911163330078125,
-0.01102447509765625,
0.01922607421875,
-0.021087646484375,
0.003948211669921875,
0.013336181640625,
-0.036895751953125,
-0.0005311965942382812,
-0.030364990234375,
0.02044677734375,
-0.0121307373046875,
-0.00818634033203125,
0.0029964447021484375,
0.01611328125,
0.016815185546875,
0.043670654296875,
-0.036895751953125,
-0.03173828125,
0.006961822509765625,
0.02740478515625,
0.0540771484375,
0.004306793212890625,
-0.034423828125,
0.0279388427734375,
-0.005970001220703125,
0.0006089210510253906,
-0.0241241455078125,
0.024169921875,
0.045623779296875,
-0.0067138671875,
-0.034698486328125,
0.004581451416015625,
0.03607177734375,
-0.01332855224609375,
0.0034847259521484375,
-0.0189971923828125,
-0.01140594482421875,
-0.043243408203125,
-0.01708984375,
-0.006969451904296875,
0.005313873291015625,
0.011505126953125,
0.043701171875,
0.03326416015625,
0.0283203125,
-0.01212310791015625,
0.017333984375,
0.0026073455810546875,
-0.0391845703125,
-0.005382537841796875,
0.035614013671875,
-0.01555633544921875,
0.0003857612609863281,
-0.005672454833984375,
-0.0034351348876953125,
-0.045135498046875,
-0.01509857177734375,
-0.031707763671875,
0.004444122314453125,
-0.00453948974609375,
-0.03704833984375,
0.010711669921875,
0.03277587890625,
0.01451873779296875,
-0.00604248046875,
-0.007656097412109375,
0.012847900390625,
-0.02215576171875,
0.0034027099609375,
-0.00658416748046875,
-0.0077056884765625,
0.0235748291015625,
-0.020721435546875,
0.01419830322265625,
0.0164642333984375,
0.01168060302734375,
-0.0167236328125,
0.0032196044921875,
0.0009493827819824219,
-0.00537109375,
0.0303802490234375,
0.0177459716796875,
0.00252532958984375,
0.007232666015625,
-0.058563232421875,
-0.02606201171875,
0.016632080078125,
0.0141448974609375,
0.04449462890625,
0.0241546630859375,
0.019256591796875,
0.1033935546875,
-0.035919189453125,
-0.059844970703125,
-0.0675048828125,
0.03131103515625,
-0.006168365478515625,
0.01317596435546875,
-0.0123138427734375,
-0.003597259521484375,
-0.015167236328125,
-0.06842041015625,
0.00048232078552246094,
0.019378662109375,
-0.0023097991943359375,
0.01265716552734375,
-0.00823974609375,
-0.0216522216796875,
0.018829345703125,
0.02166748046875,
0.022796630859375,
0.0035266876220703125,
0.0243377685546875,
0.00843048095703125,
0.043365478515625,
0.022796630859375,
-0.02154541015625,
0.033966064453125,
0.00583648681640625,
-0.0251007080078125,
0.0012493133544921875,
0.01041412353515625,
0.0240325927734375,
0.01654052734375,
0.0018091201782226562,
0.018768310546875,
0.02252197265625,
-0.00817108154296875,
0.033782958984375,
-0.025604248046875,
-0.042938232421875,
-0.0182342529296875,
0.006927490234375,
-0.03564453125,
0.004108428955078125,
-0.01427459716796875,
0.0209197998046875,
-0.020538330078125,
0.01065826416015625,
-0.01548004150390625,
-0.000484466552734375,
0.009735107421875,
0.03228759765625,
0.032806396484375,
0.0322265625,
0.003528594970703125,
0.031219482421875,
-0.020416259765625,
-0.05328369140625,
-0.053253173828125,
0.0175628662109375,
-0.032562255859375,
0.0821533203125,
-0.0174713134765625,
0.0693359375,
-0.041351318359375,
-0.07958984375,
-0.01467132568359375,
-0.02020263671875,
0.003093719482421875,
-0.00894927978515625,
-0.018646240234375,
0.00152587890625,
0.04998779296875,
0.006320953369140625,
0.0169525146484375,
0.002857208251953125,
0.010894775390625,
0.0134735107421875,
-0.0362548828125,
-0.0078887939453125,
-0.0318603515625,
-0.0672607421875,
-0.0006346702575683594,
0.046630859375,
0.03778076171875,
0.0179443359375,
-0.038604736328125,
-0.0516357421875,
0.0269775390625,
-0.09442138671875,
-0.017242431640625,
0.0037517547607421875,
0.0038547515869140625,
0.00797271728515625,
-0.0086822509765625,
-0.0250701904296875,
0.03961181640625,
-0.0010118484497070312,
-0.02862548828125,
0.038848876953125,
0.005645751953125,
0.031768798828125,
-0.040191650390625,
0.037200927734375,
-0.015106201171875,
-0.006633758544921875,
-0.004360198974609375,
-0.024383544921875,
-0.0138092041015625,
-0.02484130859375,
0.003650665283203125,
0.0017404556274414062,
0.0023345947265625,
-0.03228759765625,
0.032440185546875,
-0.0213775634765625,
0.0020313262939453125,
0.0211639404296875,
0.04510498046875,
-0.01358795166015625,
-0.038482666015625,
-0.0178985595703125,
0.0413818359375,
0.0190887451171875,
0.0032482147216796875,
0.0396728515625,
-0.009613037109375,
-0.01580810546875,
-0.0105133056640625,
-0.0498046875,
0.0032634735107421875,
0.015228271484375,
0.043548583984375,
0.006313323974609375,
0.028167724609375,
0.01187896728515625,
-0.006542205810546875,
0.04339599609375,
-0.01102447509765625,
-0.0268402099609375,
0.0026416778564453125,
-0.043426513671875,
0.0284881591796875,
-0.020721435546875,
0.0655517578125,
0.07452392578125,
0.01503753662109375,
-0.006175994873046875,
0.0008726119995117188,
-0.023773193359375,
0.0007567405700683594,
0.0141754150390625,
-0.0023174285888671875,
0.0003077983856201172,
-0.05169677734375,
0.028778076171875,
0.032257080078125,
0.0333251953125,
-0.0086669921875,
-0.032135009765625,
-0.01255035400390625,
0.024200439453125,
-0.097412109375,
-0.12091064453125,
-0.0538330078125,
-0.05181884765625,
0.034881591796875,
-0.002094268798828125,
-0.01519775390625,
-0.0011339187622070312,
0.022979736328125,
0.025390625,
0.02813720703125,
-0.024383544921875,
-0.0494384765625,
-0.0183258056640625,
-0.07177734375,
-0.0184173583984375,
-0.01023101806640625,
0.00724029541015625,
0.002452850341796875,
-0.0168304443359375,
-0.02459716796875,
-0.0360107421875,
-0.0175628662109375,
-0.0159912109375,
0.01201629638671875,
-0.0255126953125,
0.00908660888671875,
0.0191497802734375,
-0.0090179443359375,
0.0246429443359375,
0.014556884765625,
-0.00226593017578125,
-0.018646240234375,
-0.06787109375,
-0.017578125,
-0.035125732421875,
0.00018143653869628906,
-0.005832672119140625,
0.014312744140625,
-0.0692138671875,
-0.01071929931640625,
-0.08380126953125,
0.0269622802734375,
-0.034454345703125,
-0.0271759033203125,
0.02532958984375,
0.021148681640625,
-0.032989501953125,
0.0202178955078125,
-0.032867431640625,
0.0181732177734375,
0.0290679931640625,
0.006084442138671875,
-0.0201416015625,
0.0299072265625,
-0.00728607177734375,
-0.004852294921875,
-0.03448486328125,
0.0343017578125,
-0.025726318359375,
-0.034637451171875,
-0.0028476715087890625,
-0.0177001953125,
-0.0033588409423828125,
-0.0312042236328125,
-0.019805908203125,
-0.028106689453125,
0.034393310546875,
-0.053985595703125,
-0.0021514892578125,
-0.046051025390625,
-0.01258087158203125,
-0.03448486328125,
0.051971435546875,
-0.0226287841796875,
-0.0175933837890625,
0.013031005859375,
0.03033447265625,
-0.031463623046875,
-0.05389404296875,
-0.037750244140625,
-0.0237884521484375,
-0.002262115478515625,
0.00296783447265625,
-0.0117034912109375,
-0.0166473388671875,
-0.002475738525390625,
-0.0211181640625,
0.00994110107421875,
-0.02520751953125,
0.035308837890625,
-0.02008056640625,
0.01158905029296875,
0.0106201171875,
0.00167083740234375,
-0.0213775634765625,
-0.020355224609375,
-0.01425933837890625,
-0.09912109375,
-0.0283660888671875,
0.003787994384765625,
0.09149169921875,
0.015411376953125,
-0.03167724609375,
-0.0082855224609375,
0.056854248046875,
-0.012176513671875,
-0.0049591064453125,
-0.00878143310546875,
0.0125579833984375,
-0.0227813720703125,
0.0162200927734375,
-0.00539398193359375,
-0.002349853515625,
-0.02911376953125,
-0.0226287841796875,
-0.0233917236328125,
-0.0196533203125,
-0.01427459716796875,
-0.0284271240234375,
0.0099945068359375,
-0.01239776611328125,
-0.014678955078125,
-0.038604736328125,
-0.056732177734375,
0.01551055908203125,
-0.040313720703125,
0.03558349609375,
-0.047607421875,
-0.037322998046875,
0.036407470703125,
0.00983428955078125,
-0.0006546974182128906,
0.010833740234375,
0.060791015625,
0.006988525390625,
-0.0203857421875,
-0.032012939453125,
-0.01375579833984375,
0.01885986328125,
-0.0074005126953125,
0.06585693359375,
0.052276611328125,
0.00499725341796875,
0.033416748046875,
0.00867462158203125,
-0.011505126953125,
0.0001004338264465332,
0.0097808837890625,
-0.00269317626953125,
-0.038299560546875,
0.034149169921875,
-0.01557159423828125,
0.025299072265625,
0.04498291015625,
0.0223388671875,
-0.0447998046875,
-0.0019817352294921875,
0.0352783203125,
-0.0182952880859375,
0.016815185546875,
0.000720977783203125,
-0.084228515625,
0.02532958984375,
-0.04205322265625,
-0.0166473388671875,
-0.00848388671875,
0.003025054931640625,
0.022735595703125,
0.0191497802734375,
-0.025421142578125,
-0.0186309814453125,
0.0311431884765625,
-0.012298583984375,
0.007419586181640625,
0.032501220703125,
-0.03192138671875,
-0.03399658203125,
-0.0265045166015625,
0.0552978515625,
0.031524658203125,
-0.05859375,
0.0504150390625,
0.01654052734375,
0.002349853515625,
0.033538818359375,
0.006755828857421875,
0.039215087890625,
-0.002468109130859375,
-0.02069091796875,
-0.018707275390625,
0.0101776123046875,
-0.054290771484375,
-0.041961669921875,
0.050628662109375,
-0.0083770751953125,
0.0174560546875,
0.0089874267578125,
0.056121826171875,
0.02020263671875,
0.009246826171875,
-0.006591796875,
-0.0012445449829101562,
-0.0232086181640625,
0.0675048828125,
0.0042724609375,
-0.027923583984375,
0.0235748291015625,
0.012451171875,
0.018218994140625,
-0.064453125,
-0.01995849609375,
0.0271759033203125,
0.06427001953125,
-0.0164642333984375,
-0.0298919677734375,
0.018157958984375,
-0.01471710205078125,
-0.0221710205078125,
0.080810546875,
-0.0239715576171875,
-0.07916259765625,
-0.050201416015625,
0.0110321044921875,
0.05963134765625,
-0.035797119140625,
-0.01727294921875,
0.0272216796875,
-0.0214080810546875,
0.033538818359375,
0.0302581787109375,
-0.0037174224853515625,
-0.0159149169921875,
-0.029388427734375,
0.031402587890625,
-0.04766845703125,
-0.0310516357421875,
-0.042999267578125,
0.035858154296875,
-0.0307159423828125,
0.014892578125,
0.04547119140625,
0.01611328125,
0.019989013671875,
-0.02606201171875,
-0.01255035400390625,
-0.005084991455078125,
0.01006317138671875,
-0.01378631591796875,
-0.044403076171875,
-0.058990478515625,
-0.0129547119140625,
-0.03741455078125,
-0.0087738037109375,
-0.0151824951171875,
-0.0267486572265625,
-0.03369140625,
-0.0011682510375976562,
0.0204315185546875,
0.003444671630859375,
0.019378662109375,
0.003452301025390625,
-0.04095458984375,
0.024261474609375,
0.026397705078125,
0.01522064208984375,
-0.05511474609375,
0.0745849609375,
0.01256561279296875,
0.004062652587890625,
-0.005130767822265625,
0.038238525390625,
0.03521728515625,
-0.0022258758544921875,
0.0256195068359375,
-0.01377105712890625,
-0.0244903564453125,
-0.03851318359375,
0.00882720947265625,
-0.0137176513671875,
0.024261474609375,
-0.01349639892578125,
-0.0014142990112304688,
-0.02679443359375,
-0.0033969879150390625,
-0.0225677490234375,
0.032501220703125,
-0.027435302734375,
0.00043320655822753906,
-0.030029296875,
0.003490447998046875,
0.06085205078125,
-0.025146484375,
-0.043121337890625,
0.01142120361328125,
-0.003322601318359375,
0.00849151611328125,
0.036163330078125,
-0.02734375,
0.05181884765625,
0.079833984375,
0.0270538330078125,
0.06842041015625,
-0.0032291412353515625,
0.03692626953125,
0.0119171142578125,
-0.0030078887939453125,
0.03521728515625,
-0.0367431640625,
0.0142059326171875,
-0.00408172607421875,
-0.0112457275390625,
0.004940032958984375,
-0.03173828125,
0.035125732421875,
0.070068359375,
0.06805419921875,
-0.109619140625,
0.0259857177734375,
0.00927734375,
-0.0132598876953125,
0.042449951171875,
-0.004772186279296875,
-0.0201568603515625,
-0.025665283203125,
0.0145416259765625,
-0.0138702392578125,
-0.01380157470703125,
-0.000885009765625,
0.014923095703125,
-0.046844482421875,
0.0184326171875,
0.032928466796875,
0.031005859375,
0.002017974853515625,
0.004180908203125,
0.008880615234375,
0.01450347900390625,
0.03125,
0.014617919921875,
-0.003871917724609375,
-0.0166015625,
-0.04254150390625,
-0.00853729248046875,
-0.027679443359375,
-0.049957275390625,
0.01340484619140625,
0.021820068359375,
0.0007824897766113281,
0.047210693359375,
-0.0102081298828125,
0.022003173828125,
-0.0018062591552734375,
0.0235137939453125,
0.07452392578125,
-0.0299530029296875,
-0.014892578125,
0.0487060546875,
-0.022247314453125,
-0.006595611572265625,
0.0256195068359375,
0.0005612373352050781,
0.00260162353515625,
-0.04754638671875,
0.059112548828125,
-0.04888916015625,
0.00690460205078125,
0.0220489501953125,
-0.0283203125,
-0.009368896484375,
0.01221466064453125,
-0.0146331787109375,
0.0179290771484375,
0.05426025390625,
-0.0034847259521484375,
0.02777099609375,
0.04193115234375,
0.0285797119140625,
-0.032806396484375,
0.0780029296875,
-0.042877197265625,
0.0081024169921875,
0.055633544921875,
0.015777587890625,
-0.04248046875,
-0.004962921142578125,
-0.0252838134765625,
0.046600341796875,
0.0290374755859375,
0.0199432373046875,
-0.01910400390625,
-0.00748443603515625,
-0.00934600830078125,
0.029083251953125,
0.08062744140625,
0.024139404296875,
-0.0296173095703125,
-0.03607177734375,
0.020477294921875,
0.0270538330078125,
-0.005519866943359375,
0.03521728515625,
-0.00783538818359375,
0.032623291015625,
-0.005462646484375,
-0.049560546875,
0.01500701904296875,
-0.02764892578125,
-0.043182373046875,
0.022247314453125,
0.0006389617919921875,
-0.01422882080078125,
0.0308380126953125,
0.0023403167724609375,
-0.057159423828125,
0.0308380126953125,
0.034820556640625,
-0.02984619140625,
-0.01514434814453125,
0.0264739990234375,
0.01560211181640625,
-0.029571533203125,
0.014739990234375,
-0.04302978515625,
0.04803466796875,
0.01422119140625,
0.017242431640625,
-0.046478271484375,
0.006290435791015625,
-0.02215576171875,
-0.042694091796875,
-0.0160064697265625,
0.048614501953125,
-0.08245849609375,
0.0186767578125,
0.03192138671875,
0.0297698974609375,
-0.0021152496337890625,
0.015045166015625,
0.039581298828125,
0.03466796875,
-0.0325927734375,
-0.06561279296875,
0.004367828369140625,
0.0084991455078125,
0.0274658203125,
0.0308837890625,
0.0223388671875,
0.026519775390625,
0.067138671875,
0.0054473876953125,
0.01013946533203125,
-0.01531982421875,
-0.0178985595703125,
-0.0229949951171875,
0.00872039794921875,
0.027862548828125,
0.048583984375,
-0.00859832763671875,
-0.00011348724365234375,
0.01346588134765625,
0.018829345703125,
-0.0020427703857421875,
0.032196044921875,
-0.0278472900390625,
-0.00214385986328125,
0.0019178390502929688,
0.06610107421875,
-0.013092041015625,
0.006099700927734375,
-0.05841064453125,
-0.0941162109375,
-0.0017881393432617188,
0.049774169921875,
0.0125732421875,
-0.006824493408203125,
0.01384735107421875,
0.0170745849609375,
-0.009735107421875,
-0.004364013671875,
0.01221466064453125,
-0.006649017333984375,
-0.00971221923828125,
-0.021881103515625,
-0.0127410888671875,
-0.00208282470703125,
-0.0173797607421875,
-0.0007872581481933594,
0.01421356201171875,
-0.004150390625,
0.00402069091796875,
0.0134735107421875,
-0.0024585723876953125,
-0.023223876953125,
0.0222320556640625,
-0.024810791015625,
0.002780914306640625,
0.0082855224609375,
-0.06878662109375,
-0.0032596588134765625,
-0.00864410400390625,
-0.052032470703125,
0.007152557373046875,
0.0294952392578125,
-0.011749267578125,
0.006366729736328125,
-0.00001901388168334961,
-0.004940032958984375,
0.0013093948364257812,
-0.016448974609375,
0.01335906982421875,
-0.040191650390625,
0.006603240966796875,
-0.0162353515625,
-0.0309906005859375,
-0.0255126953125,
-0.003170013427734375,
0.03546142578125,
0.00614166259765625,
0.106689453125,
-0.04217529296875,
0.009307861328125,
-0.03887939453125,
0.0004115104675292969,
-0.0122222900390625,
-0.0240020751953125,
0.02001953125,
0.0179290771484375,
-0.019775390625,
-0.0134735107421875,
-0.0897216796875,
0.07196044921875,
0.00830078125,
0.024322509765625,
0.062164306640625,
-0.004024505615234375,
0.01375579833984375,
-0.017181396484375,
-0.01898193359375,
-0.04071044921875,
-0.062164306640625,
-0.05596923828125,
0.0209197998046875,
0.003265380859375,
0.00464630126953125,
-0.02825927734375,
0.03582763671875,
-0.03326416015625,
0.0129547119140625,
-0.004302978515625,
-0.0174713134765625,
-0.023956298828125,
0.0196075439453125,
-0.051483154296875,
-0.0161590576171875,
-0.008453369140625,
-0.01503753662109375,
0.00394439697265625,
-0.01427459716796875,
0.019317626953125,
-0.0022678375244140625,
0.005687713623046875,
-0.04791259765625,
-0.03985595703125,
-0.01305389404296875,
-0.0144500732421875,
-0.00670623779296875,
-0.0284423828125,
-0.00463104248046875,
0.0011186599731445312,
-0.045257568359375,
-0.02874755859375,
-0.0175018310546875,
-0.0215301513671875,
0.0277557373046875,
-0.021392822265625,
-0.0308380126953125,
-0.0545654296875,
0.034027099609375,
0.04681396484375,
0.01030731201171875,
-0.0953369140625,
0.076171875,
-0.041748046875,
0.062103271484375,
0.00046896934509277344,
-0.0088958740234375,
0.0186920166015625,
0.038787841796875,
-0.041168212890625,
-0.00433349609375,
-0.0269927978515625,
-0.01983642578125,
-0.03094482421875,
-0.00684356689453125,
0.021514892578125,
-0.01264190673828125,
0.0207366943359375,
-0.018951416015625,
-0.00879669189453125,
0.02288818359375,
-0.0022335052490234375,
0.0113677978515625,
0.021026611328125,
0.025970458984375,
-0.0303192138671875,
-0.07598876953125,
-0.0158538818359375,
-0.0037479400634765625,
0.001049041748046875,
-0.025238037109375,
-0.0186767578125,
-0.034027099609375,
-0.05999755859375,
-0.032073974609375,
0.0161895751953125,
0.0209808349609375,
-0.0209197998046875,
-0.059722900390625,
-0.00911712646484375,
-0.00109100341796875,
0.0163421630859375,
-0.020416259765625,
-0.01035308837890625,
-0.053955078125,
0.0251617431640625,
0.0207366943359375,
-0.03326416015625,
0.0223236083984375,
0.03912353515625,
-0.04718017578125,
0.04705810546875,
0.04449462890625,
-0.014190673828125,
0.02667236328125,
-0.025238037109375,
0.05755615234375,
0.081298828125,
-0.01055908203125,
-0.024871826171875,
0.0003879070281982422,
-0.07861328125,
0.0031871795654296875,
-0.0305023193359375,
-0.0014028549194335938,
-0.0167236328125,
0.00634765625,
0.020263671875,
-0.0005121231079101562,
-0.005706787109375,
-0.050750732421875,
-0.06475830078125,
-0.03363037109375,
-0.0252532958984375,
0.039154052734375,
-0.09747314453125,
0.020416259765625,
0.03277587890625,
-0.003631591796875,
0.0018854141235351562,
-0.0013093948364257812,
-0.0269927978515625,
0.0025348663330078125,
0.004138946533203125,
-0.007541656494140625,
-0.0300750732421875,
-0.048736572265625,
0.1131591796875,
-0.06695556640625,
-0.006839752197265625,
0.00881195068359375,
0.047515869140625,
0.033966064453125,
-0.045989990234375,
-0.00954437255859375,
0.01195526123046875,
-0.022125244140625,
0.021331787109375,
0.00656890869140625,
0.01073455810546875,
-0.042724609375,
-0.001918792724609375,
0.00426483154296875,
0.00783538818359375,
0.0120086669921875,
0.0201263427734375,
-0.012115478515625,
0.003086090087890625,
-0.0189208984375,
-0.004581451416015625,
0.01116943359375,
0.041107177734375,
0.0006775856018066406,
0.05548095703125,
-0.0057220458984375,
-0.04400634765625,
0.003139495849609375,
-0.04315185546875,
-0.0109405517578125,
0.058837890625,
0.0184783935546875,
-0.061737060546875,
0.044586181640625,
0.0106048583984375,
0.06536865234375,
0.01409912109375
] |
e49ec904f00b808ba8575aacc06502b82e90364b
|
Wordpress Stackexchange
Q: Hide Twenty Eleven Theme From Themes Page Is there a way to hide the Twenty Eleven theme from the "Themes" page in wordpress? I have 10 themes for clients to choose from and i don't want them to be able to see the Twenty Eleven theme or be able to accidentally activate it. All of the other themes are children themes of twenty eleven, so deleting it isn't an option. Any ideas? Thanks!
A: I'm no expert but I don't know of any php way to do it ... This is a long shot which you'd need to try out, but could you use css or jquery to target the first child or nth child of #availablethemes in the admin css and set it to display:none. I don't know how wordpress sets the order of the themes so that's why I'm saying you'd need to experiment, but it might be your only option, unless someone knows of a more elegant way.
|
Q: Hide Twenty Eleven Theme From Themes Page Is there a way to hide the Twenty Eleven theme from the "Themes" page in wordpress? I have 10 themes for clients to choose from and i don't want them to be able to see the Twenty Eleven theme or be able to accidentally activate it. All of the other themes are children themes of twenty eleven, so deleting it isn't an option. Any ideas? Thanks!
A: I'm no expert but I don't know of any php way to do it ... This is a long shot which you'd need to try out, but could you use css or jquery to target the first child or nth child of #availablethemes in the admin css and set it to display:none. I don't know how wordpress sets the order of the themes so that's why I'm saying you'd need to experiment, but it might be your only option, unless someone knows of a more elegant way.
|
wordpress
|
{
"language": "en",
"length": 162,
"provenance": "stackexchange_00019.jsonl.gz:420082",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52579"
}
|
[
0.04827880859375,
0.00337982177734375,
0.0248870849609375,
0.0007648468017578125,
0.00478363037109375,
-0.024627685546875,
0.04241943359375,
-0.059539794921875,
-0.01064300537109375,
-0.0240325927734375,
0.005474090576171875,
-0.039886474609375,
-0.042816162109375,
-0.05157470703125,
0.0189208984375,
-0.0762939453125,
0.001659393310546875,
0.01212310791015625,
0.015045166015625,
-0.0005669593811035156,
-0.001140594482421875,
-0.011260986328125,
0.003986358642578125,
-0.009521484375,
0.069091796875,
-0.05816650390625,
0.0665283203125,
0.0022449493408203125,
0.05499267578125,
-0.00862884521484375,
0.047882080078125,
-0.03717041015625,
0.00872039794921875,
0.034423828125,
-0.0119171142578125,
0.0185089111328125,
-0.0236663818359375,
0.020782470703125,
0.006786346435546875,
0.0013685226440429688,
0.018585205078125,
-0.00771331787109375,
0.032562255859375,
-0.00885772705078125,
0.008575439453125,
-0.031707763671875,
0.0155181884765625,
-0.0567626953125,
-0.0014982223510742188,
-0.0103912353515625,
0.04132080078125,
0.01488494873046875,
0.08038330078125,
-0.050201416015625,
-0.0303497314453125,
-0.017364501953125,
-0.0226898193359375,
0.040252685546875,
0.036224365234375,
-0.00363922119140625,
-0.0278778076171875,
-0.0185394287109375,
0.003475189208984375,
-0.0323486328125,
0.0040283203125,
0.0228729248046875,
0.005306243896484375,
0.017730712890625,
-0.0970458984375,
0.0059356689453125,
0.06256103515625,
-0.07135009765625,
0.00792694091796875,
-0.03240966796875,
-0.009765625,
-0.005889892578125,
-0.01165771484375,
-0.0213775634765625,
0.039276123046875,
-0.0174102783203125,
0.027557373046875,
-0.026153564453125,
-0.05548095703125,
-0.00138092041015625,
0.003932952880859375,
0.01236724853515625,
-0.0010662078857421875,
-0.013641357421875,
-0.0166168212890625,
0.022857666015625,
-0.0205841064453125,
0.01407623291015625,
-0.0238494873046875,
0.0232696533203125,
-0.00197601318359375,
0.020233154296875,
0.040313720703125,
0.029571533203125,
0.019744873046875,
-0.03497314453125,
0.00943756103515625,
-0.06158447265625,
-0.033477783203125,
0.0036907196044921875,
-0.0423583984375,
0.0232391357421875,
0.04974365234375,
0.05029296875,
-0.007843017578125,
0.01288604736328125,
-0.006649017333984375,
0.012481689453125,
0.0130615234375,
-0.038482666015625,
-0.032073974609375,
-0.0014934539794921875,
-0.015106201171875,
0.007110595703125,
0.03424072265625,
0.001552581787109375,
-0.0018110275268554688,
0.0162811279296875,
-0.030059814453125,
0.0335693359375,
-0.0141143798828125,
-0.01495361328125,
-0.0227203369140625,
0.018890380859375,
0.022430419921875,
0.0188446044921875,
-0.06689453125,
-0.003528594970703125,
0.070068359375,
0.027862548828125,
0.027984619140625,
-0.033111572265625,
0.00301361083984375,
0.039825439453125,
0.01508331298828125,
-0.001766204833984375,
0.026458740234375,
-0.047882080078125,
-0.00965118408203125,
0.038970947265625,
-0.021484375,
0.0202178955078125,
0.0162200927734375,
0.018402099609375,
-0.007038116455078125,
-0.022735595703125,
-0.004024505615234375,
-0.03765869140625,
0.04498291015625,
0.01273345947265625,
-0.0031299591064453125,
0.01381683349609375,
0.064697265625,
-0.034637451171875,
-0.044097900390625,
-0.04595947265625,
-0.006771087646484375,
-0.001220703125,
0.03375244140625,
-0.00435638427734375,
-0.0244903564453125,
0.02020263671875,
-0.0110626220703125,
-0.021636962890625,
0.0240325927734375,
0.01119232177734375,
0.008453369140625,
-0.034088134765625,
-0.005641937255859375,
0.022125244140625,
0.0025081634521484375,
0.053314208984375,
0.0235595703125,
0.00711822509765625,
0.027923583984375,
0.03082275390625,
0.0117645263671875,
-0.0233917236328125,
0.049591064453125,
-0.0037479400634765625,
-0.0782470703125,
0.058746337890625,
0.022216796875,
0.055267333984375,
-0.0031375885009765625,
0.00072479248046875,
0.07861328125,
0.047088623046875,
-0.019439697265625,
0.0090484619140625,
-0.00194549560546875,
-0.00835418701171875,
-0.01009368896484375,
0.01050567626953125,
-0.01259613037109375,
0.007228851318359375,
-0.035614013671875,
0.0292205810546875,
-0.002765655517578125,
0.0041961669921875,
-0.0149993896484375,
0.0069122314453125,
-0.018707275390625,
0.047637939453125,
0.0010938644409179688,
0.035064697265625,
-0.0108489990234375,
-0.0028934478759765625,
-0.01177215576171875,
-0.0215911865234375,
-0.002323150634765625,
0.00008207559585571289,
-0.007518768310546875,
0.06817626953125,
-0.01194000244140625,
0.0364990234375,
0.0222015380859375,
-0.03582763671875,
0.03668212890625,
0.0386962890625,
0.047027587890625,
-0.0206146240234375,
-0.023101806640625,
-0.032958984375,
0.04193115234375,
-0.0204010009765625,
0.007282257080078125,
0.07757568359375,
-0.006954193115234375,
-0.0103302001953125,
-0.033203125,
0.01255035400390625,
0.0008530616760253906,
-0.038818359375,
-0.005062103271484375,
0.035552978515625,
0.03912353515625,
0.0240325927734375,
-0.0006132125854492188,
0.01290130615234375,
0.05316162109375,
-0.06793212890625,
-0.00414276123046875,
-0.0021381378173828125,
0.0095672607421875,
-0.01045989990234375,
0.01242828369140625,
-0.008087158203125,
0.03741455078125,
-0.02056884765625,
0.0196533203125,
0.032257080078125,
0.0189666748046875,
-0.0005106925964355469,
0.0262908935546875,
-0.0220489501953125,
0.016876220703125,
0.0034351348876953125,
-0.044921875,
0.011871337890625,
0.0623779296875,
-0.0185699462890625,
0.032958984375,
0.022857666015625,
0.01178741455078125,
-0.0323486328125,
0.000591278076171875,
-0.0170440673828125,
0.0038013458251953125,
0.01001739501953125,
-0.00623321533203125,
0.0216217041015625,
-0.0479736328125,
0.01715087890625,
-0.005512237548828125,
0.007350921630859375,
-0.0017337799072265625,
-0.0015058517456054688,
-0.03607177734375,
-0.0036296844482421875,
0.0218963623046875,
-0.0024776458740234375,
0.0000972747802734375,
0.036224365234375,
0.0187530517578125,
0.005924224853515625,
0.0173492431640625,
0.0291900634765625,
-0.02911376953125,
0.044586181640625,
-0.027587890625,
-0.0036716461181640625,
-0.002960205078125,
-0.047637939453125,
0.0638427734375,
-0.042877197265625,
0.0028285980224609375,
0.0673828125,
0.0032176971435546875,
0.007320404052734375,
0.015106201171875,
0.01153564453125,
0.011016845703125,
0.0419921875,
0.029388427734375,
0.01568603515625,
-0.047088623046875,
-0.02020263671875,
0.0321044921875,
-0.004589080810546875,
0.02435302734375,
-0.01432037353515625,
0.004184722900390625,
0.0298309326171875,
-0.04559326171875,
-0.035369873046875,
0.01580810546875,
-0.027435302734375,
-0.0169677734375,
-0.0179443359375,
-0.018463134765625,
-0.011566162109375,
-0.00574493408203125,
-0.011474609375,
0.005069732666015625,
-0.044281005859375,
-0.0098419189453125,
-0.039642333984375,
-0.0268096923828125,
0.00971221923828125,
0.003143310546875,
-0.01189422607421875,
0.00492095947265625,
0.07586669921875,
0.007030487060546875,
-0.06207275390625,
-0.01180267333984375,
0.0584716796875,
-0.004566192626953125,
0.01580810546875,
0.01375579833984375,
-0.015167236328125,
-0.0057220458984375,
0.0164337158203125,
-0.0294036865234375,
-0.02001953125,
0.00939178466796875,
-0.0439453125,
-0.025238037109375,
0.007343292236328125,
0.0043487548828125,
0.033111572265625,
0.0306854248046875,
0.0048370361328125,
0.0262603759765625,
-0.023895263671875,
-0.047882080078125,
-0.0107879638671875,
-0.05926513671875,
0.019287109375,
0.04083251953125,
-0.003932952880859375,
-0.014190673828125,
0.005290985107421875,
0.0258941650390625,
-0.0138397216796875,
0.01398468017578125,
-0.040435791015625,
0.06158447265625,
0.024383544921875,
0.052825927734375,
-0.03997802734375,
0.0141754150390625,
-0.0126953125,
0.0092010498046875,
-0.00949859619140625,
0.0087890625,
-0.0181884765625,
0.026763916015625,
-0.038543701171875,
-0.043731689453125,
0.04681396484375,
-0.01181793212890625,
0.0099639892578125,
-0.038177490234375,
-0.01015472412109375,
-0.01335906982421875,
0.0816650390625,
-0.054656982421875,
-0.0180816650390625,
0.0006933212280273438,
0.0293731689453125,
-0.0216827392578125,
-0.0184326171875,
-0.02197265625,
-0.0146636962890625,
-0.1497802734375,
0.031463623046875,
0.00014674663543701172,
-0.0416259765625,
-0.03680419921875,
0.01309967041015625,
-0.11016845703125,
-0.051239013671875,
0.041473388671875,
0.0211181640625,
-0.01300048828125,
0.01197052001953125,
-0.0000029802322387695312,
-0.03692626953125,
-0.022674560546875,
0.006725311279296875,
-0.07177734375,
-0.0142822265625,
-0.0019989013671875,
0.04833984375,
0.011688232421875,
-0.04180908203125,
0.0030117034912109375,
0.054534912109375,
-0.00531005859375,
0.028778076171875,
-0.0246429443359375,
0.0018510818481445312,
0.010650634765625,
0.0178680419921875,
-0.010345458984375,
-0.0028896331787109375,
-0.0174407958984375,
0.030120849609375,
-0.025848388671875,
0.03436279296875,
-0.01328277587890625,
-0.08355712890625,
0.0574951171875,
-0.043304443359375,
0.014312744140625,
-0.0328369140625,
-0.03228759765625,
-0.012908935546875,
-0.0273284912109375,
0.006622314453125,
-0.0260467529296875,
0.0185699462890625,
0.012298583984375,
0.01275634765625,
-0.03387451171875,
0.0225830078125,
0.054718017578125,
0.01544952392578125,
-0.02813720703125,
-0.087646484375,
-0.01451873779296875,
0.045135498046875,
0.041473388671875,
0.009796142578125,
-0.005786895751953125,
-0.033050537109375,
0.0615234375,
0.032989501953125,
-0.00518035888671875,
0.01367950439453125,
0.050323486328125,
0.0139617919921875,
-0.02459716796875,
0.00992584228515625,
-0.001026153564453125,
-0.0017709732055664062,
0.016326904296875,
-0.0014677047729492188,
-0.0238494873046875,
-0.0093994140625,
0.050994873046875,
0.01140594482421875,
-0.007801055908203125,
-0.056884765625,
-0.00019657611846923828,
-0.00934600830078125,
0.0089111328125,
0.04364013671875,
0.0224151611328125,
0.0166015625,
0.0131988525390625,
0.0267333984375,
0.0129547119140625,
-0.0088653564453125,
0.027923583984375,
-0.0394287109375,
0.044647216796875,
0.01070404052734375,
-0.00484466552734375,
-0.01654052734375,
-0.011566162109375,
0.06072998046875,
0.024322509765625,
-0.043426513671875,
-0.0162811279296875,
-0.004520416259765625,
0.07757568359375,
-0.00862884521484375,
-0.0264129638671875,
0.00977325439453125,
0.023468017578125,
0.021728515625,
0.00019109249114990234,
-0.01416778564453125,
0.0229034423828125,
-0.0272216796875,
0.000030338764190673828,
0.01285552978515625,
-0.0240478515625,
0.07440185546875,
0.01476287841796875,
0.0164031982421875,
0.042816162109375,
-0.0325927734375,
-0.004482269287109375,
-0.042694091796875,
0.01538848876953125,
-0.0018243789672851562,
0.012725830078125,
0.057769775390625,
-0.04876708984375,
0.049591064453125,
0.005374908447265625,
-0.005573272705078125,
0.015869140625,
0.0008406639099121094,
0.0201873779296875,
0.024078369140625,
0.007617950439453125,
0.0235595703125,
-0.00682830810546875,
0.0124053955078125,
-0.00881195068359375,
-0.037078857421875,
-0.0014019012451171875,
0.0101165771484375,
-0.00699615478515625,
-0.005336761474609375,
-0.0263214111328125,
-0.012115478515625,
-0.048187255859375,
-0.0277252197265625,
0.036346435546875,
-0.08123779296875,
0.0263519287109375,
0.032470703125,
-0.043304443359375,
-0.0093231201171875,
-0.0131988525390625,
-0.0714111328125,
-0.05926513671875,
0.009246826171875,
0.0057830810546875,
0.005695343017578125,
0.002079010009765625,
0.04754638671875,
-0.016510009765625,
-0.0452880859375,
0.0119781494140625,
-0.004108428955078125,
0.04168701171875,
0.008880615234375,
-0.072998046875,
0.0212554931640625,
-0.03509521484375,
0.003932952880859375,
-0.035400390625,
-0.0806884765625,
-0.0215606689453125,
-0.00833892822265625,
0.00983428955078125,
0.0206146240234375,
-0.0307464599609375,
-0.0462646484375,
-0.0218963623046875,
0.03985595703125,
0.03765869140625,
0.06170654296875,
-0.02117919921875,
0.045074462890625,
0.00426483154296875,
-0.011505126953125,
0.00907135009765625,
0.0018711090087890625,
-0.01605224609375,
0.0005412101745605469,
0.0017347335815429688,
-0.0089111328125,
0.0238800048828125,
0.029449462890625,
-0.020843505859375,
-0.06658935546875,
0.0009183883666992188,
-0.0081329345703125,
0.0152130126953125,
-0.0016012191772460938,
0.01258087158203125,
-0.04095458984375,
0.00804901123046875,
-0.03448486328125,
-0.0083160400390625,
-0.0250396728515625,
-0.0233612060546875,
-0.005428314208984375,
-0.0037994384765625,
-0.03070068359375,
0.010101318359375,
-0.0003979206085205078,
-0.0020771026611328125,
0.039276123046875,
-0.0709228515625,
0.0880126953125,
0.0687255859375,
-0.0082550048828125,
0.033416748046875,
-0.0012598037719726562,
-0.00007456541061401367,
0.0095672607421875,
0.00911712646484375,
-0.03179931640625,
-0.00798797607421875,
0.038787841796875,
0.01432037353515625,
-0.0140838623046875,
0.035888671875,
-0.0079345703125,
-0.0255889892578125,
0.07672119140625,
0.033416748046875,
-0.09844970703125,
-0.032012939453125,
-0.01087188720703125,
-0.0030612945556640625,
-0.04864501953125,
-0.006526947021484375,
-0.026153564453125,
-0.06793212890625,
-0.000133514404296875,
-0.0082244873046875,
-0.01520538330078125,
-0.0106201171875,
-0.0003879070281982422,
-0.0158233642578125,
-0.024566650390625,
0.00604248046875,
0.0057373046875,
-0.0386962890625,
0.023284912109375,
0.0180816650390625,
0.0032196044921875,
-0.0151214599609375,
0.0095062255859375,
0.022003173828125,
-0.0288238525390625,
-0.04998779296875,
0.01296234130859375,
-0.00315093994140625,
-0.0250091552734375,
0.032135009765625,
0.0192718505859375,
0.026458740234375,
0.0682373046875,
-0.0180816650390625,
0.0185089111328125,
0.0292510986328125,
0.01522064208984375,
0.0174713134765625,
0.0146484375,
0.0127716064453125,
-0.06243896484375,
-0.0159454345703125,
-0.0029144287109375,
-0.04901123046875,
-0.0119781494140625,
-0.0222930908203125,
-0.0078887939453125,
0.09320068359375,
0.0090789794921875,
-0.043548583984375,
0.0509033203125,
0.039886474609375,
-0.05230712890625,
-0.002986907958984375,
0.07879638671875,
-0.0230712890625,
0.00771331787109375,
0.0207977294921875,
0.01751708984375,
-0.03778076171875,
-0.0181732177734375,
-0.05914306640625,
0.051727294921875,
-0.047210693359375,
0.0308837890625,
0.031768798828125,
0.016815185546875,
-0.0013551712036132812,
-0.003047943115234375,
-0.01355743408203125,
0.0400390625,
0.004116058349609375,
0.01165008544921875,
-0.0267333984375,
0.003509521484375,
-0.016998291015625,
0.0112762451171875,
-0.01052093505859375,
-0.00550079345703125,
0.021270751953125,
0.00978851318359375,
0.06695556640625,
0.04046630859375,
0.019805908203125,
-0.008544921875,
-0.0128326416015625,
0.020782470703125,
-0.006862640380859375,
-0.01837158203125,
0.02545166015625,
-0.029541015625,
-0.07269287109375,
0.007717132568359375,
0.012420654296875,
0.00446319580078125,
0.0419921875,
0.00018858909606933594,
-0.039093017578125,
0.0269317626953125,
0.03350830078125,
-0.030670166015625,
-0.001888275146484375,
-0.003692626953125,
0.007289886474609375,
-0.03863525390625,
-0.0007534027099609375,
-0.0180511474609375,
0.032958984375,
0.00803375244140625,
-0.02557373046875,
0.0377197265625,
0.0285491943359375,
-0.0247344970703125,
-0.0166778564453125,
-0.0007891654968261719,
0.006290435791015625,
-0.04168701171875,
-0.0245819091796875,
-0.032623291015625,
0.00775909423828125,
-0.06878662109375,
0.01381683349609375,
0.00798797607421875,
-0.0321044921875,
-0.01113128662109375,
-0.037109375,
0.004764556884765625,
-0.01305389404296875,
-0.0005445480346679688,
-0.0211181640625,
-0.0009064674377441406,
-0.0027484893798828125,
0.00540924072265625,
-0.01788330078125,
-0.0002574920654296875,
0.0252532958984375,
0.02008056640625,
0.005458831787109375,
0.034820556640625,
-0.00647735595703125,
-0.013824462890625,
-0.040863037109375,
-0.0273284912109375,
0.005847930908203125,
0.054473876953125,
0.04437255859375,
0.005031585693359375,
-0.01373291015625,
-0.0270538330078125,
-0.01517486572265625,
0.0218353271484375,
-0.0012712478637695312,
0.013885498046875,
-0.0355224609375,
0.0017633438110351562,
-0.0167694091796875,
0.037384033203125,
-0.034942626953125,
-0.00958251953125,
0.003398895263671875,
0.0399169921875,
0.00890350341796875,
-0.043487548828125,
-0.01192474365234375,
-0.013214111328125,
0.034576416015625,
-0.0025787353515625,
0.007965087890625,
0.00440216064453125,
-0.0215911865234375,
-0.0391845703125,
0.032012939453125,
0.0380859375,
-0.010009765625,
0.00757598876953125,
0.002079010009765625,
-0.0245819091796875,
0.0199737548828125,
-0.01091766357421875,
-0.00247955322265625,
0.01398468017578125,
-0.09033203125,
-0.0199737548828125,
-0.062103271484375,
0.00034809112548828125,
0.0242156982421875,
0.01447296142578125,
-0.0028324127197265625,
0.033599853515625,
0.01392364501953125,
0.0135955810546875,
-0.0216217041015625,
-0.00292205810546875,
0.0009493827819824219,
-0.037078857421875,
0.0207366943359375,
-0.0024089813232421875,
-0.08392333984375,
-0.06927490234375,
-0.053131103515625,
0.0631103515625,
0.0186614990234375,
0.0088043212890625,
0.0213623046875,
0.038299560546875,
-0.03466796875,
0.01470947265625,
-0.045684814453125,
-0.049407958984375,
0.06048583984375,
0.004253387451171875,
-0.013671875,
-0.0090484619140625,
-0.09149169921875,
-0.0171356201171875,
0.01132965087890625,
-0.03167724609375,
0.01371002197265625,
-0.032196044921875,
0.0194244384765625,
-0.0179443359375,
-0.03143310546875,
-0.019989013671875,
-0.01235198974609375,
-0.01702880859375,
0.0045928955078125,
0.0169830322265625,
-0.00324249267578125,
-0.040771484375,
-0.01141357421875,
0.0301513671875,
-0.0161285400390625,
0.013427734375,
0.034332275390625,
0.0017633438110351562,
0.0313720703125,
0.0134124755859375,
-0.037200927734375,
0.0279388427734375,
-0.005558013916015625,
0.0180511474609375,
0.02789306640625,
0.052886962890625,
0.0237579345703125,
0.009979248046875,
0.00019085407257080078,
0.043121337890625,
-0.003635406494140625,
-0.054046630859375,
0.0026378631591796875,
0.060302734375,
-0.039825439453125,
0.0108184814453125,
-0.0198974609375,
-0.017852783203125,
-0.0338134765625,
-0.0235595703125,
0.024688720703125,
-0.0290374755859375,
-0.0226287841796875,
-0.0369873046875,
0.0050201416015625,
0.048583984375,
0.015289306640625,
-0.06341552734375,
0.0261383056640625,
-0.0191192626953125,
0.0623779296875,
0.0032978057861328125,
0.04180908203125,
-0.018585205078125,
-0.04901123046875,
-0.04852294921875,
-0.0303192138671875,
-0.036468505859375,
0.05780029296875,
-0.0182037353515625,
-0.033782958984375,
-0.00319671630859375,
0.020111083984375,
0.014495849609375,
-0.02740478515625,
-0.040557861328125,
0.02313232421875,
-0.051910400390625,
-0.0235137939453125,
-0.0223388671875,
0.019866943359375,
0.01305389404296875,
-0.0016946792602539062,
0.00923919677734375,
0.0170745849609375,
-0.029327392578125,
-0.0046844482421875,
-0.036102294921875,
-0.037506103515625,
-0.048095703125,
-0.051666259765625,
0.07403564453125,
0.00347900390625,
-0.027313232421875,
-0.01267242431640625,
-0.0022525787353515625,
-0.016021728515625,
0.024993896484375,
0.00762939453125,
-0.0296173095703125,
0.0015010833740234375,
0.02728271484375,
0.0078277587890625,
0.020172119140625,
0.007205963134765625,
0.028350830078125,
-0.040130615234375,
0.00400543212890625,
-0.0080108642578125,
-0.0184478759765625,
-0.017913818359375,
0.01296234130859375,
0.00812530517578125,
0.02490234375,
-0.041595458984375,
0.0030307769775390625,
-0.0016078948974609375,
0.046630859375,
-0.017913818359375,
-0.0310211181640625,
-0.03118896484375,
-0.0572509765625,
0.042022705078125,
0.057159423828125,
0.001491546630859375,
0.0170135498046875,
-0.0220184326171875,
-0.0244598388671875,
-0.0316162109375,
-0.01139068603515625,
0.0377197265625,
-0.08685302734375,
-0.005859375,
0.0447998046875,
-0.01450347900390625,
0.06781005859375,
-0.0260162353515625,
-0.04095458984375,
0.00031447410583496094,
-0.0391845703125,
-0.004985809326171875,
-0.06353759765625,
0.019439697265625,
0.021697998046875,
-0.04193115234375,
-0.037078857421875,
-0.0172119140625,
0.0008325576782226562,
-0.01021575927734375,
-0.044708251953125,
-0.0313720703125,
-0.016204833984375,
-0.0175628662109375,
0.0457763671875,
-0.01384735107421875,
0.022796630859375,
-0.054443359375,
0.010009765625,
-0.002452850341796875,
0.016998291015625,
0.004364013671875,
0.0240631103515625,
-0.024078369140625,
0.055633544921875,
0.016815185546875,
0.0222320556640625,
-0.017669677734375,
0.0584716796875,
-0.010162353515625,
0.044921875,
-0.0037078857421875,
-0.00901031494140625,
0.041290283203125,
-0.045440673828125,
0.007396697998046875,
-0.0017452239990234375,
0.03875732421875,
-0.038482666015625,
0.031036376953125,
-0.00191497802734375,
0.0204620361328125,
0.024749755859375
] |
68b799c3c3467a4bc1d5b033cf98986bfaf1df3c
|
Wordpress Stackexchange
Q: How to disable TinyMCE from removing span tags I am posting Word generated HTML to WordPress via XMLRPC. Before I go to post.php, the format is correctly preserved in the database. TinyMCE performs its magic and I lose quite a few formatting details.
The main issue i am seeing is that <span> tag with style information surrounding other elements are stripped out. I have verified that these tags are indeed removed by TinyMCE and not Kses.
Is there a way to prevent TinyMCE from altering the HTML? I have tried
add_filter('tiny_mce_before_init', 'tinymce_init');
function tinymce_init( $init ) {
$init['extended_valid_elements'] .= ', span[style|id|nam|class|lang]';
$init['verify_html'] = false;
return $init;
}
which didn't help. According to TinyMCE documentation, "verify_html"
This option enables or disables the element cleanup functionality. If you set this option to false, all element cleanup will be skipped but other cleanup functionality such as URL conversion will still be executed.
A: I couldn't find the extended_valid_elements option in the settings panel for TinyMCE advanced, but adding the following to my functions.php solved it:
function override_mce_options($initArray) {
$opts = '*[*]';
$initArray['valid_elements'] = $opts;
$initArray['extended_valid_elements'] = $opts;
return $initArray;
} add_filter('tiny_mce_before_init', 'override_mce_options');
Source
|
Q: How to disable TinyMCE from removing span tags I am posting Word generated HTML to WordPress via XMLRPC. Before I go to post.php, the format is correctly preserved in the database. TinyMCE performs its magic and I lose quite a few formatting details.
The main issue i am seeing is that <span> tag with style information surrounding other elements are stripped out. I have verified that these tags are indeed removed by TinyMCE and not Kses.
Is there a way to prevent TinyMCE from altering the HTML? I have tried
add_filter('tiny_mce_before_init', 'tinymce_init');
function tinymce_init( $init ) {
$init['extended_valid_elements'] .= ', span[style|id|nam|class|lang]';
$init['verify_html'] = false;
return $init;
}
which didn't help. According to TinyMCE documentation, "verify_html"
This option enables or disables the element cleanup functionality. If you set this option to false, all element cleanup will be skipped but other cleanup functionality such as URL conversion will still be executed.
A: I couldn't find the extended_valid_elements option in the settings panel for TinyMCE advanced, but adding the following to my functions.php solved it:
function override_mce_options($initArray) {
$opts = '*[*]';
$initArray['valid_elements'] = $opts;
$initArray['extended_valid_elements'] = $opts;
return $initArray;
} add_filter('tiny_mce_before_init', 'override_mce_options');
Source
A: I almost always use the TinyMCE Advanced plugin - there is an admin page (Settings->TinyMCE Config) that let you add supported tags using the extended_valid_elements option. Simply add span and whatever other tags you don't want removed and enjoy!
A: If you use TinyMCE Advanced plugin, there is a companion plugin called TinyMCE Advanced Configuration, with which you can change config settings, like extended_valid_elements option.
|
wordpress
|
{
"language": "en",
"length": 257,
"provenance": "stackexchange_00019.jsonl.gz:420084",
"question_score": "12",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52582"
}
|
[
0.032684326171875,
-0.00815582275390625,
-0.0204925537109375,
0.0169219970703125,
0.01509857177734375,
-0.04693603515625,
0.065673828125,
-0.007381439208984375,
-0.0164031982421875,
0.0312347412109375,
-0.002193450927734375,
-0.0029163360595703125,
0.023956298828125,
-0.032623291015625,
0.00948333740234375,
-0.00768280029296875,
0.0175323486328125,
0.0175018310546875,
0.03485107421875,
-0.015533447265625,
-0.007328033447265625,
-0.01352691650390625,
0.0361328125,
-0.009368896484375,
0.005268096923828125,
-0.0298919677734375,
0.05279541015625,
-0.049407958984375,
0.0016107559204101562,
-0.039764404296875,
0.00968170166015625,
0.027069091796875,
0.0093536376953125,
0.08135986328125,
-0.0950927734375,
0.0175323486328125,
-0.0219879150390625,
0.048126220703125,
0.0025463104248046875,
0.0340576171875,
0.0195770263671875,
-0.02337646484375,
0.0180816650390625,
-0.0250091552734375,
-0.018341064453125,
0.00780487060546875,
0.021209716796875,
-0.00899505615234375,
0.005352020263671875,
-0.031158447265625,
0.0099334716796875,
-0.00548553466796875,
0.0311737060546875,
-0.0276947021484375,
-0.0213165283203125,
0.0144500732421875,
-0.0673828125,
-0.0019664764404296875,
0.01486968994140625,
0.080810546875,
0.037261962890625,
0.0096282958984375,
-0.02203369140625,
-0.04339599609375,
0.006374359130859375,
-0.01629638671875,
-0.0178985595703125,
0.0293426513671875,
-0.03521728515625,
-0.0020427703857421875,
0.036651611328125,
-0.03265380859375,
0.011138916015625,
-0.06866455078125,
0.007717132568359375,
0.0408935546875,
-0.049224853515625,
-0.0300445556640625,
0.0224761962890625,
-0.0277557373046875,
0.017913818359375,
-0.030975341796875,
-0.01568603515625,
-0.01163482666015625,
0.01006317138671875,
-0.0011415481567382812,
-0.003940582275390625,
-0.013397216796875,
-0.0202484130859375,
-0.0305023193359375,
-0.0241241455078125,
-0.04534912109375,
-0.004398345947265625,
-0.00555419921875,
-0.01371002197265625,
-0.01441192626953125,
0.0245208740234375,
0.036407470703125,
-0.00980377197265625,
0.00371551513671875,
0.01837158203125,
-0.04827880859375,
0.049774169921875,
-0.046142578125,
0.017852783203125,
0.037445068359375,
-0.0052642822265625,
0.0311737060546875,
0.06744384765625,
0.009429931640625,
0.0134429931640625,
0.056732177734375,
-0.0226593017578125,
-0.0224456787109375,
-0.01611328125,
0.033599853515625,
-0.0132598876953125,
-0.0007166862487792969,
0.0022144317626953125,
0.031280517578125,
-0.0033893585205078125,
0.0172882080078125,
-0.0007510185241699219,
-0.0310821533203125,
0.0082244873046875,
-0.021820068359375,
-0.0157623291015625,
0.0102081298828125,
-0.0002224445343017578,
0.021575927734375,
-0.05810546875,
0.01284027099609375,
0.053558349609375,
0.0262451171875,
0.0170745849609375,
-0.0250091552734375,
0.0055389404296875,
-0.01071929931640625,
-0.00727081298828125,
0.02056884765625,
0.0095062255859375,
-0.0280609130859375,
0.0012693405151367188,
0.002960205078125,
-0.0223541259765625,
0.0177764892578125,
0.038818359375,
0.01386260986328125,
-0.055572509765625,
-0.0562744140625,
0.005062103271484375,
0.01372528076171875,
0.0694580078125,
0.0041351318359375,
-0.03900146484375,
-0.06591796875,
0.053253173828125,
-0.06585693359375,
-0.0156707763671875,
-0.10284423828125,
0.03790283203125,
-0.005840301513671875,
0.019256591796875,
-0.00788116455078125,
-0.0408935546875,
-0.00860595703125,
-0.0350341796875,
-0.01360321044921875,
0.033538818359375,
0.07403564453125,
-0.0016851425170898438,
-0.0162200927734375,
0.011444091796875,
0.0284271240234375,
0.004863739013671875,
0.0148773193359375,
-0.0240020751953125,
0.05120849609375,
0.0201568603515625,
0.0017004013061523438,
0.0006756782531738281,
-0.0411376953125,
0.066162109375,
-0.017120361328125,
-0.05438232421875,
0.0169525146484375,
0.00626373291015625,
0.07000732421875,
0.017425537109375,
0.026153564453125,
0.0167694091796875,
-0.028411865234375,
0.00955963134765625,
-0.0020599365234375,
0.02679443359375,
-0.0377197265625,
-0.028045654296875,
-0.02587890625,
0.00926971435546875,
-0.024993896484375,
0.05303955078125,
-0.0012226104736328125,
0.025360107421875,
-0.051177978515625,
-0.038116455078125,
-0.0103759765625,
-0.004512786865234375,
0.0401611328125,
-0.0550537109375,
0.01258087158203125,
0.03692626953125,
-0.011749267578125,
-0.0284271240234375,
0.042938232421875,
0.040069580078125,
0.01189422607421875,
0.0166015625,
0.0675048828125,
0.03472900390625,
0.026611328125,
0.055633544921875,
-0.019805908203125,
0.05975341796875,
0.0177154541015625,
0.0022525787353515625,
-0.027191162109375,
-0.003963470458984375,
-0.025146484375,
0.0218658447265625,
-0.00690460205078125,
0.0067596435546875,
0.0275115966796875,
0.017822265625,
0.04754638671875,
-0.022552490234375,
-0.0291595458984375,
-0.0389404296875,
-0.06500244140625,
0.0158233642578125,
0.06439208984375,
0.0238800048828125,
0.0238037109375,
-0.019195556640625,
0.0038013458251953125,
0.08001708984375,
0.0019197463989257812,
0.00914764404296875,
-0.00757598876953125,
0.01386260986328125,
0.0002593994140625,
0.0100555419921875,
-0.042144775390625,
0.03741455078125,
-0.01470947265625,
0.03717041015625,
-0.0091094970703125,
-0.025054931640625,
-0.009979248046875,
0.0259857177734375,
-0.01019287109375,
0.00916290283203125,
0.0260467529296875,
0.0026760101318359375,
0.0012083053588867188,
0.0684814453125,
0.0222320556640625,
0.03424072265625,
0.0235595703125,
-0.048126220703125,
0.0399169921875,
0.0228729248046875,
-0.01959228515625,
-0.00960540771484375,
0.0015201568603515625,
0.0284881591796875,
0.00537109375,
-0.050018310546875,
0.0310821533203125,
0.00052642822265625,
0.015289306640625,
-0.0278167724609375,
0.00417327880859375,
0.019500732421875,
-0.0048980712890625,
-0.0209808349609375,
-0.0253143310546875,
0.032012939453125,
0.0156402587890625,
0.04803466796875,
0.00716400146484375,
0.00847625732421875,
0.009185791015625,
-0.0297393798828125,
0.058685302734375,
0.0006766319274902344,
-0.03265380859375,
-0.0143585205078125,
-0.033355712890625,
0.034515380859375,
-0.02386474609375,
0.06463623046875,
0.06707763671875,
-0.01097869873046875,
0.01617431640625,
0.0211639404296875,
-0.01458740234375,
0.044158935546875,
0.02032470703125,
0.0012502670288085938,
0.00371551513671875,
-0.047119140625,
-0.003414154052734375,
0.024078369140625,
0.0302734375,
0.00571441650390625,
-0.035980224609375,
-0.00536346435546875,
0.0308380126953125,
-0.0194244384765625,
0.0102691650390625,
0.052642822265625,
-0.031890869140625,
-0.018585205078125,
-0.01255035400390625,
-0.0250396728515625,
-0.01349639892578125,
0.004596710205078125,
-0.0181121826171875,
-0.0211181640625,
-0.01305389404296875,
-0.01412200927734375,
-0.0078887939453125,
-0.0168914794921875,
0.033203125,
-0.014984130859375,
-0.01036834716796875,
0.02899169921875,
0.052581787109375,
0.0333251953125,
-0.05560302734375,
0.04302978515625,
-0.0626220703125,
-0.0540771484375,
0.049713134765625,
-0.003902435302734375,
-0.0236968994140625,
-0.0273590087890625,
0.00812530517578125,
-0.0192718505859375,
0.0022525787353515625,
0.00046181678771972656,
-0.00424957275390625,
-0.006031036376953125,
0.00885009765625,
0.030548095703125,
0.01245880126953125,
-0.00968170166015625,
0.014984130859375,
0.0230712890625,
-0.0262908935546875,
-0.052001953125,
0.01374053955078125,
-0.037811279296875,
0.05377197265625,
0.0128173828125,
0.002838134765625,
0.000885009765625,
0.0582275390625,
0.0247344970703125,
0.007312774658203125,
0.061370849609375,
-0.02093505859375,
0.01568603515625,
-0.0175323486328125,
0.00653839111328125,
-0.045257568359375,
0.02020263671875,
-0.0258026123046875,
-0.023681640625,
-0.008514404296875,
-0.01727294921875,
-0.028472900390625,
-0.0092620849609375,
-0.0413818359375,
0.0235137939453125,
-0.0026836395263671875,
-0.05816650390625,
0.0165252685546875,
0.00461578369140625,
0.02606201171875,
0.00676727294921875,
0.03289794921875,
0.007724761962890625,
-0.02154541015625,
-0.0207977294921875,
-0.0089263916015625,
-0.0193328857421875,
-0.0306549072265625,
-0.00946807861328125,
0.006744384765625,
-0.09503173828125,
0.027618408203125,
-0.0013685226440429688,
-0.0090789794921875,
-0.033843994140625,
0.0063323974609375,
-0.06146240234375,
-0.04541015625,
0.01434326171875,
-0.00025463104248046875,
-0.00335693359375,
-0.030426025390625,
-0.00864410400390625,
-0.0504150390625,
0.02313232421875,
-0.0272674560546875,
-0.060791015625,
0.007904052734375,
-0.05535888671875,
0.0256805419921875,
-0.0004744529724121094,
0.035736083984375,
-0.0200653076171875,
0.037353515625,
-0.01995849609375,
-0.0168609619140625,
0.02056884765625,
0.035552978515625,
-0.017578125,
-0.0009140968322753906,
-0.0213165283203125,
-0.03662109375,
0.006206512451171875,
0.0560302734375,
-0.046478271484375,
-0.00882720947265625,
-0.0158843994140625,
-0.07598876953125,
0.07196044921875,
-0.07806396484375,
-0.056182861328125,
-0.043121337890625,
-0.042938232421875,
-0.00493621826171875,
-0.01326751708984375,
-0.0170440673828125,
-0.039031982421875,
-0.053253173828125,
0.044281005859375,
-0.014404296875,
-0.009033203125,
-0.00775909423828125,
0.06365966796875,
0.011962890625,
-0.018096923828125,
0.0152435302734375,
-0.0099639892578125,
0.0253753662109375,
0.0177764892578125,
0.0017299652099609375,
0.0003559589385986328,
-0.0257568359375,
0.04229736328125,
0.01305389404296875,
0.014984130859375,
-0.046539306640625,
0.054840087890625,
-0.00853729248046875,
-0.00460052490234375,
0.00823211669921875,
-0.0028705596923828125,
0.036041259765625,
-0.021942138671875,
-0.004436492919921875,
0.039154052734375,
0.052581787109375,
-0.00867462158203125,
0.0148773193359375,
-0.03985595703125,
-0.0098114013671875,
-0.00078582763671875,
-0.0008649826049804688,
0.0667724609375,
0.0180511474609375,
0.039703369140625,
0.0008587837219238281,
-0.02313232421875,
0.0038585662841796875,
0.002574920654296875,
-0.0302886962890625,
-0.01274871826171875,
-0.03424072265625,
0.017852783203125,
-0.0203857421875,
-0.020294189453125,
-0.0117340087890625,
0.00016689300537109375,
0.00899505615234375,
0.007183074951171875,
-0.03125,
-0.0280914306640625,
0.0057525634765625,
0.0200653076171875,
-0.025390625,
0.035919189453125,
0.011932373046875,
-0.0164794921875,
-0.0280303955078125,
0.005382537841796875,
0.0164337158203125,
-0.026885986328125,
-0.0243377685546875,
-0.05023193359375,
-0.025115966796875,
-0.00809478759765625,
0.006839752197265625,
0.025970458984375,
0.003376007080078125,
0.0110626220703125,
-0.027984619140625,
0.0007143020629882812,
0.001461029052734375,
0.046478271484375,
0.0207061767578125,
-0.0167999267578125,
-0.002178192138671875,
0.0281829833984375,
0.01355743408203125,
-0.06732177734375,
-0.0232391357421875,
0.035003662109375,
0.0438232421875,
-0.019134521484375,
-0.046783447265625,
0.0301361083984375,
0.00775909423828125,
0.0121917724609375,
-0.002471923828125,
-0.0170440673828125,
-0.0190582275390625,
0.006305694580078125,
0.004962921142578125,
0.00957489013671875,
-0.033416748046875,
-0.0167388916015625,
-0.022308349609375,
-0.076171875,
-0.029510498046875,
-0.0021228790283203125,
-0.048431396484375,
0.00545501708984375,
0.00545501708984375,
0.00007021427154541016,
-0.0198516845703125,
-0.01245880126953125,
-0.0859375,
-0.015899658203125,
-0.005428314208984375,
0.00801849365234375,
0.020660400390625,
-0.04437255859375,
0.01934814453125,
-0.0018177032470703125,
0.0196380615234375,
-0.053558349609375,
0.0308074951171875,
-0.002262115478515625,
0.01141357421875,
0.0173797607421875,
-0.005889892578125,
-0.064453125,
-0.033416748046875,
-0.048126220703125,
-0.04315185546875,
-0.015899658203125,
-0.00396728515625,
-0.01202392578125,
0.0232086181640625,
-0.033355712890625,
-0.0204620361328125,
-0.0011415481567382812,
0.01291656494140625,
0.0052947998046875,
0.04022216796875,
-0.033477783203125,
0.03851318359375,
-0.00966644287109375,
0.039459228515625,
-0.00925445556640625,
0.00521087646484375,
0.005062103271484375,
-0.0100555419921875,
0.011322021484375,
-0.0596923828125,
-0.0288848876953125,
0.017120361328125,
-0.034454345703125,
0.01922607421875,
0.0222625732421875,
-0.00441741943359375,
0.020965576171875,
-0.0220947265625,
0.01320648193359375,
-0.0240325927734375,
0.04681396484375,
-0.0330810546875,
0.032684326171875,
-0.001316070556640625,
-0.00614166259765625,
0.0165252685546875,
-0.0186767578125,
0.0231170654296875,
0.02264404296875,
-0.0197601318359375,
0.028839111328125,
-0.01544952392578125,
0.0141448974609375,
0.01152801513671875,
-0.02618408203125,
-0.0252685546875,
0.0008873939514160156,
0.0162506103515625,
0.00623321533203125,
-0.0243682861328125,
-0.00823974609375,
0.0050811767578125,
0.0280609130859375,
0.0086822509765625,
-0.00787353515625,
0.039093017578125,
0.0135498046875,
0.0019588470458984375,
-0.0066375732421875,
0.05743408203125,
0.07452392578125,
-0.074951171875,
-0.00811004638671875,
0.0279693603515625,
-0.0024166107177734375,
-0.0144500732421875,
-0.0198211669921875,
-0.0309906005859375,
-0.046112060546875,
0.08575439453125,
-0.01499176025390625,
-0.01019287109375,
0.0277252197265625,
-0.002788543701171875,
-0.023345947265625,
-0.018890380859375,
0.05731201171875,
0.016387939453125,
-0.0213775634765625,
0.009735107421875,
0.004261016845703125,
-0.0008664131164550781,
0.00508880615234375,
0.02001953125,
-0.001728057861328125,
-0.02587890625,
-0.061798095703125,
-0.017730712890625,
-0.020111083984375,
-0.0689697265625,
0.0028438568115234375,
-0.0284576416015625,
0.00589752197265625,
0.029022216796875,
-0.036102294921875,
0.021575927734375,
0.0018243789672851562,
-0.023895263671875,
0.010772705078125,
-0.0214385986328125,
0.007091522216796875,
0.0024623870849609375,
0.0193634033203125,
0.023773193359375,
0.0357666015625,
-0.05279541015625,
0.003284454345703125,
0.0244598388671875,
-0.01519775390625,
0.00908660888671875,
-0.01898193359375,
0.043487548828125,
-0.00897979736328125,
-0.010528564453125,
-0.04095458984375,
-0.040618896484375,
-0.077880859375,
-0.023651123046875,
-0.059326171875,
-0.0416259765625,
0.045074462890625,
-0.04571533203125,
-0.090087890625,
0.150634765625,
0.01374053955078125,
0.05389404296875,
0.0050201416015625,
0.048248291015625,
-0.064453125,
0.003772735595703125,
-0.00875091552734375,
-0.025482177734375,
-0.01091766357421875,
-0.0228271484375,
-0.03271484375,
-0.01474761962890625,
-0.02947998046875,
0.044586181640625,
-0.0178985595703125,
-0.01898193359375,
0.03289794921875,
-0.0204620361328125,
0.00844573974609375,
0.04986572265625,
-0.00299072265625,
-0.03472900390625,
0.01354217529296875,
0.0027637481689453125,
-0.004718780517578125,
-0.0113677978515625,
0.036651611328125,
-0.06475830078125,
-0.01116943359375,
0.028564453125,
-0.009979248046875,
-0.027618408203125,
0.00916290283203125,
-0.0252838134765625,
-0.003955841064453125,
-0.007488250732421875,
-0.01953125,
-0.046112060546875,
-0.04559326171875,
0.05731201171875,
0.0086822509765625,
-0.0701904296875,
-0.08660888671875,
-0.028076171875,
0.012664794921875,
0.01194000244140625,
0.036712646484375,
0.0164947509765625,
0.0086822509765625,
0.07177734375,
-0.023468017578125,
0.0148773193359375,
0.018096923828125,
-0.01434326171875,
-0.027557373046875,
-0.026336669921875,
0.004268646240234375,
-0.035919189453125,
-0.00154876708984375,
0.015716552734375,
-0.0257110595703125,
-0.006069183349609375,
0.010162353515625,
0.003635406494140625,
0.0005617141723632812,
-0.0303192138671875,
-0.0501708984375,
-0.01654052734375,
-0.0027446746826171875,
0.0189666748046875,
0.019805908203125,
-0.032318115234375,
-0.0394287109375,
0.026611328125,
-0.006198883056640625,
0.020416259765625,
0.034912109375,
-0.04058837890625,
-0.056365966796875,
-0.0191650390625,
-0.01091766357421875,
0.06756591796875,
0.046142578125,
0.054046630859375,
-0.01264190673828125,
-0.04290771484375,
-0.028900146484375,
0.038543701171875,
0.0018310546875,
0.017730712890625,
-0.021728515625,
-0.0038700103759765625,
0.0232391357421875,
0.0247802734375,
-0.00872039794921875,
-0.014312744140625,
0.044464111328125,
0.0233612060546875,
-0.052490234375,
-0.017974853515625,
0.020782470703125,
-0.0178375244140625,
-0.0311431884765625,
-0.0389404296875,
-0.050384521484375,
0.00018835067749023438,
-0.0182952880859375,
0.0302734375,
-0.0177459716796875,
0.0178070068359375,
0.0000852346420288086,
0.023681640625,
0.0024700164794921875,
-0.0013599395751953125,
0.009735107421875,
-0.01160430908203125,
-0.0135650634765625,
0.00689697265625,
0.01020050048828125,
0.006420135498046875,
-0.032470703125,
-0.0283966064453125,
0.0174713134765625,
0.036163330078125,
-0.0035076141357421875,
0.0105133056640625,
-0.01500701904296875,
-0.052978515625,
0.006511688232421875,
0.037200927734375,
-0.006336212158203125,
0.0292816162109375,
0.0015573501586914062,
-0.00939178466796875,
-0.00803375244140625,
0.01177215576171875,
-0.0056304931640625,
0.02496337890625,
0.0277557373046875,
0.0665283203125,
-0.0213470458984375,
0.02606201171875,
-0.02911376953125,
0.03021240234375,
-0.0265045166015625,
-0.024017333984375,
0.04742431640625,
0.035247802734375,
0.00968170166015625,
-0.032958984375,
-0.02935791015625,
0.0528564453125,
-0.0003254413604736328,
0.00342559814453125,
0.0160369873046875,
0.0009317398071289062,
0.0007266998291015625,
0.0169219970703125,
0.06256103515625,
-0.0107421875,
-0.0225677490234375,
-0.062042236328125,
-0.01812744140625,
0.0292510986328125,
0.059356689453125,
0.008331298828125,
0.018707275390625,
0.0309295654296875,
-0.01611328125,
0.0438232421875,
-0.0115509033203125,
0.04864501953125,
0.02923583984375,
0.0038318634033203125,
-0.003604888916015625,
0.02392578125,
-0.01445770263671875,
0.0119171142578125,
0.0207061767578125,
-0.00368499755859375,
0.035125732421875,
-0.071044921875,
0.042083740234375,
0.0196380615234375,
0.046112060546875,
-0.003353118896484375,
0.006763458251953125,
0.02020263671875,
0.002979278564453125,
0.0225677490234375,
-0.01099395751953125,
-0.02972412109375,
-0.033203125,
-0.0022220611572265625,
0.03271484375,
-0.02471923828125,
-0.027587890625,
-0.051239013671875,
-0.01959228515625,
0.04449462890625,
0.018524169921875,
-0.058380126953125,
0.023406982421875,
-0.0242156982421875,
0.0177154541015625,
0.0162353515625,
0.01277923583984375,
-0.021148681640625,
-0.0225830078125,
-0.04638671875,
-0.06884765625,
-0.04815673828125,
0.0758056640625,
-0.0478515625,
0.004833221435546875,
0.03338623046875,
-0.0036602020263671875,
-0.01206207275390625,
-0.048736572265625,
-0.017120361328125,
0.01210784912109375,
-0.07147216796875,
-0.0179443359375,
0.06317138671875,
-0.0243682861328125,
-0.0355224609375,
-0.0732421875,
-0.01357269287109375,
-0.088623046875,
0.032989501953125,
0.03057861328125,
-0.054351806640625,
-0.03314208984375,
-0.04901123046875,
-0.07244873046875,
0.049896240234375,
0.0124969482421875,
-0.0221405029296875,
-0.006099700927734375,
0.010528564453125,
-0.0124359130859375,
-0.00107574462890625,
-0.00005412101745605469,
0.005008697509765625,
0.0009851455688476562,
-0.0036602020263671875,
0.0238189697265625,
0.055908203125,
0.01442718505859375,
-0.00896453857421875,
-0.0692138671875,
0.01454925537109375,
-0.01300811767578125,
0.053680419921875,
-0.00955963134765625,
0.00882720947265625,
0.0128021240234375,
0.0227813720703125,
-0.003978729248046875,
-0.010589599609375,
0.00896453857421875,
-0.01410675048828125,
0.001636505126953125,
-0.026763916015625,
-0.051483154296875,
-0.03045654296875,
0.08416748046875,
0.0654296875,
0.0194549560546875,
-0.0285797119140625,
-0.01184844970703125,
0.00875091552734375,
-0.030364990234375,
-0.01372528076171875,
0.0419921875,
-0.08868408203125,
-0.020660400390625,
0.00939178466796875,
0.01439666748046875,
-0.01448822021484375,
0.0128173828125,
-0.0180206298828125,
-0.0236358642578125,
0.005306243896484375,
-0.01776123046875,
-0.03839111328125,
0.03936767578125,
-0.0006952285766601562,
-0.023223876953125,
-0.0288543701171875,
-0.016754150390625,
-0.006404876708984375,
-0.02789306640625,
0.00801849365234375,
-0.0567626953125,
0.0117950439453125,
-0.0079345703125,
0.034332275390625,
-0.017852783203125,
0.0093841552734375,
-0.033599853515625,
0.037994384765625,
-0.0028858184814453125,
-0.006252288818359375,
0.02264404296875,
0.0064239501953125,
-0.0291290283203125,
-0.0281982421875,
-0.00798797607421875,
-0.0364990234375,
-0.024322509765625,
0.039825439453125,
-0.020751953125,
0.0073699951171875,
0.01030731201171875,
0.007415771484375,
0.0467529296875,
-0.0019073486328125,
-0.0012226104736328125,
-0.006183624267578125,
-0.0219268798828125,
-0.0304107666015625,
-0.00717926025390625,
-0.0237884521484375,
0.00524139404296875,
0.0045623779296875
] |
7fe582c0be0c65877421d8542aed2e642ce1a3f6
|
Wordpress Stackexchange
Q: Should I escape wordpress functions like the_title, the_excerpt, the_content I had look at the code but I couldnt see any escaping on funcions like the_title the_content the_excerptetc. I might not be reading it right. Do I need to escape these functions in theme development like:
esc_html ( the_title () )
Edit: as pointed out in the answers below the above code is wrong regardless - the code should have read
esc_html ( get_the_title () )
A: Yes and no - depends on whether you want html in those functions to be output or not. If you escape the_content(), for example, and it contains a <div> tag, that tag would actually be output to the page as <div> instead.
By the way, if you do escape the output of those functions, you'll want to use their "get_" equivalents (ex. get_the_content()) as those functions echo their output directly.
|
Q: Should I escape wordpress functions like the_title, the_excerpt, the_content I had look at the code but I couldnt see any escaping on funcions like the_title the_content the_excerptetc. I might not be reading it right. Do I need to escape these functions in theme development like:
esc_html ( the_title () )
Edit: as pointed out in the answers below the above code is wrong regardless - the code should have read
esc_html ( get_the_title () )
A: Yes and no - depends on whether you want html in those functions to be output or not. If you escape the_content(), for example, and it contains a <div> tag, that tag would actually be output to the page as <div> instead.
By the way, if you do escape the output of those functions, you'll want to use their "get_" equivalents (ex. get_the_content()) as those functions echo their output directly.
A: Escaping depends entirely on the context in which you are using the functions. What is safe for displaying inside <h1> tags, is not necessarily safe to display for the value attribute of an input field, and even that wouldn't necessarily be safe as a href attribute value....
In short - perform the sanitisation yourself as you output it. Though in the case of the_title () or get_the_title (), esc_html is not necessary, since WordPress applies the following functions:
*
*convert_chars
*wptexturize
Note: the_title prints the title - so esc_html ( the_title () ) won't work. Similarly, the_content prints the content (in any case, you'd expect the content to display HTML).
A: You can simply write a function like this and hook it to the_title filter:
function my_escape_title( $title ){
return esc_html( $title );
}
add_filter( 'the_title', 'my_escape_title' );
|
wordpress
|
{
"language": "en",
"length": 286,
"provenance": "stackexchange_00019.jsonl.gz:420089",
"question_score": "18",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52597"
}
|
[
0.0119171142578125,
-0.01459503173828125,
0.007755279541015625,
0.0017986297607421875,
-0.005496978759765625,
-0.00897216796875,
0.034149169921875,
-0.035400390625,
0.004512786865234375,
0.013092041015625,
0.0146331787109375,
-0.045684814453125,
-0.0175018310546875,
-0.056793212890625,
-0.01538848876953125,
-0.041961669921875,
0.01885986328125,
-0.00861358642578125,
0.0186920166015625,
-0.032012939453125,
0.0291595458984375,
-0.00672149658203125,
-0.006763458251953125,
0.043792724609375,
0.0254058837890625,
-0.048248291015625,
0.0926513671875,
-0.021575927734375,
0.02838134765625,
-0.018218994140625,
0.026397705078125,
-0.02496337890625,
0.034881591796875,
0.04510498046875,
-0.075927734375,
0.039398193359375,
-0.028472900390625,
0.0178680419921875,
-0.002544403076171875,
0.041259765625,
-0.01177215576171875,
0.00901031494140625,
0.00617218017578125,
0.007144927978515625,
-0.0064697265625,
-0.03326416015625,
0.023406982421875,
-0.03369140625,
-0.0055694580078125,
0.01229095458984375,
0.029052734375,
-0.0606689453125,
0.03363037109375,
-0.03887939453125,
-0.012420654296875,
0.011810302734375,
-0.032073974609375,
-0.0215911865234375,
0.0256805419921875,
0.0006256103515625,
0.0018482208251953125,
-0.0172119140625,
0.023101806640625,
-0.0239715576171875,
0.01110076904296875,
0.0261688232421875,
0.032806396484375,
0.0045928955078125,
-0.059173583984375,
0.00768280029296875,
0.034027099609375,
-0.055999755859375,
-0.00698089599609375,
-0.033447265625,
-0.00382232666015625,
0.039154052734375,
-0.002490997314453125,
0.00003713369369506836,
0.00412750244140625,
-0.00681304931640625,
0.034698486328125,
0.0075225830078125,
-0.053253173828125,
-0.00601959228515625,
0.04400634765625,
0.034149169921875,
-0.00939178466796875,
-0.027435302734375,
0.01508331298828125,
-0.0200042724609375,
-0.00945281982421875,
0.0300140380859375,
0.01605224609375,
-0.0179901123046875,
-0.017364501953125,
-0.048248291015625,
-0.01070404052734375,
0.024505615234375,
-0.024749755859375,
0.0269012451171875,
0.00637054443359375,
-0.0360107421875,
0.07025146484375,
-0.044769287109375,
0.01165771484375,
0.06414794921875,
-0.0165252685546875,
-0.0284881591796875,
0.028228759765625,
0.018463134765625,
0.00942230224609375,
-0.036468505859375,
-0.04400634765625,
-0.0643310546875,
0.01045989990234375,
0.07904052734375,
-0.031341552734375,
0.01335906982421875,
0.01556396484375,
0.038848876953125,
0.0210723876953125,
0.0016336441040039062,
0.0281219482421875,
0.01326751708984375,
-0.00904083251953125,
0.0015649795532226562,
-0.03570556640625,
-0.032440185546875,
0.02783203125,
0.00787353515625,
-0.0192108154296875,
-0.00997161865234375,
-0.01050567626953125,
0.029632568359375,
0.0009722709655761719,
-0.022369384765625,
-0.0295562744140625,
-0.03289794921875,
-0.007518768310546875,
-0.0237274169921875,
-0.014739990234375,
0.0004341602325439453,
0.029571533203125,
-0.037445068359375,
-0.01263427734375,
0.01299285888671875,
0.01177978515625,
0.024322509765625,
-0.0138397216796875,
-0.06512451171875,
0.042633056640625,
-0.036712646484375,
0.04315185546875,
-0.031402587890625,
-0.0288543701171875,
-0.0513916015625,
-0.043853759765625,
-0.033203125,
0.0251922607421875,
-0.032806396484375,
-0.00223541259765625,
-0.00763702392578125,
0.00571441650390625,
0.01134490966796875,
-0.01404571533203125,
0.015960693359375,
-0.0168914794921875,
-0.007656097412109375,
0.0143585205078125,
0.04443359375,
-0.00881195068359375,
-0.044921875,
-0.01537322998046875,
-0.01047515869140625,
-0.035247802734375,
0.022674560546875,
0.0097198486328125,
-0.01358795166015625,
0.0120391845703125,
0.0736083984375,
0.0005202293395996094,
-0.0211334228515625,
0.054931640625,
-0.0428466796875,
-0.052093505859375,
0.0159759521484375,
0.0201568603515625,
0.043548583984375,
0.0458984375,
0.00478363037109375,
0.0111541748046875,
0.003353118896484375,
-0.03338623046875,
0.00038433074951171875,
0.0007276535034179688,
-0.03778076171875,
-0.002262115478515625,
-0.031097412109375,
-0.006481170654296875,
0.035797119140625,
0.079345703125,
-0.01141357421875,
0.046966552734375,
-0.006359100341796875,
-0.00652313232421875,
0.0025043487548828125,
0.004016876220703125,
0.011566162109375,
0.020050048828125,
0.033935546875,
0.01244354248046875,
0.02734375,
-0.051483154296875,
0.02923583984375,
-0.035614013671875,
-0.004840850830078125,
-0.037506103515625,
0.0267486572265625,
-0.0025348663330078125,
0.040679931640625,
0.0160980224609375,
-0.0236053466796875,
0.007587432861328125,
0.0018663406372070312,
0.073974609375,
-0.0074462890625,
0.005222320556640625,
-0.0247039794921875,
0.046661376953125,
0.001613616943359375,
-0.0189666748046875,
0.0029888153076171875,
0.07421875,
0.0682373046875,
-0.0364990234375,
-0.01751708984375,
-0.0218658447265625,
-0.0251007080078125,
-0.014007568359375,
0.06298828125,
0.056243896484375,
0.072998046875,
-0.0200653076171875,
-0.07489013671875,
0.0799560546875,
-0.06793212890625,
0.0091094970703125,
-0.051055908203125,
0.0246734619140625,
0.0264129638671875,
0.0002008676528930664,
-0.049163818359375,
0.01197052001953125,
-0.1033935546875,
0.01378631591796875,
0.01043701171875,
-0.03839111328125,
-0.0206146240234375,
-0.006031036376953125,
-0.0206451416015625,
0.00751495361328125,
-0.0352783203125,
-0.001468658447265625,
-0.0142974853515625,
0.0033416748046875,
0.031341552734375,
0.003940582275390625,
0.0186309814453125,
-0.0176849365234375,
0.01337432861328125,
0.035400390625,
0.031158447265625,
-0.006732940673828125,
0.08941650390625,
0.0207061767578125,
0.0162353515625,
-0.040863037109375,
-0.02374267578125,
-0.021514892578125,
0.0484619140625,
0.00849151611328125,
0.052825927734375,
-0.017333984375,
-0.0248260498046875,
-0.0121917724609375,
-0.0143280029296875,
-0.01099395751953125,
0.0005483627319335938,
0.037139892578125,
0.0008111000061035156,
0.01456451416015625,
0.032012939453125,
-0.01947021484375,
0.059173583984375,
0.005870819091796875,
-0.00942230224609375,
0.045440673828125,
-0.016693115234375,
0.026153564453125,
-0.00894927978515625,
0.06158447265625,
0.040008544921875,
-0.0166168212890625,
-0.0023822784423828125,
0.00012201070785522461,
0.02069091796875,
0.01470184326171875,
-0.003536224365234375,
-0.0174560546875,
0.00344085693359375,
-0.08074951171875,
-0.040313720703125,
0.0197601318359375,
0.0772705078125,
-0.03167724609375,
-0.03912353515625,
-0.029388427734375,
0.033233642578125,
-0.062255859375,
-0.04974365234375,
0.032745361328125,
-0.03521728515625,
-0.032684326171875,
-0.0226287841796875,
-0.010345458984375,
-0.0002453327178955078,
-0.002971649169921875,
-0.019317626953125,
0.01177215576171875,
-0.00003546476364135742,
-0.06170654296875,
-0.0285491943359375,
-0.073486328125,
0.0246734619140625,
-0.01406097412109375,
0.046417236328125,
-0.0005960464477539062,
0.021392822265625,
-0.013580322265625,
-0.0601806640625,
-0.0222015380859375,
0.02880859375,
0.023193359375,
0.034210205078125,
-0.033843994140625,
-0.0004646778106689453,
-0.033721923828125,
0.0147857666015625,
-0.023468017578125,
-0.02880859375,
0.03765869140625,
-0.0255584716796875,
-0.0117645263671875,
0.037841796875,
0.0233306884765625,
0.002521514892578125,
0.01526641845703125,
0.048980712890625,
0.0165863037109375,
-0.0201263427734375,
-0.026397705078125,
0.00992584228515625,
-0.037139892578125,
0.050567626953125,
0.038055419921875,
-0.02886962890625,
0.00916290283203125,
0.011077880859375,
0.0125274658203125,
0.0302276611328125,
0.018890380859375,
-0.01415252685546875,
-0.0140533447265625,
-0.002933502197265625,
0.0018110275268554688,
-0.006824493408203125,
0.004596710205078125,
-0.007617950439453125,
0.0303497314453125,
0.009002685546875,
0.031463623046875,
-0.0157470703125,
0.0158538818359375,
-0.0491943359375,
0.00008660554885864258,
0.05255126953125,
0.017486572265625,
0.00433349609375,
0.00455474853515625,
-0.051971435546875,
-0.005306243896484375,
0.061431884765625,
-0.018035888671875,
-0.01055908203125,
0.0289306640625,
0.021697998046875,
-0.035675048828125,
-0.03643798828125,
-0.041351318359375,
-0.0171356201171875,
-0.0261383056640625,
0.00872039794921875,
-0.0140533447265625,
-0.0030956268310546875,
0.007411956787109375,
0.032623291015625,
0.01806640625,
-0.0162811279296875,
0.0090484619140625,
0.0179595947265625,
0.0106048583984375,
-0.0219268798828125,
0.033966064453125,
-0.060546875,
0.0243072509765625,
-0.0005273818969726562,
-0.07977294921875,
-0.00685882568359375,
-0.0152587890625,
0.05224609375,
0.00649261474609375,
-0.017181396484375,
-0.02490234375,
0.04254150390625,
-0.0165863037109375,
-0.010772705078125,
0.018096923828125,
0.013458251953125,
0.00078582763671875,
0.029510498046875,
0.017791748046875,
-0.0209808349609375,
-0.00724029541015625,
0.0006809234619140625,
-0.04022216796875,
0.04400634765625,
0.0016317367553710938,
0.01378631591796875,
0.0217742919921875,
-0.0260467529296875,
-0.07537841796875,
-0.003627777099609375,
0.0225372314453125,
-0.02313232421875,
-0.002094268798828125,
0.0093841552734375,
0.041961669921875,
-0.061798095703125,
0.0789794921875,
0.043853759765625,
-0.01287078857421875,
-0.0298004150390625,
0.066162109375,
0.01226043701171875,
-0.0643310546875,
0.00047206878662109375,
-0.019287109375,
0.044586181640625,
-0.05230712890625,
0.0572509765625,
0.006317138671875,
-0.053436279296875,
0.1278076171875,
-0.012603759765625,
0.049285888671875,
-0.04345703125,
0.049530029296875,
-0.001544952392578125,
0.0198211669921875,
0.0132293701171875,
-0.0108642578125,
0.01201629638671875,
0.00872039794921875,
0.01189422607421875,
-0.0341796875,
0.02923583984375,
0.0006542205810546875,
-0.004329681396484375,
0.03076171875,
0.01113128662109375,
0.00008660554885864258,
-0.0063018798828125,
0.053924560546875,
0.0266571044921875,
0.04486083984375,
0.00603485107421875,
0.0060577392578125,
0.031646728515625,
0.0091705322265625,
-0.0184478759765625,
-0.018096923828125,
-0.0019025802612304688,
0.034912109375,
-0.0144500732421875,
0.0140533447265625,
-0.0160369873046875,
-0.005886077880859375,
0.0012264251708984375,
-0.0099945068359375,
-0.03436279296875,
0.0103607177734375,
-0.00852203369140625,
0.0286102294921875,
0.0271148681640625,
0.0684814453125,
-0.00681304931640625,
-0.01480865478515625,
0.0115966796875,
0.00157928466796875,
0.031402587890625,
0.0203399658203125,
0.0007781982421875,
0.0024261474609375,
0.01708984375,
-0.0147552490234375,
0.03204345703125,
0.0280609130859375,
-0.041473388671875,
0.04217529296875,
-0.00722503662109375,
0.00937652587890625,
0.00772857666015625,
0.04046630859375,
0.03704833984375,
-0.068359375,
0.006954193115234375,
0.0191192626953125,
-0.005847930908203125,
-0.0222015380859375,
-0.02752685546875,
0.05609130859375,
0.03265380859375,
-0.034912109375,
-0.01348876953125,
-0.0019140243530273438,
0.01514434814453125,
0.00974273681640625,
0.0222320556640625,
-0.02093505859375,
-0.0350341796875,
-0.037933349609375,
-0.0167694091796875,
0.040374755859375,
-0.00853729248046875,
0.0235443115234375,
-0.00007575750350952148,
0.04229736328125,
0.007965087890625,
-0.0022182464599609375,
-0.0323486328125,
-0.004436492919921875,
0.0230255126953125,
0.0047760009765625,
0.00014984607696533203,
0.0023174285888671875,
-0.0018939971923828125,
-0.0171661376953125,
-0.0191650390625,
-0.00464630126953125,
0.0645751953125,
-0.0198516845703125,
0.053558349609375,
-0.061676025390625,
-0.017333984375,
-0.0088958740234375,
-0.0137176513671875,
0.0928955078125,
0.0653076171875,
-0.07379150390625,
0.014434814453125,
-0.050079345703125,
0.004634857177734375,
-0.03033447265625,
-0.046539306640625,
-0.046844482421875,
-0.0010023117065429688,
0.00661468505859375,
0.01146697998046875,
-0.0086822509765625,
-0.0244140625,
-0.01513671875,
0.024749755859375,
0.0355224609375,
0.06573486328125,
-0.0184326171875,
0.0234222412109375,
0.050018310546875,
0.042938232421875,
0.0027027130126953125,
0.004550933837890625,
0.006900787353515625,
-0.04486083984375,
0.001605987548828125,
-0.0277557373046875,
-0.006256103515625,
-0.03033447265625,
0.0745849609375,
0.0110015869140625,
0.0115966796875,
-0.0011377334594726562,
0.0113067626953125,
-0.01873779296875,
-0.0097198486328125,
-0.024749755859375,
0.01336669921875,
-0.007415771484375,
-0.0161590576171875,
0.033050537109375,
-0.031890869140625,
0.01263427734375,
0.00255584716796875,
0.0035991668701171875,
0.04296875,
-0.0166473388671875,
0.01125335693359375,
0.03826904296875,
-0.0277557373046875,
0.024566650390625,
0.04046630859375,
-0.0194549560546875,
0.020263671875,
-0.01114654541015625,
-0.0223846435546875,
0.0235595703125,
-0.006381988525390625,
-0.024505615234375,
0.01197052001953125,
0.0106964111328125,
-0.016326904296875,
-0.01424407958984375,
-0.027618408203125,
-0.022247314453125,
0.0310821533203125,
0.06396484375,
0.07769775390625,
-0.0743408203125,
-0.005126953125,
0.024871826171875,
-0.033233642578125,
0.00701904296875,
0.004940032958984375,
-0.0079193115234375,
-0.05548095703125,
0.0313720703125,
-0.019287109375,
-0.001583099365234375,
0.01427459716796875,
-0.027252197265625,
-0.028472900390625,
-0.0127716064453125,
0.0201416015625,
0.01131439208984375,
-0.06341552734375,
0.01331329345703125,
0.042755126953125,
-0.0188140869140625,
-0.03485107421875,
-0.004375457763671875,
0.0039043426513671875,
-0.031951904296875,
-0.044769287109375,
0.022430419921875,
0.017547607421875,
0.00673675537109375,
-0.01025390625,
0.03802490234375,
0.0280609130859375,
0.060333251953125,
0.000023186206817626953,
0.0210418701171875,
0.021148681640625,
0.0289459228515625,
-0.0262298583984375,
-0.005184173583984375,
0.0237579345703125,
0.041534423828125,
-0.041168212890625,
0.02581787109375,
-0.0377197265625,
0.006534576416015625,
-0.0172271728515625,
-0.037261962890625,
0.055328369140625,
0.0306549072265625,
-0.05291748046875,
-0.00672149658203125,
0.02777099609375,
-0.00402069091796875,
-0.032318115234375,
0.037353515625,
-0.047760009765625,
0.02197265625,
-0.0234375,
0.02947998046875,
0.0184478759765625,
-0.014892578125,
-0.0684814453125,
0.089111328125,
0.045989990234375,
0.0300445556640625,
0.00991058349609375,
0.0081939697265625,
-0.038238525390625,
-0.0210113525390625,
-0.018310546875,
0.0679931640625,
-0.0078887939453125,
0.0216064453125,
-0.0440673828125,
-0.025146484375,
0.01459503173828125,
0.050201416015625,
-0.0091705322265625,
-0.0149688720703125,
0.00862884521484375,
0.0030231475830078125,
0.056976318359375,
0.03717041015625,
0.00977325439453125,
-0.006439208984375,
0.0052337646484375,
0.0308685302734375,
0.0081939697265625,
-0.0276947021484375,
0.019287109375,
-0.0195159912109375,
-0.0241851806640625,
0.0489501953125,
0.01276397705078125,
0.0008454322814941406,
-0.005352020263671875,
-0.0191192626953125,
-0.01090240478515625,
-0.00921630859375,
-0.01390838623046875,
0.01012420654296875,
-0.0250244140625,
0.0207061767578125,
0.0031757354736328125,
-0.0810546875,
0.0021839141845703125,
-0.04693603515625,
0.0455322265625,
0.0044403076171875,
0.042022705078125,
0.033447265625,
0.0091552734375,
0.0244140625,
0.0081939697265625,
0.021331787109375,
-0.005764007568359375,
-0.0015058517456054688,
0.0231170654296875,
0.00473785400390625,
0.0103759765625,
-0.04815673828125,
-0.003879547119140625,
0.035430908203125,
0.03814697265625,
-0.02886962890625,
0.012237548828125,
0.03192138671875,
0.048736572265625,
-0.0129852294921875,
-0.0255584716796875,
0.01291656494140625,
0.031982421875,
0.037139892578125,
-0.007354736328125,
-0.0255279541015625,
0.035064697265625,
0.00418853759765625,
0.0159454345703125,
-0.000240325927734375,
0.0091400146484375,
-0.0258331298828125,
-0.0211181640625,
0.0262908935546875,
0.01078033447265625,
0.01515960693359375,
-0.0033626556396484375,
0.035675048828125,
-0.00876617431640625,
0.0026607513427734375,
0.00021600723266601562,
0.03900146484375,
-0.01509857177734375,
0.0009169578552246094,
-0.0157623291015625,
-0.0286712646484375,
0.009674072265625,
0.00957489013671875,
0.031951904296875,
-0.01020050048828125,
0.022918701171875,
0.021575927734375,
-0.0157928466796875,
-0.0018548965454101562,
-0.006191253662109375,
-0.005466461181640625,
0.04046630859375,
-0.03167724609375,
0.037628173828125,
-0.00400543212890625,
-0.006687164306640625,
-0.020599365234375,
-0.005340576171875,
0.038848876953125,
-0.031982421875,
0.048919677734375,
-0.0141143798828125,
-0.01953125,
0.0029659271240234375,
-0.0023212432861328125,
0.054473876953125,
-0.01552581787109375,
-0.0848388671875,
-0.003025054931640625,
0.0049896240234375,
-0.046295166015625,
0.0173797607421875,
0.03253173828125,
-0.0245513916015625,
0.017181396484375,
0.032928466796875,
-0.0178070068359375,
0.0157928466796875,
0.024658203125,
-0.022491455078125,
0.020233154296875,
0.038360595703125,
-0.00804901123046875,
-0.012725830078125,
-0.0213623046875,
0.001125335693359375,
0.056396484375,
-0.01314544677734375,
0.08990478515625,
-0.053466796875,
0.025115966796875,
0.028350830078125,
0.03076171875,
-0.0189361572265625,
0.01195526123046875,
0.02899169921875,
-0.0165252685546875,
0.0275421142578125,
-0.0207977294921875,
-0.0860595703125,
0.0070648193359375,
0.034698486328125,
0.0110931396484375,
0.034942626953125,
-0.0183868408203125,
0.0187530517578125,
-0.0174407958984375,
0.0391845703125,
-0.002536773681640625,
-0.0030269622802734375,
0.0225830078125,
-0.0012454986572265625,
0.04254150390625,
0.03497314453125,
0.021728515625,
-0.0066070556640625,
0.0311279296875,
-0.0212860107421875,
0.006649017333984375,
-0.005626678466796875,
0.005367279052734375,
0.0450439453125,
0.02764892578125,
-0.04705810546875,
0.015777587890625,
0.0020656585693359375,
0.0004954338073730469,
0.0139617919921875,
0.03521728515625,
0.0306854248046875,
-0.03521728515625,
-0.0643310546875,
0.00927734375,
0.0343017578125,
-0.007808685302734375,
0.0272674560546875,
-0.0005893707275390625,
-0.033172607421875,
-0.0008244514465332031,
-0.0027866363525390625,
-0.02117919921875,
-0.02899169921875,
-0.0162353515625,
0.00433349609375,
-0.017730712890625,
-0.06719970703125,
-0.05743408203125,
-0.033935546875,
0.0094757080078125,
-0.00891876220703125,
0.03204345703125,
-0.06536865234375,
0.007495880126953125,
-0.004711151123046875,
-0.01374053955078125,
0.031585693359375,
-0.012786865234375,
0.01146697998046875,
-0.01284027099609375,
-0.0254364013671875,
-0.027435302734375,
0.0484619140625,
-0.0253448486328125,
0.0304718017578125,
0.05584716796875,
-0.0279388427734375,
-0.0272369384765625,
0.0297698974609375,
0.010284423828125,
0.08673095703125,
-0.00919342041015625,
-0.0169830322265625,
-0.005992889404296875,
0.053253173828125,
-0.04443359375,
-0.0269775390625,
0.01384735107421875,
0.021240234375,
-0.0036163330078125,
0.0499267578125,
-0.0266876220703125,
-0.003391265869140625,
-0.040130615234375,
-0.06817626953125,
0.01424407958984375,
0.018218994140625,
-0.036468505859375,
0.03826904296875,
0.0040740966796875,
-0.004573822021484375,
-0.023193359375,
0.006015777587890625,
0.0006804466247558594,
-0.01413726806640625,
-0.00821685791015625,
0.016082763671875,
-0.00354766845703125,
0.038726806640625,
-0.030609130859375,
-0.041534423828125,
-0.01617431640625,
-0.01107025146484375,
-0.005481719970703125,
-0.050445556640625,
0.00963592529296875,
-0.005481719970703125,
0.023406982421875,
-0.0296783447265625,
-0.0159912109375,
-0.0013170242309570312,
0.03350830078125,
-0.042022705078125,
-0.029632568359375,
0.0289154052734375,
0.00835418701171875,
0.056304931640625,
0.037750244140625,
-0.00444793701171875,
-0.03289794921875,
-0.042724609375,
0.0045623779296875,
0.017486572265625,
-0.010772705078125,
0.019683837890625,
-0.08740234375,
-0.039459228515625,
0.004711151123046875,
-0.03033447265625,
-0.003650665283203125,
-0.038330078125,
-0.033477783203125,
-0.0036163330078125,
-0.03143310546875,
0.01346588134765625,
0.0015859603881835938,
-0.052978515625,
0.0743408203125,
-0.03753662109375,
0.0147552490234375,
0.002109527587890625,
0.03033447265625,
0.039794921875,
0.01129150390625,
0.01409149169921875,
0.007129669189453125,
-0.0059967041015625,
0.007671356201171875,
0.01708984375,
0.053131103515625,
-0.005657196044921875,
-0.02203369140625,
-0.002613067626953125,
0.0221405029296875,
-0.00592803955078125,
0.0305938720703125,
-0.0261688232421875,
0.0782470703125,
0.0098114013671875,
0.035369873046875,
-0.031768798828125,
0.06890869140625,
0.00904083251953125,
0.01334381103515625,
-0.052825927734375,
0.0132904052734375,
-0.00518035888671875,
-0.0243988037109375,
0.039947509765625,
-0.037750244140625,
0.06158447265625,
0.024993896484375,
-0.0264434814453125,
-0.0545654296875,
-0.018035888671875,
-0.000055849552154541016
] |
5672e76b897a10f76e0a625e06c6db2d68cf82d2
|
Wordpress Stackexchange
Q: prevent wordpress from rendering line breaks as br tags I am tired of WordPress's horrible HTML editor and have decided to write all my html in Notepad++ and then just copy it over. However, simple line breaks "\n" that would be normally ignored in html are converted to <br /> tags. I have disabled the visual editor, so everything I save should be the exact html that is presented. But it's not. how do I stop wordpress from converting my html?
A: That's handled by a filter called wpautop (declared in wp-includes/formatting.php, line 189).
You can remove it with this:
remove_filter('the_content', 'wpautop');
|
Q: prevent wordpress from rendering line breaks as br tags I am tired of WordPress's horrible HTML editor and have decided to write all my html in Notepad++ and then just copy it over. However, simple line breaks "\n" that would be normally ignored in html are converted to <br /> tags. I have disabled the visual editor, so everything I save should be the exact html that is presented. But it's not. how do I stop wordpress from converting my html?
A: That's handled by a filter called wpautop (declared in wp-includes/formatting.php, line 189).
You can remove it with this:
remove_filter('the_content', 'wpautop');
A: Toggle wpautop plugin.
It's the most-popular solution I found, and works well for me. Above plugin page shows 10,000+ installs and 100% 5-star ratings (23 of them) as of 2016-05-21.
The description of the above plugin page:
Before WordPress displays a post's content, the content gets passed
through multiple filters to ensure that it safely appears how you
enter it within the editor.
One of these filters is wpautop, which replaces double line breaks
with <p> tags, and single line breaks with <br /> tags. However, this
filter sometimes causes issues when you are inputting a lot of HTML
markup in the post editor.
This plugin displays a checkbox in the publish meta box of the post
edit screen that disables the wpautop filter for that post.
Also adds a 'wpautop', or 'no-wpautop' class to the post_class filter
to help with CSS styling.
jlengstorf's answer does not appear to apply to my WordPress 4.x installs.
|
wordpress
|
{
"language": "en",
"length": 259,
"provenance": "stackexchange_00019.jsonl.gz:420107",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52665"
}
|
[
0.0241851806640625,
-0.007625579833984375,
-0.00583648681640625,
0.01514434814453125,
-0.0028858184814453125,
-0.0277252197265625,
0.0404052734375,
-0.029815673828125,
0.005859375,
0.00736236572265625,
-0.01320648193359375,
-0.0311126708984375,
0.00933837890625,
-0.037139892578125,
0.01160430908203125,
-0.0278778076171875,
0.01360321044921875,
-0.0104217529296875,
-0.004199981689453125,
-0.01139068603515625,
-0.0082550048828125,
-0.0132598876953125,
0.00577545166015625,
0.00264739990234375,
-0.00788116455078125,
0.0009908676147460938,
0.0765380859375,
-0.047149658203125,
0.01486968994140625,
-0.018463134765625,
0.0113677978515625,
-0.0164642333984375,
0.021392822265625,
0.06304931640625,
-0.106689453125,
0.0226593017578125,
-0.0250091552734375,
0.036346435546875,
-0.01238250732421875,
0.0213775634765625,
-0.00274658203125,
0.00479888916015625,
0.0667724609375,
-0.0540771484375,
-0.00392913818359375,
0.015167236328125,
-0.0092926025390625,
-0.025299072265625,
-0.018707275390625,
0.0171966552734375,
0.0182342529296875,
0.01154327392578125,
0.0269317626953125,
0.0111846923828125,
-0.004756927490234375,
-0.01213836669921875,
0.00400543212890625,
-0.06805419921875,
0.00763702392578125,
-0.009429931640625,
0.01458740234375,
-0.0231781005859375,
0.0298309326171875,
0.0232391357421875,
0.0233001708984375,
0.006702423095703125,
-0.0102996826171875,
0.017333984375,
-0.038726806640625,
0.00972747802734375,
0.0127410888671875,
-0.052276611328125,
0.018890380859375,
-0.051361083984375,
0.0155029296875,
0.02099609375,
-0.04119873046875,
-0.017547607421875,
0.033050537109375,
-0.01788330078125,
0.05841064453125,
-0.0061492919921875,
0.0052642822265625,
-0.05474853515625,
0.03759765625,
-0.0293121337890625,
0.01934814453125,
-0.0007920265197753906,
-0.03240966796875,
-0.036865234375,
-0.0225982666015625,
0.00479888916015625,
-0.08642578125,
-0.0002834796905517578,
-0.018951416015625,
-0.01708984375,
-0.05401611328125,
-0.060699462890625,
-0.0177764892578125,
0.0139617919921875,
0.0264129638671875,
-0.0374755859375,
0.06439208984375,
-0.014068603515625,
0.028472900390625,
0.0203094482421875,
-0.01267242431640625,
0.04364013671875,
0.09930419921875,
0.033477783203125,
0.0260467529296875,
0.0523681640625,
-0.026214599609375,
-0.04852294921875,
0.0234832763671875,
0.03900146484375,
-0.01141357421875,
0.041046142578125,
0.01209259033203125,
-0.0018510818481445312,
-0.0299835205078125,
-0.034271240234375,
-0.0189666748046875,
0.034332275390625,
0.0182037353515625,
-0.00011163949966430664,
-0.0022335052490234375,
0.034820556640625,
-0.030548095703125,
0.0021953582763671875,
0.022705078125,
0.0022220611572265625,
-0.024627685546875,
0.0682373046875,
0.0003921985626220703,
-0.0006208419799804688,
0.051055908203125,
-0.01922607421875,
-0.0350341796875,
0.04156494140625,
-0.051513671875,
-0.024566650390625,
-0.00777435302734375,
-0.07061767578125,
0.006443023681640625,
0.04376220703125,
0.01995849609375,
0.01375579833984375,
-0.01099395751953125,
-0.057281494140625,
0.022308349609375,
-0.0249786376953125,
0.048370361328125,
0.0076446533203125,
0.00095367431640625,
-0.07476806640625,
0.060791015625,
-0.057281494140625,
0.006168365478515625,
-0.072265625,
-0.02813720703125,
-0.0008816719055175781,
0.039276123046875,
-0.08135986328125,
-0.0704345703125,
-0.00232696533203125,
-0.036529541015625,
-0.00710296630859375,
0.0249176025390625,
-0.027374267578125,
0.0007066726684570312,
0.0042572021484375,
0.06536865234375,
0.0005736351013183594,
-0.004688262939453125,
0.01258087158203125,
-0.0187225341796875,
-0.01947021484375,
0.0310211181640625,
0.035736083984375,
0.0161895751953125,
-0.010650634765625,
0.029388427734375,
0.01284027099609375,
-0.083251953125,
0.054718017578125,
0.0093231201171875,
0.1016845703125,
0.05078125,
0.01311492919921875,
0.043060302734375,
-0.024078369140625,
-0.0012083053588867188,
0.00742340087890625,
0.003070831298828125,
-0.0673828125,
-0.005786895751953125,
-0.0200347900390625,
-0.00888824462890625,
0.0184173583984375,
-0.01520538330078125,
0.021148681640625,
-0.0231170654296875,
0.005252838134765625,
-0.0185089111328125,
-0.00632476806640625,
0.0036869049072265625,
0.029327392578125,
0.0129241943359375,
-0.005062103271484375,
-0.007049560546875,
-0.01508331298828125,
-0.0010442733764648438,
-0.03271484375,
-0.04876708984375,
0.02239990234375,
0.0130767822265625,
0.0235443115234375,
0.01557159423828125,
-0.044342041015625,
0.037933349609375,
-0.002681732177734375,
0.046173095703125,
0.037689208984375,
-0.0406494140625,
-0.029327392578125,
-0.029327392578125,
-0.01209259033203125,
-0.058868408203125,
-0.0019664764404296875,
0.0184478759765625,
0.046661376953125,
0.034088134765625,
0.037109375,
-0.0089569091796875,
0.005550384521484375,
0.024688720703125,
-0.0391845703125,
-0.0009202957153320312,
0.0328369140625,
0.045623779296875,
0.058746337890625,
-0.0026340484619140625,
-0.05517578125,
0.0211029052734375,
-0.0662841796875,
0.0250244140625,
-0.061798095703125,
0.006397247314453125,
0.01485443115234375,
-0.01049041748046875,
-0.03662109375,
0.035797119140625,
-0.088134765625,
-0.0180206298828125,
0.05615234375,
-0.0148468017578125,
-0.0207366943359375,
0.0285186767578125,
0.003337860107421875,
0.0153961181640625,
0.02655029296875,
-0.0011281967163085938,
0.004726409912109375,
-0.0190277099609375,
-0.00504302978515625,
0.0193634033203125,
0.0277557373046875,
0.0022716522216796875,
-0.032257080078125,
0.016082763671875,
0.013214111328125,
-0.005992889404296875,
0.0308685302734375,
-0.01068115234375,
0.045135498046875,
-0.034271240234375,
0.0084686279296875,
0.005054473876953125,
0.035003662109375,
-0.020660400390625,
0.039276123046875,
0.0189208984375,
-0.025238037109375,
-0.003299713134765625,
-0.0270843505859375,
0.001617431640625,
-0.043609619140625,
-0.0312347412109375,
-0.010986328125,
0.007579803466796875,
0.0540771484375,
0.004474639892578125,
0.0277557373046875,
-0.0183258056640625,
0.0162506103515625,
0.04205322265625,
-0.02081298828125,
0.03814697265625,
-0.04010009765625,
0.0556640625,
0.05389404296875,
-0.0195465087890625,
-0.00408935546875,
-0.0026092529296875,
0.00376129150390625,
0.0185089111328125,
-0.003345489501953125,
-0.017822265625,
0.009368896484375,
-0.08428955078125,
-0.041717529296875,
0.0087127685546875,
-0.00556182861328125,
-0.0010938644409179688,
-0.0290069580078125,
-0.006175994873046875,
-0.00312042236328125,
-0.059906005859375,
-0.00263214111328125,
-0.003570556640625,
-0.059417724609375,
-0.00720977783203125,
0.045745849609375,
-0.02923583984375,
-0.0106353759765625,
0.0811767578125,
-0.006572723388671875,
-0.006687164306640625,
-0.0194244384765625,
-0.0699462890625,
-0.034149169921875,
-0.06634521484375,
0.06317138671875,
-0.01229095458984375,
0.025604248046875,
0.006885528564453125,
0.037994384765625,
0.01496124267578125,
-0.018890380859375,
0.035430908203125,
0.01436614990234375,
-0.0233154296875,
0.004383087158203125,
0.000934600830078125,
-0.045928955078125,
0.0226593017578125,
-0.007160186767578125,
-0.0142822265625,
0.0113677978515625,
0.006816864013671875,
-0.010345458984375,
-0.0183868408203125,
-0.019989013671875,
0.0031337738037109375,
0.03936767578125,
0.012969970703125,
-0.00909423828125,
0.02264404296875,
-0.043853759765625,
-0.0083160400390625,
0.009429931640625,
-0.01413726806640625,
0.03790283203125,
-0.0214385986328125,
-0.0173187255859375,
-0.0026912689208984375,
0.04290771484375,
0.0160064697265625,
0.0047454833984375,
0.059295654296875,
-0.0129852294921875,
0.0137176513671875,
-0.01088714599609375,
-0.01078033447265625,
-0.0614013671875,
0.0148468017578125,
-0.026580810546875,
0.024200439453125,
0.002765655517578125,
-0.00423431396484375,
-0.0279541015625,
-0.00098419189453125,
-0.040679931640625,
0.0231475830078125,
0.0029735565185546875,
-0.031402587890625,
0.054443359375,
-0.02459716796875,
-0.0197906494140625,
-0.0249786376953125,
0.0496826171875,
-0.00672149658203125,
-0.0108184814453125,
-0.0117034912109375,
0.0095977783203125,
-0.02935791015625,
-0.044158935546875,
-0.03350830078125,
-0.0017118453979492188,
0.01425933837890625,
-0.0208587646484375,
-0.0411376953125,
0.002147674560546875,
-0.019683837890625,
-0.019561767578125,
0.0260009765625,
-0.03033447265625,
0.037384033203125,
-0.0126495361328125,
0.0174713134765625,
-0.00014638900756835938,
0.0093536376953125,
-0.033172607421875,
-0.0079803466796875,
-0.0050506591796875,
-0.0643310546875,
-0.0031147003173828125,
-0.05322265625,
0.03765869140625,
0.0192718505859375,
-0.0122528076171875,
-0.007198333740234375,
0.048736572265625,
0.0162353515625,
-0.0190582275390625,
0.0357666015625,
0.018218994140625,
-0.0056915283203125,
-0.00005739927291870117,
0.0285797119140625,
-0.037628173828125,
-0.01336669921875,
-0.014404296875,
-0.0022430419921875,
0.0176239013671875,
-0.01349639892578125,
-0.0196685791015625,
0.01325225830078125,
-0.01396942138671875,
-0.046234130859375,
-0.033203125,
-0.0188140869140625,
0.023651123046875,
-0.0162353515625,
0.0018863677978515625,
-0.044342041015625,
-0.0394287109375,
0.01244354248046875,
-0.010040283203125,
0.00899505615234375,
0.0290069580078125,
0.053466796875,
0.01456451416015625,
0.005279541015625,
-0.050811767578125,
0.0228118896484375,
0.0313720703125,
-0.003192901611328125,
0.08489990234375,
0.028289794921875,
-0.017333984375,
0.091064453125,
0.00989532470703125,
0.023284912109375,
-0.052093505859375,
0.0733642578125,
-0.0002522468566894531,
0.006420135498046875,
0.018310546875,
-0.0102996826171875,
0.007236480712890625,
0.03326416015625,
0.0240325927734375,
0.002262115478515625,
0.07098388671875,
-0.0155487060546875,
-0.0121917724609375,
-0.046783447265625,
0.018035888671875,
-0.02288818359375,
0.01058197021484375,
0.01087188720703125,
0.03143310546875,
0.03759765625,
0.0014972686767578125,
0.014373779296875,
0.0161590576171875,
-0.0165557861328125,
-0.0204925537109375,
0.006626129150390625,
-0.0281982421875,
0.043182373046875,
-0.06500244140625,
-0.039093017578125,
-0.01070404052734375,
-0.0087890625,
-0.00030517578125,
-0.007076263427734375,
-0.04345703125,
0.0214385986328125,
-0.00949859619140625,
0.00040721893310546875,
0.0275421142578125,
0.034393310546875,
0.006824493408203125,
0.0212554931640625,
0.01018524169921875,
0.00919342041015625,
0.0357666015625,
0.00058746337890625,
-0.034027099609375,
-0.009765625,
0.006710052490234375,
-0.018310546875,
0.05230712890625,
-0.0264739990234375,
0.0216217041015625,
-0.0150146484375,
-0.0146026611328125,
0.02655029296875,
0.032135009765625,
0.01406097412109375,
0.0261077880859375,
-0.01132965087890625,
-0.00768280029296875,
-0.004619598388671875,
-0.0004036426544189453,
-0.044677734375,
-0.0027217864990234375,
0.018157958984375,
0.038787841796875,
-0.0013589859008789062,
-0.0307159423828125,
0.010589599609375,
-0.037109375,
-0.0006437301635742188,
0.00403594970703125,
0.0006256103515625,
-0.00969696044921875,
-0.0174102783203125,
-0.00830078125,
0.025787353515625,
-0.00281524658203125,
0.025238037109375,
-0.026214599609375,
0.048187255859375,
-0.0080108642578125,
0.020233154296875,
-0.040802001953125,
-0.01102447509765625,
0.024810791015625,
-0.01959228515625,
-0.03680419921875,
-0.020477294921875,
-0.0193328857421875,
0.03460693359375,
-0.0273590087890625,
-0.01137542724609375,
0.02423095703125,
-0.044097900390625,
-0.01221466064453125,
-0.03717041015625,
0.056427001953125,
-0.076904296875,
0.0167694091796875,
0.05633544921875,
0.044036865234375,
-0.052520751953125,
-0.00685882568359375,
-0.0496826171875,
-0.0285797119140625,
-0.00598907470703125,
-0.00048470497131347656,
-0.04132080078125,
0.00348663330078125,
-0.0008907318115234375,
0.014556884765625,
-0.022552490234375,
-0.029998779296875,
-0.016876220703125,
0.053619384765625,
0.0280303955078125,
0.0552978515625,
-0.05499267578125,
0.05584716796875,
0.02703857421875,
0.02325439453125,
-0.0360107421875,
-0.0032215118408203125,
-0.000016391277313232422,
0.0176239013671875,
0.03472900390625,
-0.00016236305236816406,
-0.048095703125,
-0.00501251220703125,
-0.034271240234375,
-0.0386962890625,
0.01001739501953125,
-0.02508544921875,
-0.01385498046875,
0.015167236328125,
0.00302886962890625,
-0.0193939208984375,
-0.010009765625,
0.0117340087890625,
0.025848388671875,
-0.054779052734375,
0.002887725830078125,
-0.0033397674560546875,
-0.018646240234375,
0.0037899017333984375,
-0.0038356781005859375,
0.011474609375,
0.00664520263671875,
-0.023468017578125,
0.0088348388671875,
-0.002689361572265625,
0.0121307373046875,
0.013519287109375,
0.0338134765625,
0.02923583984375,
0.036651611328125,
-0.0101165771484375,
0.02569580078125,
0.06292724609375,
-0.0016450881958007812,
0.0268707275390625,
-0.00826263427734375,
0.00440216064453125,
-0.01210784912109375,
-0.036163330078125,
0.052642822265625,
0.07965087890625,
0.10595703125,
-0.098876953125,
0.03619384765625,
0.031768798828125,
-0.012939453125,
0.052215576171875,
-0.0340576171875,
-0.0142822265625,
-0.050872802734375,
0.0634765625,
-0.01364898681640625,
-0.015716552734375,
0.006855010986328125,
-0.01419830322265625,
-0.01031494140625,
-0.04119873046875,
0.0841064453125,
0.00528717041015625,
-0.0609130859375,
0.0011157989501953125,
0.023193359375,
-0.03338623046875,
-0.036346435546875,
-0.003421783447265625,
0.031951904296875,
-0.031951904296875,
-0.0762939453125,
0.02276611328125,
0.0166473388671875,
-0.007678985595703125,
-0.0196380615234375,
-0.005130767822265625,
-0.006542205810546875,
0.0687255859375,
-0.054412841796875,
0.027374267578125,
0.049285888671875,
-0.03802490234375,
0.01071929931640625,
-0.0199737548828125,
-0.00473785400390625,
0.040618896484375,
-0.01091766357421875,
0.01306915283203125,
0.0016469955444335938,
-0.0106353759765625,
0.00046324729919433594,
-0.0196075439453125,
0.0162353515625,
0.024658203125,
-0.029510498046875,
0.038482666015625,
-0.0172119140625,
-0.03131103515625,
-0.04327392578125,
-0.010986328125,
-0.020294189453125,
0.0299530029296875,
-0.05224609375,
0.001880645751953125,
0.025390625,
-0.0750732421875,
-0.0716552734375,
0.0247650146484375,
0.004245758056640625,
0.054901123046875,
0.018341064453125,
-0.0225982666015625,
-0.02783203125,
-0.042510986328125,
-0.0325927734375,
0.0362548828125,
0.0298614501953125,
0.013519287109375,
-0.02911376953125,
-0.014984130859375,
0.01152801513671875,
0.037841796875,
-0.014495849609375,
-0.003978729248046875,
0.0177764892578125,
-0.003879547119140625,
0.0117034912109375,
0.0552978515625,
0.00759124755859375,
-0.0165863037109375,
-0.004695892333984375,
0.0158538818359375,
-0.0036602020263671875,
-0.059417724609375,
0.0224456787109375,
-0.06158447265625,
0.00011473894119262695,
0.0067901611328125,
0.0243377685546875,
0.020782470703125,
-0.0018634796142578125,
-0.0277099609375,
0.00826263427734375,
-0.0021820068359375,
-0.005565643310546875,
-0.03253173828125,
-0.001434326171875,
0.047393798828125,
0.033203125,
-0.071533203125,
-0.032562255859375,
-0.03765869140625,
0.036834716796875,
-0.0005369186401367188,
0.0254669189453125,
0.0193634033203125,
0.0022487640380859375,
0.05255126953125,
-0.0010786056518554688,
0.01219940185546875,
0.022308349609375,
-0.007419586181640625,
-0.038482666015625,
-0.0099029541015625,
0.0110321044921875,
-0.0531005859375,
-0.0224609375,
0.06146240234375,
-0.005619049072265625,
0.010284423828125,
-0.0243988037109375,
-0.001857757568359375,
-0.005035400390625,
0.00783538818359375,
-0.021820068359375,
0.0192108154296875,
-0.037689208984375,
-0.021820068359375,
0.020782470703125,
-0.028533935546875,
0.0019235610961914062,
-0.01212310791015625,
0.021392822265625,
0.0703125,
0.01071929931640625,
-0.026763916015625,
-0.059051513671875,
0.0098114013671875,
0.007648468017578125,
0.049072265625,
0.036224365234375,
0.0194091796875,
0.019134521484375,
-0.02301025390625,
-0.0172882080078125,
0.031982421875,
0.00904083251953125,
-0.00574493408203125,
-0.0146331787109375,
-0.006649017333984375,
-0.0225982666015625,
0.020782470703125,
-0.005645751953125,
-0.01146697998046875,
0.035919189453125,
0.006534576416015625,
-0.0972900390625,
-0.015960693359375,
0.04559326171875,
-0.0352783203125,
-0.07659912109375,
-0.027923583984375,
-0.05352783203125,
0.0303802490234375,
0.0143280029296875,
0.040924072265625,
-0.00537872314453125,
0.0360107421875,
0.00246429443359375,
0.040863037109375,
0.0032196044921875,
0.0184478759765625,
0.00144195556640625,
-0.009368896484375,
-0.02813720703125,
0.027496337890625,
-0.039520263671875,
-0.0031909942626953125,
-0.019012451171875,
-0.033172607421875,
0.02740478515625,
0.0333251953125,
-0.040557861328125,
0.0291900634765625,
-0.0106658935546875,
-0.01047515869140625,
0.0272674560546875,
-0.0367431640625,
0.0062713623046875,
0.011077880859375,
0.008331298828125,
-0.01381683349609375,
-0.08721923828125,
-0.0572509765625,
-0.061370849609375,
0.04339599609375,
0.0219268798828125,
0.103759765625,
-0.0012884140014648438,
0.0438232421875,
-0.014495849609375,
0.01513671875,
-0.00662994384765625,
-0.006359100341796875,
0.0014295578002929688,
0.0285491943359375,
0.01373291015625,
-0.0286712646484375,
-0.028656005859375,
0.0171966552734375,
0.0262451171875,
-0.019866943359375,
0.0006337165832519531,
0.000560760498046875,
0.0092926025390625,
-0.01244354248046875,
0.0108489990234375,
-0.0015649795532226562,
-0.0198516845703125,
-0.014617919921875,
-0.0166473388671875,
0.03997802734375,
0.036224365234375,
0.00189208984375,
0.064697265625,
0.00971221923828125,
-0.01374053955078125,
0.0292205810546875,
-0.07281494140625,
0.0163726806640625,
0.034088134765625,
0.01326751708984375,
0.01525115966796875,
0.00913238525390625,
-0.02740478515625,
0.004589080810546875,
0.0012683868408203125,
0.01165771484375,
0.000278472900390625,
-0.0543212890625,
0.0021190643310546875,
0.02337646484375,
0.066650390625,
0.0185394287109375,
0.0274658203125,
-0.00592803955078125,
0.0196990966796875,
-0.016754150390625,
0.001628875732421875,
-0.01088714599609375,
-0.00090789794921875,
-0.007022857666015625,
0.0221710205078125,
-0.002880096435546875,
-0.0018930435180664062,
-0.08331298828125,
-0.0120697021484375,
0.0233917236328125,
-0.0189971923828125,
0.002529144287109375,
-0.0007586479187011719,
-0.048004150390625,
0.01314544677734375,
-0.01317596435546875,
0.03533935546875,
-0.01168060302734375,
0.00644683837890625,
-0.040771484375,
-0.0858154296875,
-0.03363037109375,
0.08642578125,
-0.0394287109375,
0.0117034912109375,
0.025970458984375,
0.0073699951171875,
-0.01324462890625,
-0.0106964111328125,
-0.00833892822265625,
0.038330078125,
0.02166748046875,
-0.0225372314453125,
0.0028781890869140625,
-0.0014171600341796875,
0.00794219970703125,
-0.0013971328735351562,
0.00861358642578125,
-0.01039886474609375,
-0.0149993896484375,
-0.0291290283203125,
-0.00901031494140625,
-0.0168914794921875,
-0.0704345703125,
-0.09765625,
-0.048797607421875,
0.005825042724609375,
-0.041839599609375,
0.0186004638671875,
-0.0220794677734375,
-0.0199127197265625,
-0.007213592529296875,
0.01123809814453125,
-0.004077911376953125,
0.007781982421875,
0.03106689453125,
0.007488250732421875,
0.0277252197265625,
0.00904083251953125,
-0.00504302978515625,
0.0020847320556640625,
0.043914794921875,
0.040802001953125,
-0.009735107421875,
-0.050689697265625,
0.028656005859375,
-0.01042938232421875,
0.03167724609375,
0.003162384033203125,
0.0305328369140625,
0.028564453125,
-0.01617431640625,
0.0258026123046875,
-0.0338134765625,
-0.0098876953125,
-0.03302001953125,
-0.0234375,
0.019287109375,
-0.01107025146484375,
-0.0009183883666992188,
0.0182342529296875,
-0.007152557373046875,
-0.01082611083984375,
-0.005046844482421875,
-0.0040740966796875,
-0.05120849609375,
-0.0174102783203125,
-0.004360198974609375,
-0.0151214599609375,
0.0274658203125,
-0.05096435546875,
-0.0298309326171875,
-0.005023956298828125,
-0.03692626953125,
0.0024242401123046875,
-0.006221771240234375,
-0.049774169921875,
0.0499267578125,
-0.0279388427734375,
-0.0240631103515625,
0.00769805908203125,
0.035400390625,
0.00502777099609375,
0.028076171875,
-0.02880859375,
0.00608062744140625,
-0.027374267578125,
0.00438690185546875,
0.0004112720489501953,
0.0245208740234375,
-0.0019178390502929688,
0.0171966552734375,
0.01010894775390625,
-0.01297760009765625,
-0.00960540771484375,
-0.004058837890625,
0.014923095703125,
-0.0201568603515625,
-0.0298309326171875,
-0.00365447998046875,
-0.014678955078125,
-0.0185394287109375,
-0.021636962890625,
0.0257568359375,
-0.033905029296875,
0.0173797607421875,
-0.0243682861328125,
-0.0282135009765625,
0.00942230224609375,
0.0296630859375,
-0.0113067626953125,
-0.0438232421875,
0.0241546630859375,
0.04266357421875,
0.0194091796875,
0.01171112060546875
] |
606f2f0195d745d4cfd0ccd38d392a6c5aac832c
|
Wordpress Stackexchange
Q: How to remove duplicate link from add_menu_page In the theme admin menu below, the "MyTheme Menu Label" is being duplicated twice on the sidebar menu, once for the main menu link and again for the first submenu link.
How can I remove the 2nd instance of the link
add_menu_page(
"MyTheme",
"MyTheme Menu Label", //THIS IS REPEATED TWICE IN THE MENU
"edit_themes",
"functions.php",
'theme_admin',
get_bloginfo('template_directory') .'/img/favicon.png',31
);
add_submenu_page(
'functions.php',
"SEO Options",
"SEO",
'edit_themes',
'my-seo-options',
'theme_admin'
);
add_submenu_page(
'functions.php',
"Misc Options",
"Misc",
'edit_themes',
'my-misc-options',
'theme_admin'
);
//etc...
A: From the codex page on admin menus:
In situations where a plugin is creating its own top-level menu, the first submenu will normally have the same link title as the top-level menu and hence the link will be duplicated. The duplicate link title can be avoided by calling the add_submenu_page function the first time with the parent_slug and menu_slug parameters being given the same value.
Personally, I think that it would be bad practice to do anything but rename the top link, as it would break consistency with the rest of the admin bar.
|
Q: How to remove duplicate link from add_menu_page In the theme admin menu below, the "MyTheme Menu Label" is being duplicated twice on the sidebar menu, once for the main menu link and again for the first submenu link.
How can I remove the 2nd instance of the link
add_menu_page(
"MyTheme",
"MyTheme Menu Label", //THIS IS REPEATED TWICE IN THE MENU
"edit_themes",
"functions.php",
'theme_admin',
get_bloginfo('template_directory') .'/img/favicon.png',31
);
add_submenu_page(
'functions.php',
"SEO Options",
"SEO",
'edit_themes',
'my-seo-options',
'theme_admin'
);
add_submenu_page(
'functions.php',
"Misc Options",
"Misc",
'edit_themes',
'my-misc-options',
'theme_admin'
);
//etc...
A: From the codex page on admin menus:
In situations where a plugin is creating its own top-level menu, the first submenu will normally have the same link title as the top-level menu and hence the link will be duplicated. The duplicate link title can be avoided by calling the add_submenu_page function the first time with the parent_slug and menu_slug parameters being given the same value.
Personally, I think that it would be bad practice to do anything but rename the top link, as it would break consistency with the rest of the admin bar.
A: There is a workaround to hide this automatically created submenu. In the past I've used it quite often, but lately I have returned to leaving it as is (or renaming it, as m0r7if3r suggested).
Also note, that aside your main question, you have switched the positions of the menu_slug and function arguments in add_menu_page, see the codex for reference.
This is how it is done anyhow:
/* Add top level menu */
add_menu_page(
'MyTheme',
'MyTheme Menu Label',
'edit_themes',
'theme_admin', // menu slug
'functions.php', // function
get_bloginfo('template_directory') .'/img/favicon.png',
31
);
/* remove duplicate menu hack */
add_submenu_page(
'theme_admin', // parent slug, same as above menu slug
'', // empty page title
'', // empty menu title
'edit_themes', // same capability as above
'theme_admin', // same menu slug as parent slug
'functions.php', // same function as above
}
This isn't too clean, but afaik the only way to hide the duplicate submenu.
A: There's a function that should cover this:
remove_submenu_page( $plugin_slug, $plugin_slug );
|
wordpress
|
{
"language": "en",
"length": 344,
"provenance": "stackexchange_00019.jsonl.gz:420110",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52675"
}
|
[
0.0732421875,
0.00665283203125,
0.017364501953125,
-0.00189208984375,
0.036102294921875,
-0.04229736328125,
0.0860595703125,
-0.04913330078125,
-0.07952880859375,
0.04559326171875,
0.06695556640625,
0.0106201171875,
0.0075225830078125,
-0.046417236328125,
0.0198516845703125,
0.01303863525390625,
0.0111541748046875,
0.02374267578125,
0.016357421875,
-0.006305694580078125,
-0.0259552001953125,
0.0168609619140625,
-0.01922607421875,
0.026031494140625,
0.004222869873046875,
-0.05517578125,
0.0206298828125,
-0.011993408203125,
-0.006076812744140625,
-0.0260009765625,
-0.002819061279296875,
0.05889892578125,
0.0323486328125,
-0.0258636474609375,
0.024383544921875,
-0.0145263671875,
0.0017919540405273438,
-0.0156707763671875,
0.004474639892578125,
-0.006320953369140625,
0.0236968994140625,
-0.0084381103515625,
0.00704193115234375,
-0.00109100341796875,
-0.032623291015625,
-0.0077972412109375,
0.0031452178955078125,
0.00011557340621948242,
0.0007772445678710938,
-0.024139404296875,
0.04058837890625,
-0.033355712890625,
0.04766845703125,
0.0257110595703125,
-0.0199127197265625,
0.0303192138671875,
-0.0082550048828125,
-0.0301971435546875,
0.00469207763671875,
0.05047607421875,
0.00408935546875,
0.0129547119140625,
0.006374359130859375,
-0.02978515625,
-0.0031833648681640625,
-0.0005850791931152344,
-0.01476287841796875,
0.0111541748046875,
-0.029266357421875,
0.01153564453125,
0.0257110595703125,
-0.0280609130859375,
0.0085601806640625,
0.0180511474609375,
-0.01306915283203125,
-0.0419921875,
0.000013053417205810547,
-0.0029697418212890625,
0.0328369140625,
0.00461578369140625,
0.01065826416015625,
0.0092010498046875,
-0.02490234375,
0.021484375,
-0.01081085205078125,
0.034820556640625,
-0.019500732421875,
-0.0253448486328125,
-0.029754638671875,
0.017791748046875,
-0.02923583984375,
-0.066162109375,
0.0233917236328125,
0.026275634765625,
-0.006389617919921875,
0.006317138671875,
0.06365966796875,
0.1116943359375,
0.0087127685546875,
0.00926971435546875,
-0.00612640380859375,
-0.031219482421875,
0.0007772445678710938,
-0.06463623046875,
0.0093994140625,
0.05438232421875,
-0.00435638427734375,
0.0187835693359375,
0.054779052734375,
0.0081024169921875,
0.005718231201171875,
0.03564453125,
0.00859832763671875,
-0.071044921875,
0.02130126953125,
0.040435791015625,
-0.0026874542236328125,
0.01922607421875,
0.0243072509765625,
-0.0257720947265625,
-0.013153076171875,
0.01751708984375,
-0.032806396484375,
0.0102691650390625,
0.030364990234375,
0.0253143310546875,
-0.003307342529296875,
0.01113128662109375,
-0.0287322998046875,
0.0169830322265625,
-0.036102294921875,
0.00246429443359375,
0.07537841796875,
0.0386962890625,
0.0162353515625,
-0.0264739990234375,
-0.00637054443359375,
0.00283050537109375,
0.016998291015625,
-0.006378173828125,
0.00286102294921875,
-0.0125732421875,
0.0328369140625,
-0.01065826416015625,
0.0003361701965332031,
0.027099609375,
-0.0122528076171875,
-0.0159454345703125,
0.034698486328125,
-0.012176513671875,
-0.0254364013671875,
-0.06256103515625,
0.045562744140625,
0.005401611328125,
-0.061187744140625,
-0.005046844482421875,
-0.0248870849609375,
-0.005374908447265625,
-0.005889892578125,
-0.0249176025390625,
-0.0084381103515625,
-0.0143280029296875,
0.0257110595703125,
-0.02252197265625,
-0.048675537109375,
0.0239410400390625,
-0.034088134765625,
-0.01201629638671875,
0.0163116455078125,
-0.0258331298828125,
0.0268402099609375,
-0.025726318359375,
-0.0208587646484375,
0.0003666877746582031,
0.0099334716796875,
0.0218353271484375,
0.03033447265625,
0.0130462646484375,
-0.017303466796875,
0.042236328125,
-0.0167083740234375,
-0.04620361328125,
0.02081298828125,
-0.0299072265625,
-0.094482421875,
0.021942138671875,
-0.01500701904296875,
0.061920166015625,
0.06353759765625,
0.0018186569213867188,
0.051025390625,
-0.0296478271484375,
-0.01512908935546875,
0.0114288330078125,
-0.0209808349609375,
-0.04754638671875,
0.02142333984375,
-0.0009760856628417969,
-0.02801513671875,
0.02947998046875,
-0.032867431640625,
0.03790283203125,
-0.0100860595703125,
0.043609619140625,
-0.0164337158203125,
0.03253173828125,
-0.0111846923828125,
0.0301361083984375,
0.012420654296875,
0.014068603515625,
0.005908966064453125,
-0.005710601806640625,
-0.01192474365234375,
-0.01076507568359375,
-0.0229339599609375,
0.008880615234375,
-0.00010007619857788086,
-0.007648468017578125,
-0.01654052734375,
0.0285797119140625,
-0.02447509765625,
-0.030517578125,
-0.04937744140625,
0.004962921142578125,
0.0189361572265625,
-0.008575439453125,
-0.037017822265625,
-0.0203399658203125,
-0.034423828125,
-0.0104217529296875,
-0.047210693359375,
0.09088134765625,
0.07940673828125,
0.049957275390625,
-0.0301513671875,
0.0117645263671875,
0.006862640380859375,
-0.038818359375,
-0.0290985107421875,
0.0357666015625,
0.040283203125,
0.0126953125,
0.00865936279296875,
0.015960693359375,
0.0179595947265625,
-0.07080078125,
-0.0004525184631347656,
-0.00630950927734375,
-0.001125335693359375,
0.0129852294921875,
0.004055023193359375,
-0.0250091552734375,
0.0212860107421875,
-0.0083465576171875,
0.0262908935546875,
0.0105438232421875,
-0.0072021484375,
-0.0253448486328125,
0.004535675048828125,
0.0014791488647460938,
0.01641845703125,
-0.02264404296875,
-0.0293731689453125,
0.0026302337646484375,
0.021240234375,
0.004222869873046875,
0.00858306884765625,
0.0008459091186523438,
-0.041015625,
-0.003993988037109375,
0.044952392578125,
0.04998779296875,
-0.017974853515625,
0.0130767822265625,
0.034698486328125,
-0.079345703125,
-0.036956787109375,
0.0165863037109375,
-0.0267486572265625,
-0.029510498046875,
-0.0102081298828125,
0.01556396484375,
-0.017242431640625,
-0.012542724609375,
-0.0206298828125,
-0.06549072265625,
-0.0021610260009765625,
0.019287109375,
-0.005207061767578125,
0.004608154296875,
0.031463623046875,
-0.0251007080078125,
-0.03302001953125,
0.017822265625,
-0.00634002685546875,
-0.032440185546875,
0.034393310546875,
0.0121917724609375,
0.0091552734375,
0.0135345458984375,
0.04412841796875,
0.038482666015625,
0.010955810546875,
-0.01360321044921875,
-0.0020961761474609375,
-0.008697509765625,
-0.037384033203125,
0.005176544189453125,
-0.00920867919921875,
0.019378662109375,
-0.06182861328125,
0.058746337890625,
0.0113525390625,
0.01328277587890625,
-0.00909423828125,
-0.049713134765625,
-0.0285797119140625,
0.00458526611328125,
-0.06927490234375,
-0.0261077880859375,
-0.017486572265625,
-0.005367279052734375,
0.018951416015625,
0.042816162109375,
0.004245758056640625,
-0.023529052734375,
0.06976318359375,
0.0191192626953125,
0.053466796875,
-0.048614501953125,
-0.039886474609375,
-0.0302886962890625,
-0.041717529296875,
-0.022796630859375,
-0.0016984939575195312,
-0.029296875,
0.01094818115234375,
0.0236358642578125,
0.0207366943359375,
-0.0008630752563476562,
0.06805419921875,
0.0160064697265625,
-0.0017833709716796875,
0.0175933837890625,
0.0229034423828125,
0.01016998291015625,
0.00806427001953125,
0.00955963134765625,
-0.0021839141845703125,
0.025909423828125,
-0.036041259765625,
-0.0294952392578125,
0.00826263427734375,
0.045013427734375,
0.043609619140625,
-0.01361846923828125,
-0.0192718505859375,
0.07171630859375,
0.038299560546875,
0.00499725341796875,
-0.033966064453125,
-0.0197296142578125,
-0.045562744140625,
0.0270538330078125,
0.0167236328125,
0.0160675048828125,
-0.0125274658203125,
0.031402587890625,
0.01544952392578125,
0.00624847412109375,
0.04425048828125,
0.00033092498779296875,
-0.0204010009765625,
-0.0241546630859375,
-0.00937652587890625,
-0.0309600830078125,
0.04986572265625,
0.00037550926208496094,
-0.00667572021484375,
0.018829345703125,
0.02655029296875,
0.021392822265625,
-0.0102691650390625,
-0.0016279220581054688,
0.0038299560546875,
0.0428466796875,
-0.00923919677734375,
0.058685302734375,
-0.02880859375,
-0.0309906005859375,
-0.039520263671875,
0.070556640625,
-0.04144287109375,
-0.0181427001953125,
-0.0261688232421875,
0.0074462890625,
0.0307159423828125,
-0.0280609130859375,
-0.010589599609375,
-0.0242767333984375,
-0.08929443359375,
0.0197906494140625,
-0.0016889572143554688,
-0.0135955810546875,
-0.0161590576171875,
0.0472412109375,
-0.053009033203125,
-0.03387451171875,
0.05145263671875,
-0.0648193359375,
0.0028743743896484375,
0.0711669921875,
-0.037872314453125,
0.0382080078125,
-0.06671142578125,
-0.04132080078125,
-0.027130126953125,
-0.0114593505859375,
-0.0309600830078125,
0.0601806640625,
0.0318603515625,
-0.0299072265625,
-0.004039764404296875,
0.0293426513671875,
0.03106689453125,
0.032928466796875,
0.00933074951171875,
-0.0249176025390625,
0.026611328125,
0.0093841552734375,
0.022308349609375,
-0.005893707275390625,
0.0021724700927734375,
0.00081634521484375,
-0.061279296875,
-0.00408172607421875,
-0.01084136962890625,
0.0289459228515625,
0.03656005859375,
-0.0296478271484375,
-0.0841064453125,
-0.040679931640625,
0.01617431640625,
-0.024383544921875,
0.0222930908203125,
-0.0116119384765625,
-0.0186767578125,
-0.04803466796875,
-0.03961181640625,
-0.0203094482421875,
-0.035614013671875,
0.020843505859375,
0.0181732177734375,
0.03045654296875,
0.0025634765625,
-0.0008487701416015625,
0.0068359375,
0.01181793212890625,
-0.0302276611328125,
0.03778076171875,
0.0024852752685546875,
0.00936126708984375,
0.041839599609375,
-0.040740966796875,
0.01303863525390625,
0.007083892822265625,
0.042816162109375,
-0.00018107891082763672,
-0.0019092559814453125,
0.00585174560546875,
-0.0181427001953125,
0.0004596710205078125,
0.0093994140625,
-0.0220947265625,
0.01169586181640625,
-0.056304931640625,
0.02276611328125,
0.0212554931640625,
-0.00016570091247558594,
-0.04718017578125,
0.008941650390625,
-0.01323699951171875,
0.003131866455078125,
0.049713134765625,
0.0244293212890625,
-0.01096343994140625,
-0.01148223876953125,
0.0188140869140625,
-0.00551605224609375,
-0.0173797607421875,
0.032501220703125,
-0.00148773193359375,
0.029632568359375,
-0.0248565673828125,
-0.01480865478515625,
-0.03631591796875,
-0.00867462158203125,
0.04779052734375,
0.07196044921875,
0.0264129638671875,
-0.0024623870849609375,
0.0160064697265625,
0.00034618377685546875,
-0.072509765625,
0.048431396484375,
0.0251922607421875,
-0.016876220703125,
-0.0032787322998046875,
-0.01507568359375,
0.0231781005859375,
-0.015655517578125,
-0.0184326171875,
0.005229949951171875,
0.00830841064453125,
-0.02679443359375,
0.052947998046875,
-0.0050811767578125,
0.037506103515625,
0.0036258697509765625,
-0.032867431640625,
-0.0158233642578125,
0.0220794677734375,
0.029876708984375,
0.01383209228515625,
-0.006702423095703125,
-0.01425933837890625,
0.0262603759765625,
0.0533447265625,
-0.03326416015625,
-0.011993408203125,
0.042236328125,
0.0290679931640625,
0.041015625,
0.0022144317626953125,
-0.035736083984375,
-0.004909515380859375,
-0.018646240234375,
0.0277252197265625,
-0.046051025390625,
-0.0745849609375,
-0.0218353271484375,
0.01410675048828125,
0.026123046875,
-0.039459228515625,
-0.0175628662109375,
0.0092926025390625,
-0.01910400390625,
0.01023101806640625,
-0.007236480712890625,
-0.035675048828125,
0.00893402099609375,
0.0169219970703125,
-0.0246124267578125,
-0.021728515625,
0.01062774658203125,
-0.069580078125,
-0.0281829833984375,
-0.00870513916015625,
0.022216796875,
0.0287628173828125,
-0.001644134521484375,
0.045654296875,
-0.006031036376953125,
-0.040069580078125,
0.0243377685546875,
0.00609588623046875,
0.046234130859375,
0.0091705322265625,
-0.04949951171875,
0.002197265625,
-0.0341796875,
0.006313323974609375,
-0.0095367431640625,
-0.052032470703125,
-0.020111083984375,
-0.004512786865234375,
-0.023162841796875,
0.001758575439453125,
-0.01180267333984375,
0.0215911865234375,
-0.007160186767578125,
0.0148162841796875,
-0.00958251953125,
-0.00484466552734375,
-0.0214385986328125,
0.0384521484375,
0.00267791748046875,
-0.01178741455078125,
-0.0018777847290039062,
0.024749755859375,
0.03265380859375,
-0.0205841064453125,
-0.0027332305908203125,
-0.03619384765625,
0.005161285400390625,
-0.027801513671875,
0.03424072265625,
0.01763916015625,
0.039886474609375,
0.0168914794921875,
0.03955078125,
0.00902557373046875,
0.0018138885498046875,
-0.00992584228515625,
-0.0020732879638671875,
-0.012847900390625,
0.0300750732421875,
0.040313720703125,
-0.05126953125,
0.0246734619140625,
0.0158233642578125,
0.02105712890625,
0.00531768798828125,
-0.0572509765625,
0.01282501220703125,
0.042022705078125,
-0.044708251953125,
0.048553466796875,
0.041656494140625,
-0.004016876220703125,
0.0380859375,
-0.00148773193359375,
0.0233306884765625,
0.0274505615234375,
-0.0190582275390625,
0.0277557373046875,
0.053314208984375,
0.043701171875,
-0.0205230712890625,
0.029632568359375,
0.0287628173828125,
-0.017242431640625,
0.0018587112426757812,
0.02191162109375,
0.0552978515625,
-0.0399169921875,
0.006175994873046875,
0.0235137939453125,
-0.00775909423828125,
-0.0008282661437988281,
0.02142333984375,
0.03143310546875,
0.00905609130859375,
0.0279693603515625,
-0.028228759765625,
0.003032684326171875,
0.0151519775390625,
-0.036529541015625,
-0.0254364013671875,
0.00457000732421875,
0.0251007080078125,
0.018280029296875,
0.056182861328125,
-0.042083740234375,
-0.0270538330078125,
-0.01236724853515625,
-0.016204833984375,
-0.00921630859375,
0.01629638671875,
-0.031494140625,
-0.07244873046875,
-0.005519866943359375,
-0.032318115234375,
-0.00641632080078125,
0.01483917236328125,
0.0430908203125,
0.00881195068359375,
0.025360107421875,
0.005252838134765625,
-0.007068634033203125,
-0.0162506103515625,
0.004055023193359375,
0.056060791015625,
-0.0293121337890625,
-0.0009832382202148438,
-0.05938720703125,
-0.0278778076171875,
-0.0098419189453125,
-0.0247955322265625,
-0.037841796875,
-0.0101470947265625,
-0.00506591796875,
0.1142578125,
-0.04974365234375,
-0.031005859375,
0.0254669189453125,
-0.019927978515625,
-0.0131072998046875,
-0.044464111328125,
0.053558349609375,
-0.09307861328125,
-0.048675537109375,
-0.00390625,
-0.035675048828125,
-0.0347900390625,
-0.0423583984375,
-0.07904052734375,
0.1075439453125,
-0.0343017578125,
0.035736083984375,
-0.01953125,
0.058258056640625,
0.015899658203125,
0.040283203125,
-0.0180816650390625,
0.07086181640625,
0.032440185546875,
0.0240631103515625,
-0.0185546875,
-0.00762939453125,
0.0231170654296875,
0.0139007568359375,
0.029144287109375,
0.016571044921875,
0.003078460693359375,
0.0163421630859375,
0.06109619140625,
-0.01116943359375,
-0.0186767578125,
0.03125,
-0.007160186767578125,
-0.0239410400390625,
0.0216217041015625,
-0.0275421142578125,
0.0272674560546875,
-0.036956787109375,
0.007106781005859375,
0.0175018310546875,
-0.00438690185546875,
-0.005611419677734375,
0.0015382766723632812,
0.00988006591796875,
0.01120758056640625,
-0.01129150390625,
-0.004276275634765625,
-0.0301055908203125,
-0.004207611083984375,
0.0150299072265625,
-0.0014591217041015625,
-0.035980224609375,
-0.0278778076171875,
-0.0190582275390625,
0.0204620361328125,
0.01285552978515625,
0.00669097900390625,
-0.0241241455078125,
0.006595611572265625,
0.034088134765625,
-0.036712646484375,
-0.0178375244140625,
0.0401611328125,
-0.036346435546875,
0.011138916015625,
0.002269744873046875,
0.04888916015625,
-0.0499267578125,
-0.054046630859375,
0.0190277099609375,
0.041290283203125,
-0.006320953369140625,
-0.04754638671875,
0.01605224609375,
-0.0301361083984375,
-0.0307159423828125,
0.032958984375,
-0.0205841064453125,
-0.0088348388671875,
0.0256805419921875,
0.0016489028930664062,
-0.0173492431640625,
0.01401519775390625,
0.01251220703125,
0.0012054443359375,
-0.002452850341796875,
0.03472900390625,
-0.00021708011627197266,
-0.07293701171875,
0.0457763671875,
0.0280303955078125,
0.0714111328125,
0.006549835205078125,
0.06927490234375,
0.00331878662109375,
-0.045074462890625,
-0.01490020751953125,
0.01212310791015625,
-0.0107269287109375,
0.019622802734375,
-0.05572509765625,
-0.06524658203125,
0.044525146484375,
0.037384033203125,
-0.01482391357421875,
0.03314208984375,
0.04095458984375,
0.021026611328125,
-0.0155487060546875,
-0.0125885009765625,
0.006290435791015625,
-0.034942626953125,
0.014373779296875,
-0.0225982666015625,
-0.030059814453125,
-0.03167724609375,
-0.0204620361328125,
-0.0119171142578125,
-0.004878997802734375,
-0.01316070556640625,
0.028167724609375,
-0.017486572265625,
0.0154266357421875,
-0.015167236328125,
0.05145263671875,
0.00972747802734375,
0.0300140380859375,
0.054901123046875,
-0.0601806640625,
0.0009055137634277344,
-0.0135345458984375,
-0.034637451171875,
0.031524658203125,
0.03436279296875,
-0.03399658203125,
0.0474853515625,
0.0262908935546875,
-0.01348876953125,
-0.0221099853515625,
0.004253387451171875,
0.03125,
0.0205841064453125,
-0.009033203125,
0.034454345703125,
-0.025634765625,
-0.0031108856201171875,
0.0248565673828125,
-0.01470947265625,
0.01393890380859375,
0.006603240966796875,
0.025787353515625,
0.015533447265625,
-0.030120849609375,
0.0204620361328125,
-0.04034423828125,
-0.0285797119140625,
0.01415252685546875,
0.01055145263671875,
0.0035037994384765625,
0.0007457733154296875,
-0.056793212890625,
-0.0027313232421875,
0.057861328125,
-0.042083740234375,
0.02166748046875,
0.00803375244140625,
0.0135650634765625,
-0.062286376953125,
0.040618896484375,
0.004093170166015625,
-0.010528564453125,
0.01910400390625,
0.0191192626953125,
0.0306243896484375,
0.07049560546875,
-0.0015783309936523438,
0.011962890625,
0.01727294921875,
-0.0074920654296875,
0.00835418701171875,
0.006900787353515625,
0.014251708984375,
0.035125732421875,
-0.012786865234375,
0.01186370849609375,
0.035247802734375,
-0.01287078857421875,
0.029998779296875,
0.0089569091796875,
0.021942138671875,
0.024322509765625,
-0.025604248046875,
0.0626220703125,
0.019744873046875,
0.02490234375,
-0.049774169921875,
-0.0101165771484375,
0.051025390625,
0.003604888916015625,
0.00972747802734375,
0.0228271484375,
-0.03173828125,
-0.0264129638671875,
-0.01036834716796875,
0.005626678466796875,
-0.00350189208984375,
-0.0347900390625,
-0.061248779296875,
0.019378662109375,
0.044708251953125,
0.00893402099609375,
-0.05780029296875,
0.022613525390625,
-0.005126953125,
0.04644775390625,
0.0106964111328125,
0.0150146484375,
-0.027313232421875,
-0.028289794921875,
-0.057891845703125,
-0.032470703125,
-0.0650634765625,
0.0271453857421875,
-0.06292724609375,
-0.01409912109375,
-0.0011281967163085938,
-0.010833740234375,
0.0183563232421875,
-0.049102783203125,
0.00754547119140625,
-0.002685546875,
0.02587890625,
-0.01422119140625,
0.02392578125,
-0.0102081298828125,
-0.00992584228515625,
-0.035614013671875,
-0.005504608154296875,
-0.044189453125,
-0.0095672607421875,
-0.02142333984375,
-0.0130462646484375,
-0.0126190185546875,
-0.0440673828125,
-0.0235748291015625,
0.075927734375,
0.002582550048828125,
-0.01922607421875,
-0.0121002197265625,
-0.00864410400390625,
-0.05438232421875,
0.07061767578125,
0.001552581787109375,
-0.0056915283203125,
0.032989501953125,
0.059967041015625,
-0.013702392578125,
0.05767822265625,
-0.01154327392578125,
0.017974853515625,
-0.0137481689453125,
0.007534027099609375,
-0.00789642333984375,
-0.0230712890625,
0.0245361328125,
-0.0247802734375,
0.04998779296875,
0.0285186767578125,
-0.03546142578125,
-0.0128326416015625,
-0.006198883056640625,
0.0018825531005859375,
-0.0172882080078125,
0.041473388671875,
-0.014739990234375,
0.0127716064453125,
0.08294677734375,
0.048187255859375,
0.031524658203125,
-0.039947509765625,
-0.057373046875,
-0.0450439453125,
-0.0187835693359375,
-0.01003265380859375,
0.033782958984375,
-0.1099853515625,
0.004810333251953125,
0.042633056640625,
-0.00418853759765625,
-0.01221466064453125,
0.00662994384765625,
-0.040802001953125,
-0.02020263671875,
0.0074310302734375,
0.0187225341796875,
-0.05780029296875,
0.0173492431640625,
0.0322265625,
-0.03619384765625,
-0.0192108154296875,
-0.0009722709655761719,
-0.002735137939453125,
-0.0072784423828125,
0.0008726119995117188,
0.0198516845703125,
-0.0016641616821289062,
-0.0369873046875,
0.01015472412109375,
0.01035308837890625,
0.033843994140625,
-0.02496337890625,
-0.049285888671875,
-0.045623779296875,
-0.0018472671508789062,
0.00902557373046875,
-0.01464080810546875,
0.00196075439453125,
0.040191650390625,
0.0302276611328125,
0.0926513671875,
-0.0182952880859375,
0.08477783203125,
-0.000232696533203125,
0.037994384765625,
-0.01983642578125,
0.0012073516845703125,
0.03485107421875,
-0.031494140625,
-0.017547607421875,
0.03228759765625,
-0.029327392578125,
-0.07891845703125,
0.034637451171875,
0.00611114501953125,
0.034423828125,
0.031494140625
] |
ec812b9bba7ac4e31f05dbb8cfa73540410ab861
|
Wordpress Stackexchange
Q: Use the page slug in a WP_Query? I'm doing some custom loops that I initialize with a query like this
$the_query = new WP_Query('page_id=266');
It works fine. It's just I'ld to call my page with its slug and not its ID.
Would it be possible ?
A: use pagename= to query by slug. See WP_Query for full list of valid arguments.
|
Q: Use the page slug in a WP_Query? I'm doing some custom loops that I initialize with a query like this
$the_query = new WP_Query('page_id=266');
It works fine. It's just I'ld to call my page with its slug and not its ID.
Would it be possible ?
A: use pagename= to query by slug. See WP_Query for full list of valid arguments.
|
wordpress
|
{
"language": "en",
"length": 62,
"provenance": "stackexchange_00019.jsonl.gz:420117",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52700"
}
|
[
0.0287628173828125,
0.00667572021484375,
-0.00389862060546875,
-0.0090789794921875,
0.0291900634765625,
-0.032196044921875,
0.045928955078125,
-0.00885009765625,
0.006999969482421875,
0.03466796875,
-0.0233612060546875,
-0.0200653076171875,
0.0078582763671875,
-0.029083251953125,
-0.0118865966796875,
-0.03466796875,
0.0401611328125,
-0.0280914306640625,
0.003154754638671875,
-0.0220947265625,
0.00911712646484375,
0.0078582763671875,
0.016754150390625,
0.05731201171875,
0.054412841796875,
-0.0654296875,
0.00666046142578125,
-0.016265869140625,
0.032073974609375,
-0.0262451171875,
0.01702880859375,
0.032958984375,
0.0218353271484375,
-0.030303955078125,
0.034454345703125,
0.0244293212890625,
0.00782012939453125,
0.001613616943359375,
0.04095458984375,
-0.01505279541015625,
0.0235137939453125,
-0.01248931884765625,
0.0031757354736328125,
0.01050567626953125,
-0.01230621337890625,
-0.01296234130859375,
0.013275146484375,
-0.05169677734375,
0.0008807182312011719,
0.01422119140625,
0.01435089111328125,
0.043548583984375,
0.0163116455078125,
0.01280975341796875,
-0.0005340576171875,
0.0116119384765625,
0.039459228515625,
-0.00982666015625,
0.026519775390625,
-0.071044921875,
-0.051483154296875,
0.0164337158203125,
0.04034423828125,
0.0276947021484375,
0.0173797607421875,
0.00501251220703125,
-0.0158843994140625,
0.02490234375,
-0.0049285888671875,
0.00478363037109375,
-0.0139312744140625,
-0.0234375,
0.0053863525390625,
0.01042938232421875,
-0.037017822265625,
-0.052398681640625,
0.0281524658203125,
-0.020477294921875,
0.00847625732421875,
0.006755828857421875,
-0.01593017578125,
-0.0284576416015625,
-0.10382080078125,
0.039337158203125,
-0.0020046234130859375,
0.0733642578125,
-0.02197265625,
-0.0343017578125,
-0.01323699951171875,
-0.0223846435546875,
-0.0256500244140625,
0.025634765625,
0.013031005859375,
-0.03936767578125,
-0.049591064453125,
-0.03277587890625,
0.009033203125,
0.02386474609375,
0.034912109375,
0.0292816162109375,
0.003368377685546875,
-0.041259765625,
0.014556884765625,
-0.031585693359375,
0.026214599609375,
0.050994873046875,
0.0162353515625,
0.050201416015625,
0.0592041015625,
-0.0086212158203125,
0.01267242431640625,
0.033203125,
-0.0325927734375,
-0.0158538818359375,
-0.0452880859375,
0.036376953125,
-0.032867431640625,
-0.052398681640625,
-0.0033931732177734375,
-0.02874755859375,
0.0175323486328125,
0.0199737548828125,
0.02532958984375,
0.004001617431640625,
-0.006137847900390625,
0.0018510818481445312,
-0.0115509033203125,
-0.052337646484375,
0.007625579833984375,
0.01424407958984375,
-0.03790283203125,
-0.018768310546875,
0.042755126953125,
0.042938232421875,
0.01313018798828125,
-0.016143798828125,
-0.005031585693359375,
-0.0240325927734375,
0.017791748046875,
0.007404327392578125,
0.00595855712890625,
-0.0261077880859375,
0.01068878173828125,
0.006168365478515625,
0.0096435546875,
-0.01230621337890625,
-0.003688812255859375,
0.038787841796875,
0.007965087890625,
-0.00943756103515625,
0.002811431884765625,
-0.006008148193359375,
-0.01239776611328125,
0.0198822021484375,
0.00749969482421875,
-0.005336761474609375,
-0.0187225341796875,
-0.008758544921875,
0.0263824462890625,
0.0005192756652832031,
-0.0135955810546875,
0.02093505859375,
0.034423828125,
-0.041473388671875,
-0.0160369873046875,
-0.04766845703125,
-0.036102294921875,
-0.0024433135986328125,
0.004474639892578125,
0.0171356201171875,
0.00655364990234375,
-0.0253143310546875,
-0.0182952880859375,
-0.007801055908203125,
-0.0018529891967773438,
0.001758575439453125,
0.0247955322265625,
0.023773193359375,
0.0013580322265625,
0.02642822265625,
-0.00913238525390625,
-0.041290283203125,
0.03564453125,
-0.01715087890625,
-0.03643798828125,
0.06292724609375,
0.02783203125,
0.042266845703125,
-0.038909912109375,
0.00830078125,
0.050872802734375,
0.058807373046875,
-0.0560302734375,
0.058929443359375,
0.016845703125,
-0.05169677734375,
0.01406097412109375,
-0.0157470703125,
0.01258087158203125,
-0.03643798828125,
-0.0230712890625,
-0.0127410888671875,
-0.0002999305725097656,
0.044097900390625,
-0.04217529296875,
0.01395416259765625,
-0.024993896484375,
0.025909423828125,
0.0428466796875,
-0.022125244140625,
0.0047607421875,
-0.0290374755859375,
-0.00806427001953125,
-0.01384735107421875,
-0.08551025390625,
0.0125579833984375,
-0.0138092041015625,
-0.04766845703125,
-0.01861572265625,
-0.0186614990234375,
-0.01165008544921875,
0.004703521728515625,
-0.046630859375,
0.0274505615234375,
0.059295654296875,
-0.039642333984375,
-0.005687713623046875,
-0.0372314453125,
0.00988006591796875,
-0.006916046142578125,
-0.06640625,
0.048492431640625,
0.05609130859375,
0.0653076171875,
0.010162353515625,
0.01352691650390625,
0.042449951171875,
-0.019927978515625,
0.0003485679626464844,
0.015960693359375,
0.04205322265625,
0.0178680419921875,
-0.0299072265625,
-0.047821044921875,
0.030303955078125,
-0.04815673828125,
0.00949859619140625,
-0.0251922607421875,
0.00505828857421875,
0.05145263671875,
0.0232086181640625,
0.0272979736328125,
0.004932403564453125,
0.029693603515625,
-0.002132415771484375,
0.01499176025390625,
0.00579071044921875,
-0.005306243896484375,
-0.017730712890625,
0.037109375,
-0.0160980224609375,
0.037384033203125,
0.029052734375,
-0.0002472400665283203,
-0.0001970529556274414,
0.00327301025390625,
0.004703521728515625,
0.0039825439453125,
0.00432586669921875,
-0.0158538818359375,
0.00783538818359375,
-0.01708984375,
-0.006500244140625,
0.0226898193359375,
-0.01352691650390625,
-0.01080322265625,
-0.0435791015625,
0.008392333984375,
0.006755828857421875,
0.00896453857421875,
-0.01103973388671875,
0.0262298583984375,
0.00539398193359375,
-0.0203857421875,
-0.037078857421875,
-0.03887939453125,
0.01410675048828125,
0.009185791015625,
-0.00884246826171875,
-0.0196533203125,
0.01284027099609375,
0.041046142578125,
-0.051422119140625,
0.06298828125,
-0.0218505859375,
-0.0242156982421875,
0.0643310546875,
0.00632476806640625,
0.004566192626953125,
-0.01091766357421875,
0.03363037109375,
0.037109375,
-0.01010894775390625,
-0.008544921875,
0.01105499267578125,
-0.02484130859375,
0.0197296142578125,
0.02093505859375,
0.01055908203125,
0.0028400421142578125,
-0.032684326171875,
0.0213165283203125,
0.023101806640625,
0.0531005859375,
0.00438690185546875,
-0.043304443359375,
0.0022792816162109375,
0.0264739990234375,
-0.09869384765625,
-0.11529541015625,
0.0055389404296875,
-0.084716796875,
-0.01415252685546875,
-0.0145721435546875,
-0.041046142578125,
0.0230865478515625,
0.014801025390625,
-0.0014133453369140625,
0.0106964111328125,
-0.035675048828125,
-0.0858154296875,
-0.065673828125,
-0.08447265625,
0.038299560546875,
0.0005993843078613281,
0.035797119140625,
0.00884246826171875,
0.0084991455078125,
-0.006069183349609375,
-0.03564453125,
0.0018024444580078125,
0.00878143310546875,
-0.00730133056640625,
-0.0146484375,
-0.0258941650390625,
-0.0115814208984375,
0.01305389404296875,
-0.0115966796875,
0.04345703125,
0.02410888671875,
0.00991058349609375,
0.010101318359375,
0.01020050048828125,
0.005908966064453125,
0.027862548828125,
0.017578125,
-0.009246826171875,
0.01806640625,
0.039581298828125,
-0.021026611328125,
-0.04364013671875,
-0.035064697265625,
-0.06549072265625,
0.03594970703125,
0.058380126953125,
0.0156097412109375,
-0.005023956298828125,
0.0125732421875,
0.0230255126953125,
0.001522064208984375,
0.006671905517578125,
-0.0237274169921875,
0.01422882080078125,
0.0014181137084960938,
0.0360107421875,
-0.0016736984252929688,
0.018035888671875,
-0.011627197265625,
-0.0094757080078125,
0.004833221435546875,
0.0221405029296875,
0.0394287109375,
-0.046630859375,
-0.0185699462890625,
-0.01812744140625,
0.03912353515625,
-0.0157012939453125,
0.012237548828125,
-0.0106964111328125,
-0.025634765625,
0.00923919677734375,
0.0711669921875,
-0.0112152099609375,
-0.032928466796875,
-0.01132965087890625,
0.00452423095703125,
-0.0193328857421875,
-0.00647735595703125,
0.004364013671875,
-0.010345458984375,
-0.0169830322265625,
-0.00415802001953125,
-0.024749755859375,
-0.0283203125,
-0.00022971630096435547,
0.019775390625,
0.02691650390625,
-0.0254669189453125,
0.03594970703125,
-0.0404052734375,
0.006290435791015625,
0.04351806640625,
-0.0275421142578125,
0.0335693359375,
-0.0467529296875,
-0.0124664306640625,
-0.117919921875,
-0.01096343994140625,
0.0167388916015625,
0.08355712890625,
-0.0015420913696289062,
-0.036590576171875,
-0.0234832763671875,
0.0577392578125,
0.027587890625,
0.050079345703125,
0.0220794677734375,
-0.0028476715087890625,
-0.018798828125,
0.0120849609375,
0.043304443359375,
-0.038543701171875,
0.0119171142578125,
-0.02691650390625,
-0.03167724609375,
0.0125885009765625,
-0.05047607421875,
0.01412200927734375,
-0.05731201171875,
-0.00028705596923828125,
-0.0247650146484375,
-0.00017273426055908203,
0.0162811279296875,
0.02069091796875,
0.01497650146484375,
0.0078277587890625,
-0.00559234619140625,
-0.0147857666015625,
0.08172607421875,
0.038482666015625,
-0.009552001953125,
-0.0220947265625,
0.0635986328125,
0.00908660888671875,
-0.05804443359375,
-0.048614501953125,
-0.044464111328125,
-0.0033588409423828125,
-0.031524658203125,
0.06317138671875,
0.005931854248046875,
0.001373291015625,
0.063232421875,
-0.035491943359375,
-0.0325927734375,
-0.00595855712890625,
0.025726318359375,
-0.010711669921875,
-0.025177001953125,
0.0244140625,
-0.054962158203125,
0.0430908203125,
0.054351806640625,
-0.01270294189453125,
-0.040618896484375,
-0.00490570068359375,
0.046844482421875,
-0.04669189453125,
0.058349609375,
-0.0301055908203125,
-0.039886474609375,
0.0191497802734375,
0.004360198974609375,
0.01690673828125,
0.010589599609375,
-0.004192352294921875,
0.01458740234375,
0.0015611648559570312,
0.0268707275390625,
0.0372314453125,
0.055511474609375,
-0.01214599609375,
0.047332763671875,
0.025177001953125,
0.0034389495849609375,
-0.0275115966796875,
-0.004940032958984375,
0.0682373046875,
-0.00968170166015625,
-0.0189361572265625,
-0.0010204315185546875,
-0.0136566162109375,
-0.0178680419921875,
0.0341796875,
0.023529052734375,
0.0170745849609375,
0.020965576171875,
-0.0255126953125,
-0.00750732421875,
0.0308074951171875,
-0.0140228271484375,
-0.029541015625,
0.0251617431640625,
0.026885986328125,
-0.00931549072265625,
0.0031375885009765625,
0.058502197265625,
0.00566864013671875,
0.0196685791015625,
-0.01324462890625,
-0.000007450580596923828,
0.01125335693359375,
0.0124969482421875,
0.006927490234375,
-0.00556182861328125,
0.0214080810546875,
-0.000049054622650146484,
0.029541015625,
-0.0164031982421875,
0.00194549560546875,
0.021484375,
0.032928466796875,
-0.0128936767578125,
-0.01329803466796875,
0.008636474609375,
-0.033477783203125,
0.01003265380859375,
-0.00399017333984375,
-0.0443115234375,
-0.006561279296875,
-0.028411865234375,
0.00885009765625,
0.037506103515625,
-0.003849029541015625,
0.0024852752685546875,
0.042877197265625,
0.006618499755859375,
0.05731201171875,
-0.0161590576171875,
0.04168701171875,
-0.0223388671875,
-0.02789306640625,
0.0294189453125,
-0.01983642578125,
-0.03302001953125,
0.01349639892578125,
0.02978515625,
-0.03204345703125,
-0.0095672607421875,
0.04034423828125,
-0.00041031837463378906,
0.06549072265625,
-0.03326416015625,
-0.035125732421875,
0.004108428955078125,
-0.01007843017578125,
0.06304931640625,
0.018402099609375,
-0.0360107421875,
0.009979248046875,
-0.031585693359375,
0.0020961761474609375,
0.075439453125,
0.0014562606811523438,
-0.02362060546875,
-0.0496826171875,
-0.0010385513305664062,
0.0298309326171875,
0.0005249977111816406,
-0.00734710693359375,
-0.026763916015625,
-0.012664794921875,
0.0011539459228515625,
0.0050811767578125,
-0.043121337890625,
0.04705810546875,
0.0260467529296875,
0.0014047622680664062,
-0.0198974609375,
-0.016204833984375,
0.0032501220703125,
0.01392364501953125,
-0.020538330078125,
-0.032073974609375,
-0.01468658447265625,
0.035430908203125,
-0.01806640625,
0.016876220703125,
0.0167083740234375,
0.004726409912109375,
0.0703125,
-0.041412353515625,
-0.0081024169921875,
-0.010894775390625,
0.024078369140625,
-0.07470703125,
0.0063323974609375,
0.076416015625,
-0.022705078125,
-0.0148773193359375,
0.005588531494140625,
0.033050537109375,
-0.0168304443359375,
-0.01084136962890625,
-0.0214385986328125,
0.004810333251953125,
-0.034637451171875,
0.0258941650390625,
0.07476806640625,
0.001857757568359375,
0.040985107421875,
-0.0142974853515625,
-0.0006961822509765625,
0.046600341796875,
0.01297760009765625,
0.01457977294921875,
-0.0305328369140625,
0.05810546875,
0.01134490966796875,
-0.0003101825714111328,
0.03955078125,
-0.0208740234375,
0.0088958740234375,
0.042022705078125,
0.04766845703125,
-0.0712890625,
-0.01175689697265625,
0.005413055419921875,
-0.01386260986328125,
0.013153076171875,
0.002025604248046875,
0.00247955322265625,
0.00957489013671875,
0.05145263671875,
-0.026580810546875,
0.0007853507995605469,
0.0374755859375,
-0.01415252685546875,
-0.0243682861328125,
0.01373291015625,
0.0321044921875,
0.0102081298828125,
-0.007518768310546875,
-0.0019159317016601562,
0.0119171142578125,
0.01221466064453125,
-0.01119232177734375,
-0.0012960433959960938,
0.00859832763671875,
-0.013031005859375,
-0.002788543701171875,
0.0546875,
-0.037261962890625,
0.037109375,
0.052398681640625,
0.033477783203125,
0.022003173828125,
0.044708251953125,
0.0292816162109375,
-0.00008279085159301758,
-0.00562286376953125,
-0.006061553955078125,
-0.0181732177734375,
-0.006809234619140625,
0.01373291015625,
0.01201629638671875,
-0.05279541015625,
0.01506805419921875,
-0.042755126953125,
0.0020771026611328125,
-0.0160675048828125,
-0.0260772705078125,
0.07025146484375,
-0.038818359375,
-0.016998291015625,
0.021484375,
0.0277099609375,
-0.0150299072265625,
-0.00539398193359375,
-0.007312774658203125,
-0.0293731689453125,
0.0033054351806640625,
-0.019317626953125,
-0.0259552001953125,
0.0112457275390625,
-0.023773193359375,
-0.05908203125,
0.0970458984375,
0.002750396728515625,
0.027862548828125,
0.01506805419921875,
0.02960205078125,
-0.0127410888671875,
0.0212860107421875,
-0.050628662109375,
0.07379150390625,
0.0209503173828125,
0.07147216796875,
-0.05963134765625,
-0.020477294921875,
0.0170135498046875,
0.0272979736328125,
0.0697021484375,
0.0131988525390625,
-0.04180908203125,
0.01300048828125,
0.0802001953125,
0.037506103515625,
0.0014181137084960938,
0.039520263671875,
0.0216827392578125,
0.041015625,
0.060333251953125,
-0.03985595703125,
0.0118865966796875,
-0.002010345458984375,
0.0023059844970703125,
0.04034423828125,
0.025421142578125,
0.0187225341796875,
0.0161590576171875,
0.006229400634765625,
-0.053131103515625,
0.0212249755859375,
0.03204345703125,
0.024200439453125,
0.01284027099609375,
0.036865234375,
0.0177459716796875,
-0.0618896484375,
-0.05670166015625,
-0.03143310546875,
0.0341796875,
-0.0146942138671875,
0.0017786026000976562,
-0.0137939453125,
0.0004699230194091797,
0.08013916015625,
-0.0267791748046875,
-0.02593994140625,
0.027374267578125,
0.00043654441833496094,
0.09381103515625,
0.0228424072265625,
0.03173828125,
-0.0606689453125,
0.0056610107421875,
0.0208282470703125,
0.1005859375,
-0.0662841796875,
-0.0024967193603515625,
0.0026493072509765625,
0.0038909912109375,
0.01666259765625,
-0.019195556640625,
0.042877197265625,
0.054473876953125,
0.016845703125,
-0.0159912109375,
-0.0031642913818359375,
0.01102447509765625,
0.0090484619140625,
-0.01641845703125,
-0.01428985595703125,
-0.004543304443359375,
-0.00305938720703125,
-0.035369873046875,
-0.00463104248046875,
0.036590576171875,
0.058258056640625,
0.022796630859375,
0.03680419921875,
-0.0218505859375,
-0.0232391357421875,
-0.024322509765625,
0.019439697265625,
0.01482391357421875,
0.033294677734375,
-0.04815673828125,
0.00807952880859375,
0.01508331298828125,
0.034423828125,
0.053924560546875,
0.0091094970703125,
0.03631591796875,
-0.0057373046875,
-0.027618408203125,
0.0131072998046875,
0.025177001953125,
-0.02899169921875,
0.028289794921875,
-0.0161590576171875,
0.03143310546875,
0.01617431640625,
-0.00026488304138183594,
-0.041015625,
0.0213775634765625,
0.036712646484375,
0.030975341796875,
0.01172637939453125,
0.006938934326171875,
-0.0002541542053222656,
0.050933837890625,
0.0232696533203125,
0.033203125,
0.043182373046875,
-0.0772705078125,
-0.01430511474609375,
-0.01371002197265625,
-0.035614013671875,
0.0296173095703125,
0.0496826171875,
-0.004436492919921875,
0.0026836395263671875,
0.0189666748046875,
0.0164794921875,
-0.0037517547607421875,
-0.0162353515625,
0.0076904296875,
-0.028167724609375,
0.015594482421875,
0.0008864402770996094,
-0.06622314453125,
-0.024627685546875,
0.004547119140625,
-0.01264190673828125,
-0.031463623046875,
0.06201171875,
0.0196533203125,
-0.0214385986328125,
0.006435394287109375,
0.00893402099609375,
-0.0029697418212890625,
0.0027637481689453125,
0.03564453125,
-0.0054931640625,
-0.0019321441650390625,
-0.01033782958984375,
-0.0111083984375,
0.016754150390625,
0.024169921875,
-0.007610321044921875,
0.00164031982421875,
-0.032958984375,
0.0128936767578125,
0.0134735107421875,
0.01171112060546875,
-0.02032470703125,
0.01438140869140625,
0.01146697998046875,
-0.0025806427001953125,
0.04583740234375,
-0.001373291015625,
-0.035614013671875,
0.0035037994384765625,
-0.04315185546875,
-0.039794921875,
0.00864410400390625,
-0.01459503173828125,
-0.0037364959716796875,
0.0357666015625,
-0.0018768310546875,
0.0014543533325195312,
-0.0081939697265625,
-0.0162200927734375,
0.00653076171875,
0.00855255126953125,
-0.03277587890625,
0.0200347900390625,
0.00493621826171875,
-0.01561737060546875,
-0.042938232421875,
0.0250701904296875,
-0.0019330978393554688,
-0.0021533966064453125,
-0.04547119140625,
0.01049041748046875,
0.0093994140625,
-0.0595703125,
-0.03607177734375,
-0.041168212890625,
0.006038665771484375,
0.034759521484375,
-0.0182647705078125,
-0.01019287109375,
-0.048248291015625,
-0.0156402587890625,
0.0254364013671875,
0.006107330322265625,
-0.03155517578125,
0.004535675048828125,
-0.0229034423828125,
0.0285797119140625,
-0.014434814453125,
0.0167236328125,
0.00960540771484375,
0.01666259765625,
-0.054107666015625,
0.0264892578125,
-0.02069091796875,
-0.03265380859375,
0.01506805419921875,
0.018798828125,
0.052154541015625,
-0.03607177734375,
-0.053985595703125,
0.0460205078125,
0.020355224609375,
0.083984375,
0.005096435546875,
-0.0225372314453125,
0.04168701171875,
-0.0118255615234375,
-0.0058746337890625,
-0.044342041015625,
-0.004764556884765625,
-0.05780029296875,
0.02386474609375,
0.03472900390625,
-0.0216064453125,
0.0009584426879882812,
-0.0328369140625,
-0.06890869140625,
0.034271240234375,
0.008575439453125,
-0.03802490234375,
-0.03387451171875,
0.017730712890625,
0.027618408203125,
-0.061767578125,
-0.0264129638671875,
-0.0139923095703125,
-0.05133056640625,
-0.0209197998046875,
0.0176544189453125,
0.0391845703125,
0.0020313262939453125,
0.0087432861328125,
-0.053314208984375,
0.024139404296875,
-0.00489044189453125,
0.03570556640625,
0.0545654296875,
-0.0244903564453125,
0.01085662841796875,
0.0210113525390625,
-0.062164306640625,
-0.041046142578125,
-0.0546875,
-0.01274871826171875,
-0.0224609375,
0.02362060546875,
-0.03338623046875,
0.0138092041015625,
0.05499267578125,
0.08990478515625,
0.025909423828125,
-0.03485107421875,
-0.054534912109375,
-0.036102294921875,
-0.01203155517578125,
0.006008148193359375,
0.045562744140625,
-0.08953857421875,
0.0213775634765625,
0.025482177734375,
-0.017852783203125,
0.0189208984375,
-0.039093017578125,
-0.018646240234375,
-0.00807952880859375,
-0.0307464599609375,
0.0021228790283203125,
-0.005992889404296875,
-0.0189056396484375,
0.0296173095703125,
-0.028106689453125,
-0.0209503173828125,
-0.0184326171875,
0.038787841796875,
-0.0276947021484375,
-0.053680419921875,
0.00920867919921875,
0.0177764892578125,
-0.01132965087890625,
0.005157470703125,
0.01059722900390625,
-0.0254974365234375,
-0.00481414794921875,
-0.01146697998046875,
-0.0261688232421875,
0.039947509765625,
0.007656097412109375,
0.044036865234375,
-0.0221099853515625,
0.05645751953125,
0.023101806640625,
0.0287933349609375,
0.00428009033203125,
0.019256591796875,
0.00928497314453125,
0.034210205078125,
0.0144805908203125,
-0.0287933349609375,
0.0325927734375,
-0.032562255859375,
-0.0062408447265625,
-0.0352783203125,
-0.027313232421875,
-0.056549072265625,
0.028656005859375,
-0.0254058837890625,
-0.038787841796875,
0.03692626953125
] |
acfb4fc2d4301bdf4ca4ea89ca65bff03a6440f4
|
Wordpress Stackexchange
Q: Comments Reply Form When I click on Reply, the reply form appears at the bottom of the page (under the last comment). How can I add the Reply Form inside the comment to which I am going to add the reply?
A: *
*Ensure that you have Threaded Comments enabled: go to Dashboard -> Settings -> Discussion and enable the option to thread comments
*Ensure that your Theme enqueues the comment-reply script. Look for the following, usually in header.php, functions.php, etc.:
<?php wp_enqueue_script( 'comment-reply' ); ?>
Note: this call is usually wrapped in a conditional, such as:
<?php
if ( is_single() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
?>
Note 2: You may also see this code inside of a callback, hooked into wp_enqueue_scripts, wp_head, or comment_form_before
Edit
To enqueue the comment-reply script via functions.php, don't just put. That's_doing_it_wrong()`, because it will fire far too eary. Do this instead:
<?php
function wpse52737_enqueue_comment_reply_script() {
if ( get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment_reply' );
}
}
add_action( 'comment_form_before', 'wpse52737_enqueue_comment_reply_script' );
?>
|
Q: Comments Reply Form When I click on Reply, the reply form appears at the bottom of the page (under the last comment). How can I add the Reply Form inside the comment to which I am going to add the reply?
A: *
*Ensure that you have Threaded Comments enabled: go to Dashboard -> Settings -> Discussion and enable the option to thread comments
*Ensure that your Theme enqueues the comment-reply script. Look for the following, usually in header.php, functions.php, etc.:
<?php wp_enqueue_script( 'comment-reply' ); ?>
Note: this call is usually wrapped in a conditional, such as:
<?php
if ( is_single() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
?>
Note 2: You may also see this code inside of a callback, hooked into wp_enqueue_scripts, wp_head, or comment_form_before
Edit
To enqueue the comment-reply script via functions.php, don't just put. That's_doing_it_wrong()`, because it will fire far too eary. Do this instead:
<?php
function wpse52737_enqueue_comment_reply_script() {
if ( get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment_reply' );
}
}
add_action( 'comment_form_before', 'wpse52737_enqueue_comment_reply_script' );
?>
A: You can create a <div class="quick-holder"></div> container in the end of each one comment and copy&drop a comment form on that <div> via jQuery.
Hidden form which will be enabled by clicking on Reply link.
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform-a" class="hidden absolute">
..
</form>
jQuery
// QUICK REPLY FORM
var hForm_a = p('#commentform-a').outerHeight(true) + 15 + 25 + 25; // paddings & margin
p('a.quick-reply').click(function(){
var
id = p(this).attr('title'),
form = p('#commentform-a'),
author = p('#author-'+id).html();
form.find('#to-author').html(author);
form.removeClass('hidden absolute');
// form.remove();
p('.cancel-reply').addClass('none');
// Hide major form
p('#commentform').stop(true, false).animate({height: 0, opacity: 0}, 500, function(){
p(this).addClass('hidden absolute').css({height: 'auto'});
p('#review-label').removeClass('none');
});
// Close all .quick-holder's
p('.quick-holder').stop(true, false).animate({height: 0}, 500);
// Put the form to the holder
p('#comment-'+id).find('.quick-holder:eq(0)').append(form).animate({height: hForm_a}, 500, function(){
p(this).css({height: 'auto'});
p('#comment-'+id).find('.cancel-reply:eq(0)').removeClass('none');
});
// Set an ID for hidden field
p('#comment_parent').val(id);
return false;
})
// Cancel reply
p('.cancel-reply').click(function(){
var hForm = p('#commentform').outerHeight(true);
// Display major form
p('#commentform').removeClass('hidden absolute').stop(true, false).animate({height: hForm, opacity: 1}, 1000, function(){ p(this).css({height: 'auto'}) });
p('.cancel-reply').addClass('none');
p('#commentform-a').addClass('hidden absolute');
// Close all .quick-holder's
p('.quick-holder').css({height: 0});
return false;
})
|
wordpress
|
{
"language": "en",
"length": 344,
"provenance": "stackexchange_00019.jsonl.gz:420126",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52737"
}
|
[
0.05340576171875,
-0.0117340087890625,
-0.0072479248046875,
-0.038543701171875,
0.0133819580078125,
-0.040130615234375,
0.04498291015625,
0.0007066726684570312,
0.0172119140625,
0.00047397613525390625,
-0.0552978515625,
-0.01727294921875,
-0.033966064453125,
-0.005092620849609375,
-0.042327880859375,
-0.06500244140625,
0.0447998046875,
0.00849151611328125,
0.0413818359375,
-0.008026123046875,
0.03741455078125,
0.01424407958984375,
-0.00839996337890625,
0.0750732421875,
-0.0119171142578125,
-0.0237884521484375,
0.1630859375,
-0.00940704345703125,
0.0127410888671875,
-0.0111083984375,
0.0220184326171875,
-0.0467529296875,
0.044769287109375,
-0.003505706787109375,
-0.026092529296875,
0.006504058837890625,
0.0189208984375,
-0.035491943359375,
-0.0214080810546875,
0.035552978515625,
0.0187530517578125,
-0.005031585693359375,
-0.02081298828125,
-0.00537109375,
-0.0220184326171875,
-0.0127716064453125,
-0.01165008544921875,
-0.0193023681640625,
0.0112152099609375,
0.0125274658203125,
0.01812744140625,
0.0159149169921875,
0.0178070068359375,
0.0330810546875,
-0.01187896728515625,
0.025543212890625,
-0.0335693359375,
-0.0071563720703125,
0.01311492919921875,
0.052032470703125,
0.038909912109375,
0.007320404052734375,
-0.01123046875,
-0.0279541015625,
-0.0275421142578125,
0.0062255859375,
0.0172271728515625,
-0.0035343170166015625,
0.03851318359375,
-0.018157958984375,
-0.0019359588623046875,
0.01384735107421875,
-0.02166748046875,
-0.032470703125,
0.01473236083984375,
0.01064300537109375,
-0.0203857421875,
-0.0174713134765625,
0.0169677734375,
0.0195465087890625,
-0.00594329833984375,
-0.029541015625,
-0.01004791259765625,
-0.040985107421875,
0.01486968994140625,
-0.015380859375,
-0.018829345703125,
0.004901885986328125,
-0.0294342041015625,
-0.0294647216796875,
-0.0297088623046875,
-0.0870361328125,
0.005558013916015625,
0.0029239654541015625,
-0.00836944580078125,
-0.0223541259765625,
0.0195159912109375,
0.033966064453125,
0.01507568359375,
0.0058135986328125,
0.00994110107421875,
-0.035491943359375,
0.01983642578125,
-0.02679443359375,
0.005435943603515625,
0.03839111328125,
-0.0116729736328125,
-0.0826416015625,
-0.01361846923828125,
0.0017910003662109375,
-0.015838623046875,
-0.0263519287109375,
-0.01284027099609375,
-0.0305633544921875,
-0.00545501708984375,
0.001575469970703125,
-0.0625,
0.0285491943359375,
0.01007843017578125,
0.00836944580078125,
-0.02191162109375,
0.01305389404296875,
-0.00284576416015625,
-0.037384033203125,
0.016387939453125,
-0.0188140869140625,
0.01519775390625,
-0.015625,
0.0211181640625,
0.03778076171875,
-0.0153045654296875,
-0.01009368896484375,
0.046875,
0.0355224609375,
0.0128936767578125,
-0.032257080078125,
0.020416259765625,
-0.0258941650390625,
-0.021026611328125,
0.0237579345703125,
0.019195556640625,
-0.04217529296875,
-0.03070068359375,
0.003673553466796875,
-0.0328369140625,
0.027008056640625,
0.0247955322265625,
-0.00719451904296875,
-0.008087158203125,
-0.053680419921875,
-0.033416748046875,
-0.00893402099609375,
0.00977325439453125,
0.0255889892578125,
-0.017547607421875,
-0.01126861572265625,
-0.004093170166015625,
-0.010986328125,
0.0171966552734375,
-0.02056884765625,
-0.0289306640625,
0.021331787109375,
0.016815185546875,
-0.06756591796875,
-0.044036865234375,
-0.054962158203125,
0.007801055908203125,
0.0018463134765625,
0.032806396484375,
0.037872314453125,
-0.0199432373046875,
-0.04644775390625,
0.036163330078125,
-0.00630950927734375,
-0.038726806640625,
0.0177764892578125,
-0.00917816162109375,
0.0160369873046875,
0.00617218017578125,
0.00634002685546875,
-0.00939178466796875,
-0.043304443359375,
0.003082275390625,
0.00655364990234375,
-0.01537322998046875,
0.026519775390625,
0.054107666015625,
0.06732177734375,
-0.06292724609375,
0.04156494140625,
0.037841796875,
0.069091796875,
0.0166168212890625,
-0.00341796875,
-0.01517486572265625,
-0.0304107666015625,
0.0168914794921875,
0.0166168212890625,
-0.0171661376953125,
0.0082550048828125,
0.004802703857421875,
0.00262451171875,
0.011810302734375,
0.005481719970703125,
-0.046722412109375,
0.0322265625,
-0.033294677734375,
0.043975830078125,
0.006023406982421875,
0.001323699951171875,
0.0077056884765625,
0.01311492919921875,
-0.01244354248046875,
-0.0489501953125,
-0.05108642578125,
0.00960540771484375,
-0.0265350341796875,
0.052337646484375,
0.0014638900756835938,
0.08160400390625,
-0.033905029296875,
-0.0330810546875,
-0.025238037109375,
-0.058013916015625,
0.033447265625,
-0.02178955078125,
-0.025909423828125,
-0.035888671875,
0.0151519775390625,
-0.00830078125,
-0.046051025390625,
0.040496826171875,
0.0297088623046875,
0.00860595703125,
-0.019134521484375,
0.0241241455078125,
0.002429962158203125,
-0.0275726318359375,
-0.01456451416015625,
0.031951904296875,
0.02001953125,
-0.003650665283203125,
-0.003086090087890625,
0.040008544921875,
0.0159454345703125,
0.00017750263214111328,
0.0167236328125,
0.0006456375122070312,
0.0168914794921875,
0.042510986328125,
0.0181121826171875,
0.0079345703125,
0.0221710205078125,
-0.044708251953125,
0.0235443115234375,
0.034393310546875,
-0.0201873779296875,
0.0137176513671875,
0.0216064453125,
0.001003265380859375,
-0.0099029541015625,
-0.0601806640625,
-0.00415802001953125,
-0.03875732421875,
-0.003490447998046875,
-0.0304107666015625,
0.00450897216796875,
-0.0113372802734375,
-0.0035800933837890625,
-0.043304443359375,
0.030029296875,
-0.01297760009765625,
-0.0031986236572265625,
0.03363037109375,
-0.006542205810546875,
-0.019775390625,
0.00803375244140625,
-0.0139007568359375,
-0.0250701904296875,
0.006916046142578125,
-0.0002734661102294922,
0.043121337890625,
-0.01531219482421875,
-0.0207672119140625,
-0.005474090576171875,
-0.04656982421875,
-0.01026153564453125,
-0.004772186279296875,
0.017669677734375,
-0.0251007080078125,
0.002582550048828125,
0.0305023193359375,
-0.007282257080078125,
0.0287933349609375,
0.011138916015625,
-0.033233642578125,
0.056304931640625,
-0.02728271484375,
0.0229339599609375,
-0.0251007080078125,
0.0305633544921875,
0.0443115234375,
-0.0029144287109375,
-0.0191497802734375,
0.00023877620697021484,
-0.0240631103515625,
0.0071258544921875,
-0.0068817138671875,
-0.024932861328125,
-0.03912353515625,
-0.035308837890625,
0.0197296142578125,
0.014068603515625,
0.0362548828125,
-0.00481414794921875,
-0.03326416015625,
0.0093994140625,
0.0261383056640625,
-0.0273895263671875,
-0.047454833984375,
0.01270294189453125,
-0.07122802734375,
0.0540771484375,
-0.050689697265625,
-0.0255279541015625,
-0.0246429443359375,
-0.0235748291015625,
0.0175323486328125,
-0.0281219482421875,
-0.032958984375,
-0.0193634033203125,
-0.053985595703125,
-0.045745849609375,
0.0176239013671875,
0.008026123046875,
0.014404296875,
0.0251922607421875,
0.03936767578125,
0.0217742919921875,
-0.0615234375,
0.0301513671875,
-0.035186767578125,
-0.042877197265625,
0.01715087890625,
0.036285400390625,
-0.03216552734375,
0.00937652587890625,
0.005767822265625,
-0.0219879150390625,
0.0235748291015625,
-0.004589080810546875,
-0.008697509765625,
-0.016357421875,
-0.02410888671875,
-0.002716064453125,
0.0273590087890625,
0.0230255126953125,
-0.003932952880859375,
0.03411865234375,
-0.046905517578125,
-0.0210418701171875,
0.0206756591796875,
-0.0280914306640625,
-0.06793212890625,
0.003910064697265625,
-0.0265960693359375,
-0.0259246826171875,
-0.0003783702850341797,
0.031463623046875,
-0.0005960464477539062,
0.03564453125,
-0.002712249755859375,
0.0396728515625,
-0.000621795654296875,
0.005092620849609375,
-0.052520751953125,
0.0073089599609375,
-0.02008056640625,
0.0225067138671875,
0.0007491111755371094,
0.033355712890625,
0.003177642822265625,
-0.0127105712890625,
-0.056854248046875,
-0.01520538330078125,
0.0234375,
-0.04290771484375,
0.019134521484375,
-0.0443115234375,
-0.01071929931640625,
-0.01325225830078125,
0.0572509765625,
-0.05169677734375,
-0.0147705078125,
-0.013458251953125,
0.007167816162109375,
0.003887176513671875,
-0.022613525390625,
-0.0092010498046875,
-0.0220947265625,
-0.02447509765625,
0.022613525390625,
-0.01520538330078125,
0.002574920654296875,
-0.027069091796875,
0.0347900390625,
-0.02203369140625,
-0.0243072509765625,
0.0270233154296875,
-0.074462890625,
0.006137847900390625,
0.004436492919921875,
-0.025177001953125,
0.005352020263671875,
0.0076141357421875,
-0.0699462890625,
-0.051788330078125,
-0.0136260986328125,
-0.032806396484375,
0.061553955078125,
0.037322998046875,
-0.0300140380859375,
0.00775909423828125,
0.04351806640625,
-0.007785797119140625,
-0.0076904296875,
0.006008148193359375,
0.03924560546875,
-0.045166015625,
0.0036182403564453125,
-0.01114654541015625,
-0.03265380859375,
-0.003116607666015625,
0.015869140625,
0.002826690673828125,
0.036102294921875,
-0.025299072265625,
-0.0218048095703125,
0.01515960693359375,
-0.0293426513671875,
0.01268768310546875,
0.0034809112548828125,
-0.0006728172302246094,
0.0003554821014404297,
-0.02557373046875,
-0.00006431341171264648,
0.01540374755859375,
0.0012664794921875,
-0.034637451171875,
-0.059356689453125,
-0.01293182373046875,
0.016265869140625,
0.0162200927734375,
0.04254150390625,
0.01074981689453125,
0.0528564453125,
0.0125885009765625,
0.0301513671875,
0.05157470703125,
0.0462646484375,
0.01387786865234375,
-0.026336669921875,
0.040069580078125,
0.038421630859375,
0.01611328125,
-0.01177215576171875,
0.052764892578125,
0.0234375,
-0.005458831787109375,
0.0127716064453125,
0.01263427734375,
-0.018218994140625,
-0.024627685546875,
-0.01560211181640625,
-0.006488800048828125,
-0.014129638671875,
0.0306854248046875,
0.00897979736328125,
0.0223388671875,
-0.0157470703125,
-0.06268310546875,
-0.00637054443359375,
-0.057525634765625,
0.051727294921875,
0.0111846923828125,
0.00585174560546875,
0.054840087890625,
0.060394287109375,
-0.00922393798828125,
0.018707275390625,
-0.0199737548828125,
-0.00011390447616577148,
0.037689208984375,
-0.0012264251708984375,
0.0088348388671875,
0.029327392578125,
-0.00537872314453125,
0.049652099609375,
0.031890869140625,
-0.001071929931640625,
-0.0266876220703125,
0.0007915496826171875,
0.046966552734375,
-0.0299530029296875,
0.031829833984375,
0.03076171875,
0.01236724853515625,
-0.00797271728515625,
0.00443267822265625,
-0.013458251953125,
0.0350341796875,
-0.035491943359375,
0.019927978515625,
0.01385498046875,
-0.0141754150390625,
0.00968170166015625,
0.041534423828125,
-0.0238037109375,
0.042755126953125,
-0.01065826416015625,
0.0260162353515625,
0.01580810546875,
0.0245208740234375,
0.028961181640625,
-0.0114593505859375,
0.01641845703125,
-0.0038814544677734375,
0.006011962890625,
0.005023956298828125,
0.007366180419921875,
0.04327392578125,
-0.00588226318359375,
0.041778564453125,
0.0325927734375,
-0.03192138671875,
0.010040283203125,
-0.019989013671875,
0.03741455078125,
0.07037353515625,
-0.03497314453125,
0.0081634521484375,
0.0172271728515625,
0.00272369384765625,
0.005008697509765625,
0.0177154541015625,
0.0299072265625,
0.0220947265625,
0.034027099609375,
-0.011383056640625,
-0.00177764892578125,
-0.00789642333984375,
-0.004673004150390625,
0.0223846435546875,
0.01824951171875,
0.009857177734375,
-0.0084991455078125,
-0.037017822265625,
-0.0086669921875,
-0.0166015625,
0.03155517578125,
0.009613037109375,
-0.009490966796875,
-0.046905517578125,
0.0280303955078125,
-0.0322265625,
-0.01287078857421875,
0.045196533203125,
0.0009570121765136719,
0.0029754638671875,
-0.0174560546875,
-0.043060302734375,
-0.03271484375,
-0.05059814453125,
-0.044281005859375,
-0.0035915374755859375,
0.00951385498046875,
0.0084991455078125,
0.019989013671875,
-0.0347900390625,
-0.049652099609375,
0.00637054443359375,
0.0281982421875,
0.0093536376953125,
0.053680419921875,
-0.0038471221923828125,
0.07073974609375,
0.0047149658203125,
0.017547607421875,
0.03314208984375,
0.07525634765625,
0.00637054443359375,
-0.04107666015625,
-0.010528564453125,
-0.04852294921875,
0.032501220703125,
-0.016143798828125,
0.035125732421875,
0.01441192626953125,
0.0277252197265625,
0.021240234375,
0.032806396484375,
0.029937744140625,
0.01015472412109375,
-0.0189056396484375,
-0.0264434814453125,
0.0206756591796875,
0.04425048828125,
0.0340576171875,
-0.0110015869140625,
0.0135345458984375,
-0.005260467529296875,
0.038299560546875,
-0.0171966552734375,
-0.024749755859375,
0.00524139404296875,
0.00327301025390625,
-0.1011962890625,
0.08453369140625,
0.10174560546875,
0.047027587890625,
0.041748046875,
0.0111846923828125,
-0.00142669677734375,
-0.01393890380859375,
0.06365966796875,
-0.073486328125,
-0.0660400390625,
0.05108642578125,
0.0258941650390625,
-0.05206298828125,
0.0246429443359375,
-0.03387451171875,
0.037139892578125,
0.0145111083984375,
0.034576416015625,
-0.06390380859375,
0.037689208984375,
-0.0347900390625,
-0.0221710205078125,
0.07818603515625,
-0.04473876953125,
0.044586181640625,
-0.034271240234375,
0.09075927734375,
0.03094482421875,
-0.006977081298828125,
0.01425933837890625,
-0.05682373046875,
-0.03399658203125,
-0.0197601318359375,
-0.0143890380859375,
0.01248931884765625,
-0.01122283935546875,
0.01983642578125,
0.00958251953125,
-0.003299713134765625,
-0.0181121826171875,
-0.014892578125,
0.0236968994140625,
-0.0265960693359375,
-0.034454345703125,
0.049407958984375,
-0.0511474609375,
0.0079345703125,
0.029693603515625,
-0.022674560546875,
-0.0175018310546875,
0.02349853515625,
-0.03216552734375,
0.022125244140625,
-0.00566864013671875,
-0.02325439453125,
-0.02734375,
-0.0236968994140625,
0.047210693359375,
0.03826904296875,
-0.0196380615234375,
0.03326416015625,
-0.004039764404296875,
-0.052398681640625,
-0.0027980804443359375,
0.015838623046875,
0.059661865234375,
-0.059967041015625,
-0.00403594970703125,
0.01280975341796875,
-0.0060577392578125,
0.0161285400390625,
-0.031585693359375,
-0.006603240966796875,
-0.04766845703125,
-0.0294189453125,
-0.0224151611328125,
-0.07537841796875,
-0.0025997161865234375,
-0.0640869140625,
-0.050201416015625,
0.07220458984375,
-0.0018863677978515625,
-0.013336181640625,
0.017333984375,
0.0218963623046875,
-0.04840087890625,
-0.0043792724609375,
-0.02117919921875,
0.037628173828125,
-0.040863037109375,
0.0770263671875,
-0.06658935546875,
-0.042938232421875,
0.046630859375,
0.0948486328125,
0.04827880859375,
0.005970001220703125,
-0.0237884521484375,
0.016357421875,
0.06927490234375,
0.054229736328125,
0.00870513916015625,
0.0144805908203125,
0.007061004638671875,
-0.0007448196411132812,
0.01161956787109375,
-0.04083251953125,
0.030181884765625,
-0.060699462890625,
0.0013475418090820312,
-0.00887298583984375,
-0.004550933837890625,
-0.0020294189453125,
-0.0168914794921875,
0.0625,
-0.0482177734375,
-0.0050048828125,
0.035858154296875,
-0.0130767822265625,
-0.036773681640625,
0.050537109375,
-0.004894256591796875,
-0.02197265625,
-0.039886474609375,
-0.0305633544921875,
0.026336669921875,
-0.00020742416381835938,
0.0015821456909179688,
0.037872314453125,
0.0181427001953125,
0.0268402099609375,
-0.02484130859375,
0.00527191162109375,
0.0155792236328125,
-0.0310821533203125,
0.0626220703125,
0.014434814453125,
0.032073974609375,
-0.0176239013671875,
0.0018291473388671875,
-0.0175628662109375,
0.053131103515625,
-0.043853759765625,
0.0322265625,
0.01535797119140625,
0.016876220703125,
-0.00023233890533447266,
-0.045166015625,
0.034942626953125,
0.017486572265625,
-0.0001811981201171875,
0.0072479248046875,
-0.020111083984375,
-0.00405120849609375,
0.01468658447265625,
0.004032135009765625,
-0.00089263916015625,
0.01212310791015625,
0.0016536712646484375,
-0.036102294921875,
0.0478515625,
0.0097808837890625,
0.033843994140625,
-0.023895263671875,
0.05572509765625,
-0.0157623291015625,
0.007755279541015625,
-0.001743316650390625,
-0.00027251243591308594,
-0.0002371072769165039,
0.0003464221954345703,
0.003108978271484375,
0.01226043701171875,
-0.008056640625,
0.020416259765625,
0.020538330078125,
0.01450347900390625,
-0.029083251953125,
-0.057891845703125,
0.01107025146484375,
0.0181884765625,
0.0244293212890625,
-0.0286865234375,
0.036834716796875,
-0.021484375,
0.0171051025390625,
0.033447265625,
-0.0282135009765625,
-0.004352569580078125,
-0.0302276611328125,
0.07232666015625,
-0.029449462890625,
0.0145416259765625,
0.0037403106689453125,
-0.00511932373046875,
0.03387451171875,
0.023712158203125,
0.0207672119140625,
0.016357421875,
-0.05792236328125,
-0.039031982421875,
0.049774169921875,
-0.03369140625,
0.0265960693359375,
0.0494384765625,
-0.0200653076171875,
-0.003612518310546875,
0.03558349609375,
0.01605224609375,
0.0159759521484375,
-0.0252227783203125,
0.0091552734375,
0.0204925537109375,
0.045318603515625,
0.040802001953125,
-0.07537841796875,
-0.0552978515625,
-0.0295867919921875,
0.04241943359375,
0.03582763671875,
0.015960693359375,
0.01430511474609375,
0.039215087890625,
-0.01568603515625,
-0.0005970001220703125,
-0.0030117034912109375,
-0.0478515625,
0.06402587890625,
0.01715087890625,
-0.00612640380859375,
-0.01334381103515625,
-0.058197021484375,
0.03338623046875,
0.00876617431640625,
0.028045654296875,
0.034210205078125,
-0.032318115234375,
0.01471710205078125,
0.005420684814453125,
-0.038116455078125,
-0.031280517578125,
0.00021851062774658203,
0.0274505615234375,
-0.0007028579711914062,
0.0023136138916015625,
-0.0086822509765625,
-0.0015630722045898438,
0.036529541015625,
-0.01134490966796875,
0.047149658203125,
0.0144805908203125,
-0.00730133056640625,
0.01300811767578125,
0.022979736328125,
-0.06842041015625,
0.057830810546875,
0.045806884765625,
-0.01082611083984375,
0.03912353515625,
0.01287841796875,
0.00928497314453125,
0.015655517578125,
0.0128021240234375,
-0.0172271728515625,
-0.0007452964782714844,
0.040740966796875,
0.0010576248168945312,
0.01433563232421875,
-0.0350341796875,
-0.021331787109375,
-0.0017986297607421875,
-0.039093017578125,
-0.03619384765625,
-0.07232666015625,
0.002124786376953125,
0.00589752197265625,
-0.0270843505859375,
-0.00821685791015625,
0.0112762451171875,
-0.0049591064453125,
0.024169921875,
0.00910186767578125,
-0.06414794921875,
0.0258331298828125,
-0.00902557373046875,
0.024871826171875,
-0.01715087890625,
0.042144775390625,
0.0006046295166015625,
0.004974365234375,
-0.0780029296875,
-0.0228424072265625,
-0.02313232421875,
0.0228729248046875,
-0.0262908935546875,
0.0357666015625,
0.056488037109375,
-0.029022216796875,
0.024322509765625,
0.0450439453125,
0.0360107421875,
0.09759521484375,
-0.0039520263671875,
-0.0036373138427734375,
0.0279388427734375,
0.0219268798828125,
-0.0192413330078125,
-0.06475830078125,
-0.0010089874267578125,
-0.047088623046875,
0.041839599609375,
-0.0169830322265625,
0.0194244384765625,
0.0298919677734375,
-0.04052734375,
-0.080810546875,
0.037933349609375,
-0.01629638671875,
-0.03839111328125,
-0.0601806640625,
-0.00768280029296875,
0.01507568359375,
0.00984954833984375,
-0.0278778076171875,
0.00232696533203125,
-0.058135986328125,
0.0136566162109375,
-0.004150390625,
0.0267333984375,
0.037078857421875,
-0.020477294921875,
-0.032958984375,
-0.0235443115234375,
-0.0280914306640625,
-0.006618499755859375,
-0.027618408203125,
-0.00774383544921875,
0.0157318115234375,
0.050018310546875,
-0.017578125,
-0.024017333984375,
0.0057830810546875,
-0.009185791015625,
-0.0098114013671875,
0.0006632804870605469,
-0.01251983642578125,
0.0108795166015625,
0.029144287109375,
0.03680419921875,
0.01331329345703125,
-0.0406494140625,
0.005435943603515625,
-0.0122222900390625,
-0.04119873046875,
-0.0147857666015625,
0.016357421875,
-0.0242156982421875,
-0.01125335693359375,
-0.0192108154296875,
0.0028629302978515625,
-0.04443359375,
-0.038818359375,
-0.03594970703125,
-0.0200653076171875,
-0.0196075439453125,
0.0247650146484375,
0.028717041015625,
-0.042144775390625,
0.088623046875,
-0.04034423828125,
0.00943756103515625,
-0.0023097991943359375,
0.045928955078125,
0.046356201171875,
-0.00962066650390625,
-0.0205535888671875,
-0.008514404296875,
-0.014862060546875,
0.01380157470703125,
-0.00385284423828125,
0.0276947021484375,
-0.009918212890625,
0.003566741943359375,
0.006801605224609375,
0.024169921875,
-0.00485992431640625,
0.028594970703125,
-0.00791168212890625,
0.03509521484375,
-0.006351470947265625,
0.05230712890625,
-0.04449462890625,
0.038421630859375,
-0.02099609375,
0.011016845703125,
-0.0171661376953125,
0.0269317626953125,
0.047119140625,
-0.01280975341796875,
0.0036907196044921875,
0.01238250732421875,
-0.0230865478515625,
-0.041229248046875,
0.042816162109375,
0.08270263671875,
0.0120849609375,
0.0271148681640625
] |
528be9617fc75f9780d0b448be04c857222bb645
|
Wordpress Stackexchange
Q: Hide dashboard from non-admin users Is it possible to hide the dashboard completely from the Non-admin users and give them access to only New post and edit posts page?
Thanks.
A: You can use the plugin Adminimize to do that.
It is possible to hide the Dashboard (and many other things) based on the user role. In case of hiding the Dashboard, you can define to what page the user will be redirected.
I'm not sure, but I believe you cannot modify the user roles to block the Dashboard (as even the lowest role has access to it).
But if you combine Adminimize with a Role plugin, you can achieve a very fine tuned administrative interface.
|
Q: Hide dashboard from non-admin users Is it possible to hide the dashboard completely from the Non-admin users and give them access to only New post and edit posts page?
Thanks.
A: You can use the plugin Adminimize to do that.
It is possible to hide the Dashboard (and many other things) based on the user role. In case of hiding the Dashboard, you can define to what page the user will be redirected.
I'm not sure, but I believe you cannot modify the user roles to block the Dashboard (as even the lowest role has access to it).
But if you combine Adminimize with a Role plugin, you can achieve a very fine tuned administrative interface.
A: As far as ease of use, especially for WordPress Admins not too firm in PHP, I second brasoflo's plugin recommendation (Adminimize).
For the sake of completeness, this is how it'd be done programmatically:
/* Remove the "Dashboard" from the admin menu for non-admin users */
function wpse52752_remove_dashboard () {
global $current_user, $menu, $submenu;
get_currentuserinfo();
if( ! in_array( 'administrator', $current_user->roles ) ) {
reset( $menu );
$page = key( $menu );
while( ( __( 'Dashboard' ) != $menu[$page][0] ) && next( $menu ) ) {
$page = key( $menu );
}
if( __( 'Dashboard' ) == $menu[$page][0] ) {
unset( $menu[$page] );
}
reset($menu);
$page = key($menu);
while ( ! $current_user->has_cap( $menu[$page][1] ) && next( $menu ) ) {
$page = key( $menu );
}
if ( preg_match( '#wp-admin/?(index.php)?$#', $_SERVER['REQUEST_URI'] ) &&
( 'index.php' != $menu[$page][2] ) ) {
wp_redirect( get_option( 'siteurl' ) . '/wp-admin/edit.php');
}
}
}
add_action('admin_menu', 'wpse52752_remove_dashboard');
A: Those 2 pages too are a part of the dashboard! If you're giving access to edit posts, means you're giving access to the posts list. The lowest capable role, subscriber, also has access to the profile page, which is also a part of the dashboard! Your best option would be a front end post addition/profile editing form.
A: you can use a plugin called "User Role Editor".. You cant avoid dashboard in order to give them access to the New post.. But you can limit their role...
|
wordpress
|
{
"language": "en",
"length": 355,
"provenance": "stackexchange_00019.jsonl.gz:420130",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52752"
}
|
[
0.07080078125,
0.0008034706115722656,
0.02703857421875,
-0.001953125,
0.0186614990234375,
-0.038177490234375,
0.044891357421875,
-0.06494140625,
-0.05047607421875,
0.03265380859375,
0.04034423828125,
-0.020477294921875,
-0.01320648193359375,
-0.022064208984375,
-0.02203369140625,
-0.03759765625,
0.0024280548095703125,
-0.01122283935546875,
0.029754638671875,
-0.017822265625,
0.016754150390625,
-0.01617431640625,
0.036224365234375,
-0.00463104248046875,
0.0167694091796875,
-0.01004791259765625,
-0.01154327392578125,
0.0090789794921875,
-0.0035800933837890625,
0.00907135009765625,
0.0137481689453125,
-0.0158843994140625,
-0.0181884765625,
0.043487548828125,
0.01141357421875,
0.022491455078125,
-0.023193359375,
0.0504150390625,
0.07818603515625,
-0.0462646484375,
0.01611328125,
0.00501251220703125,
-0.0230560302734375,
0.04095458984375,
-0.035003662109375,
-0.012542724609375,
-0.01727294921875,
-0.024566650390625,
0.040618896484375,
0.0122222900390625,
0.003681182861328125,
0.03369140625,
0.00203704833984375,
-0.01209259033203125,
-0.00035071372985839844,
0.00438690185546875,
0.019073486328125,
0.017608642578125,
0.06085205078125,
-0.0205230712890625,
-0.057037353515625,
-0.0401611328125,
0.01464080810546875,
-0.059967041015625,
-0.005207061767578125,
0.00708770751953125,
-0.0050201416015625,
0.016143798828125,
-0.07574462890625,
0.0019741058349609375,
0.0364990234375,
-0.04351806640625,
0.0323486328125,
-0.0236968994140625,
-0.0158538818359375,
-0.025726318359375,
0.026824951171875,
-0.00762176513671875,
0.0166015625,
-0.0159759521484375,
0.0313720703125,
-0.000675201416015625,
0.002285003662109375,
-0.0033721923828125,
-0.0189361572265625,
-0.0072021484375,
-0.0120697021484375,
0.0011720657348632812,
-0.004055023193359375,
0.0031719207763671875,
-0.012237548828125,
-0.02728271484375,
-0.023590087890625,
0.06982421875,
0.00960540771484375,
-0.0002963542938232422,
0.043487548828125,
0.0684814453125,
-0.02191162109375,
-0.0274658203125,
-0.0295562744140625,
-0.00904083251953125,
-0.061065673828125,
-0.00849151611328125,
0.01325225830078125,
0.04693603515625,
0.0005135536193847656,
0.0020046234130859375,
0.0250091552734375,
0.0073699951171875,
0.01110076904296875,
0.0281524658203125,
-0.0282745361328125,
-0.0215301513671875,
-0.037445068359375,
0.03314208984375,
-0.0280303955078125,
-0.007740020751953125,
0.00911712646484375,
0.024871826171875,
-0.037872314453125,
-0.009063720703125,
-0.0350341796875,
-0.00800323486328125,
0.0295867919921875,
0.00513458251953125,
-0.02252197265625,
0.046417236328125,
0.0250091552734375,
-0.00972747802734375,
-0.028289794921875,
0.007648468017578125,
0.07122802734375,
0.053558349609375,
0.0285797119140625,
-0.01320648193359375,
0.005401611328125,
-0.0633544921875,
-0.0127105712890625,
0.01806640625,
0.00988006591796875,
-0.017303466796875,
-0.0010881423950195312,
-0.01873779296875,
-0.01233673095703125,
0.0447998046875,
0.0120391845703125,
-0.00787353515625,
-0.0023937225341796875,
-0.052764892578125,
-0.041748046875,
-0.00975799560546875,
0.01702880859375,
0.0197906494140625,
0.0230865478515625,
0.035400390625,
0.031524658203125,
0.0214691162109375,
-0.03814697265625,
0.0031147003173828125,
0.01222991943359375,
-0.0019130706787109375,
0.0679931640625,
0.01502227783203125,
-0.01251983642578125,
0.01751708984375,
-0.0726318359375,
-0.0024814605712890625,
0.030517578125,
-0.042144775390625,
0.055938720703125,
-0.048095703125,
0.01220703125,
-0.012451171875,
-0.005306243896484375,
0.0265045166015625,
0.004177093505859375,
0.02099609375,
0.0159454345703125,
-0.0022525787353515625,
-0.0012502670288085938,
-0.02642822265625,
0.0369873046875,
0.019439697265625,
-0.047637939453125,
0.01003265380859375,
0.0173187255859375,
0.039459228515625,
0.021697998046875,
0.00714111328125,
0.047515869140625,
0.01203155517578125,
-0.0031528472900390625,
-0.0256195068359375,
-0.014678955078125,
-0.01090240478515625,
-0.0130767822265625,
0.01079559326171875,
-0.01342010498046875,
0.00614166259765625,
0.0562744140625,
0.0217132568359375,
-0.0168609619140625,
-0.00011330842971801758,
-0.051788330078125,
-0.0027790069580078125,
-0.0001971721649169922,
0.0157012939453125,
0.00977325439453125,
0.0230865478515625,
0.0022678375244140625,
0.008575439453125,
-0.0150909423828125,
-0.01290130615234375,
-0.0167236328125,
-0.00982666015625,
-0.02081298828125,
0.031768798828125,
-0.020233154296875,
-0.00783538818359375,
0.01255035400390625,
-0.063720703125,
0.0129547119140625,
0.020599365234375,
0.040252685546875,
-0.008026123046875,
-0.00339508056640625,
-0.0083770751953125,
0.0787353515625,
0.0015411376953125,
0.0263214111328125,
0.00881195068359375,
0.0238189697265625,
0.019927978515625,
-0.020263671875,
-0.01042938232421875,
0.00962066650390625,
-0.0645751953125,
0.017120361328125,
0.042144775390625,
0.00798797607421875,
-0.0027408599853515625,
-0.0201416015625,
0.056060791015625,
-0.003437042236328125,
-0.08782958984375,
-0.0278778076171875,
0.04248046875,
-0.0306396484375,
0.00823211669921875,
-0.00726318359375,
0.0292816162109375,
0.0216064453125,
0.032623291015625,
-0.00891876220703125,
0.03875732421875,
-0.01454925537109375,
0.034942626953125,
0.00366973876953125,
-0.032623291015625,
-0.004184722900390625,
-0.010101318359375,
0.003772735595703125,
-0.020843505859375,
0.001209259033203125,
-0.03466796875,
0.009674072265625,
0.0125732421875,
-0.0092620849609375,
-0.048614501953125,
0.02899169921875,
0.03778076171875,
0.01480865478515625,
0.042327880859375,
-0.003448486328125,
-0.016815185546875,
-0.043121337890625,
-0.001598358154296875,
0.023651123046875,
0.024200439453125,
0.003326416015625,
-0.006542205810546875,
0.030731201171875,
-0.0014657974243164062,
0.03436279296875,
-0.0003826618194580078,
0.029449462890625,
0.00366973876953125,
0.00555419921875,
-0.00534820556640625,
0.005481719970703125,
0.03216552734375,
0.010345458984375,
0.041259765625,
-0.01385498046875,
-0.0090484619140625,
-0.08087158203125,
-0.07891845703125,
0.053619384765625,
-0.031829833984375,
0.059478759765625,
0.1060791015625,
0.039947509765625,
0.01690673828125,
0.0205230712890625,
-0.004642486572265625,
0.02557373046875,
0.0117340087890625,
0.01239013671875,
-0.01061248779296875,
-0.002391815185546875,
0.0458984375,
0.0177154541015625,
-0.01453399658203125,
-0.000629425048828125,
-0.0272674560546875,
-0.030517578125,
0.0175933837890625,
-0.054351806640625,
-0.0031490325927734375,
-0.051239013671875,
-0.035186767578125,
-0.0189666748046875,
-0.006710052490234375,
-0.02484130859375,
0.007465362548828125,
0.01071929931640625,
0.006175994873046875,
0.0015459060668945312,
-0.01267242431640625,
-0.010711669921875,
-0.01259613037109375,
-0.004993438720703125,
0.0038204193115234375,
-0.009674072265625,
-0.0301361083984375,
-0.0021343231201171875,
0.032012939453125,
-0.014801025390625,
-0.053985595703125,
-0.0227813720703125,
-0.00261688232421875,
0.0127716064453125,
0.007801055908203125,
-0.01313018798828125,
-0.0111236572265625,
0.0095977783203125,
0.01412200927734375,
-0.0022735595703125,
-0.01392364501953125,
0.01523590087890625,
-0.0307159423828125,
0.010223388671875,
-0.02703857421875,
0.006153106689453125,
0.031494140625,
-0.0116424560546875,
-0.01203155517578125,
0.0174560546875,
-0.035888671875,
0.003231048583984375,
-0.024169921875,
-0.044708251953125,
0.01204681396484375,
0.0220947265625,
-0.007205963134765625,
0.0160369873046875,
-0.0237884521484375,
0.055572509765625,
0.0274810791015625,
-0.0224761962890625,
0.015899658203125,
-0.033111572265625,
0.0224609375,
0.046905517578125,
-0.0037441253662109375,
-0.035064697265625,
-0.0606689453125,
0.018524169921875,
-0.0290374755859375,
-0.04052734375,
-0.0090179443359375,
0.0020999908447265625,
0.0399169921875,
-0.024932861328125,
0.035797119140625,
-0.001522064208984375,
-0.0089874267578125,
-0.01605224609375,
-0.004962921142578125,
-0.005420684814453125,
0.0498046875,
-0.057342529296875,
0.0214996337890625,
-0.004901885986328125,
0.0030059814453125,
-0.0548095703125,
-0.036834716796875,
-0.11614990234375,
0.01361083984375,
-0.1014404296875,
-0.0196990966796875,
-0.019775390625,
-0.05059814453125,
-0.0031890869140625,
0.0011472702026367188,
-0.050445556640625,
-0.049896240234375,
0.03973388671875,
0.0014009475708007812,
0.01532745361328125,
-0.0169219970703125,
0.04632568359375,
-0.0609130859375,
-0.0179443359375,
0.0027217864990234375,
-0.03607177734375,
-0.010345458984375,
-0.004016876220703125,
0.0167694091796875,
-0.0065155029296875,
0.0248870849609375,
-0.00934600830078125,
0.0308685302734375,
-0.01885986328125,
-0.0011615753173828125,
-0.032470703125,
0.024932861328125,
-0.027801513671875,
-0.0229339599609375,
-0.034271240234375,
-0.0225677490234375,
-0.035736083984375,
-0.014190673828125,
-0.01233673095703125,
0.00850677490234375,
-0.040802001953125,
-0.05010986328125,
-0.01503753662109375,
-0.004787445068359375,
-0.0748291015625,
-0.03875732421875,
-0.033355712890625,
-0.0032825469970703125,
-0.039154052734375,
0.0289306640625,
-0.034027099609375,
-0.0830078125,
0.040863037109375,
0.0246429443359375,
-0.004947662353515625,
0.0049896240234375,
0.03594970703125,
0.006610870361328125,
-0.0252838134765625,
-0.052581787109375,
0.01247406005859375,
0.0294342041015625,
0.0233306884765625,
0.042572021484375,
0.0263824462890625,
-0.0194854736328125,
0.04962158203125,
0.0261688232421875,
-0.0268707275390625,
-0.01425933837890625,
0.046722412109375,
-0.0205078125,
-0.057586669921875,
0.051055908203125,
-0.060760498046875,
0.01065826416015625,
0.0124359130859375,
0.00791168212890625,
0.005977630615234375,
-0.0279693603515625,
0.01812744140625,
0.00936126708984375,
-0.033355712890625,
-0.048675537109375,
-0.013916015625,
0.0093231201171875,
-0.01971435546875,
0.00086212158203125,
-0.0203094482421875,
0.009674072265625,
-0.018585205078125,
-0.01554107666015625,
0.00005996227264404297,
0.00954437255859375,
0.027587890625,
-0.031890869140625,
0.033721923828125,
-0.0019044876098632812,
-0.0193939208984375,
0.00589752197265625,
-0.00527191162109375,
0.033935546875,
-0.0130462646484375,
-0.07403564453125,
-0.01078033447265625,
0.01397705078125,
0.05389404296875,
0.04071044921875,
-0.0325927734375,
0.0272674560546875,
0.018707275390625,
-0.005191802978515625,
-0.00826263427734375,
-0.004764556884765625,
-0.010772705078125,
-0.0303497314453125,
-0.01922607421875,
-0.0008950233459472656,
-0.00624847412109375,
0.016021728515625,
0.06243896484375,
0.00536346435546875,
0.03033447265625,
-0.0236663818359375,
0.08050537109375,
0.0506591796875,
-0.0252532958984375,
-0.028778076171875,
0.0758056640625,
0.0201873779296875,
-0.046356201171875,
0.00972747802734375,
-0.028167724609375,
0.011993408203125,
0.04608154296875,
0.032318115234375,
0.0523681640625,
-0.0141143798828125,
-0.031951904296875,
-0.0219573974609375,
-0.032989501953125,
0.07025146484375,
0.022186279296875,
-0.07232666015625,
-0.03973388671875,
0.0009646415710449219,
0.0301513671875,
-0.00983428955078125,
0.016571044921875,
-0.02569580078125,
-0.01275634765625,
0.01641845703125,
-0.0016765594482421875,
-0.00838470458984375,
-0.0115814208984375,
-0.01131439208984375,
-0.030792236328125,
0.0181121826171875,
-0.002460479736328125,
0.007465362548828125,
-0.06707763671875,
0.00814056396484375,
-0.0199127197265625,
0.049346923828125,
0.00872039794921875,
0.0166473388671875,
-0.06622314453125,
0.01244354248046875,
-0.036895751953125,
-0.0158233642578125,
0.0743408203125,
0.0264739990234375,
-0.03021240234375,
-0.00592803955078125,
-0.0426025390625,
-0.024688720703125,
-0.050445556640625,
-0.054412841796875,
-0.031829833984375,
0.01058197021484375,
0.02276611328125,
0.025360107421875,
-0.0009207725524902344,
-0.0227508544921875,
-0.018768310546875,
0.006900787353515625,
0.017852783203125,
0.046661376953125,
-0.0012760162353515625,
0.07342529296875,
-0.003265380859375,
0.05279541015625,
0.02508544921875,
0.019256591796875,
-0.055145263671875,
-0.006145477294921875,
-0.0022640228271484375,
-0.01242828369140625,
0.0007319450378417969,
0.0220794677734375,
-0.0025005340576171875,
-0.043853759765625,
-0.01096343994140625,
-0.007396697998046875,
0.01132965087890625,
0.0007967948913574219,
0.0211639404296875,
-0.0191497802734375,
-0.03564453125,
-0.01323699951171875,
0.00516510009765625,
-0.0071868896484375,
0.00794219970703125,
-0.011077880859375,
-0.001972198486328125,
-0.055999755859375,
0.040924072265625,
0.045013427734375,
0.01654052734375,
-0.032196044921875,
-0.02880859375,
0.05841064453125,
0.08172607421875,
-0.031494140625,
0.0227203369140625,
0.0411376953125,
-0.01299285888671875,
0.01352691650390625,
-0.031951904296875,
-0.04669189453125,
0.00888824462890625,
0.005321502685546875,
-0.0018262863159179688,
-0.007213592529296875,
0.0197906494140625,
-0.0074920654296875,
0.0006422996520996094,
0.081787109375,
0.03717041015625,
-0.11444091796875,
-0.004486083984375,
-0.01983642578125,
0.022125244140625,
0.029876708984375,
0.00148773193359375,
0.007518768310546875,
-0.0271453857421875,
0.0145111083984375,
-0.0185089111328125,
-0.010528564453125,
0.0029125213623046875,
-0.0295867919921875,
-0.032867431640625,
-0.016876220703125,
0.0322265625,
0.01386260986328125,
0.02703857421875,
0.01558685302734375,
-0.021026611328125,
0.010467529296875,
-0.0217132568359375,
-0.00815582275390625,
0.02337646484375,
-0.04376220703125,
-0.091064453125,
-0.0017261505126953125,
0.007221221923828125,
-0.008026123046875,
0.04962158203125,
0.017608642578125,
0.02569580078125,
0.0570068359375,
-0.004302978515625,
0.005908966064453125,
0.0225982666015625,
-0.01114654541015625,
0.020660400390625,
-0.057281494140625,
-0.0178680419921875,
0.01319122314453125,
-0.011993408203125,
0.007457733154296875,
0.0181884765625,
-0.0455322265625,
-0.01486968994140625,
-0.010894775390625,
0.08905029296875,
-0.0191650390625,
-0.0275421142578125,
-0.008758544921875,
0.0007467269897460938,
0.00879669189453125,
0.0141143798828125,
-0.020111083984375,
-0.00677490234375,
0.003429412841796875,
-0.01371002197265625,
-0.04376220703125,
-0.001560211181640625,
-0.0017480850219726562,
-0.06414794921875,
0.0286865234375,
-0.00376129150390625,
0.03680419921875,
-0.004970550537109375,
-0.002010345458984375,
-0.0008826255798339844,
-0.0202178955078125,
-0.0103759765625,
0.0706787109375,
-0.00475311279296875,
0.045196533203125,
-0.034637451171875,
0.0039520263671875,
0.0305938720703125,
0.026885986328125,
0.00397491455078125,
0.0138397216796875,
-0.01788330078125,
-0.021636962890625,
-0.036468505859375,
0.00664520263671875,
-0.015960693359375,
0.0396728515625,
-0.00965118408203125,
0.049468994140625,
-0.0023555755615234375,
-0.04119873046875,
0.02764892578125,
-0.024017333984375,
-0.0655517578125,
0.022064208984375,
0.0104522705078125,
0.0174713134765625,
0.01165771484375,
0.025848388671875,
-0.028961181640625,
0.0214996337890625,
0.0311737060546875,
-0.036651611328125,
-0.01085662841796875,
-0.02386474609375,
0.0240325927734375,
-0.08538818359375,
-0.0019550323486328125,
-0.0247650146484375,
0.03460693359375,
0.04229736328125,
-0.019256591796875,
0.00457000732421875,
0.0278167724609375,
-0.055511474609375,
-0.01331329345703125,
-0.019500732421875,
0.033721923828125,
-0.050079345703125,
0.0049591064453125,
0.0291900634765625,
0.038543701171875,
-0.019561767578125,
-0.0227203369140625,
0.02984619140625,
0.0305328369140625,
-0.006999969482421875,
0.00611114501953125,
0.00969696044921875,
0.02081298828125,
-0.00022614002227783203,
-0.0184173583984375,
0.0189666748046875,
0.0202178955078125,
0.04840087890625,
-0.0206146240234375,
0.0013580322265625,
0.0077056884765625,
0.00927734375,
-0.006542205810546875,
-0.0003333091735839844,
0.01291656494140625,
0.0169219970703125,
0.01316070556640625,
-0.06622314453125,
0.0169830322265625,
0.01100921630859375,
0.04815673828125,
-0.04150390625,
-0.00463104248046875,
0.00045228004455566406,
-0.01708984375,
-0.036651611328125,
-0.01288604736328125,
0.020477294921875,
-0.05316162109375,
-0.025848388671875,
0.018585205078125,
0.05230712890625,
0.01016998291015625,
-0.0192108154296875,
0.00963592529296875,
0.05706787109375,
0.0396728515625,
-0.0175628662109375,
0.0240478515625,
0.009857177734375,
0.041839599609375,
-0.01451873779296875,
0.026092529296875,
-0.0013179779052734375,
-0.0196990966796875,
-0.01116943359375,
0.043121337890625,
0.016082763671875,
-0.028594970703125,
0.0062713623046875,
0.00418853759765625,
-0.032958984375,
0.023223876953125,
-0.04486083984375,
0.01568603515625,
-0.0215606689453125,
-0.0411376953125,
-0.0010385513305664062,
-0.02587890625,
-0.034210205078125,
0.0009684562683105469,
0.017608642578125,
-0.0511474609375,
0.060394287109375,
0.008575439453125,
0.035858154296875,
-0.05609130859375,
-0.0024509429931640625,
0.022552490234375,
-0.0267791748046875,
0.019317626953125,
0.031585693359375,
-0.0013494491577148438,
-0.0294647216796875,
-0.03057861328125,
0.07843017578125,
0.031951904296875,
0.062744140625,
-0.038604736328125,
0.0523681640625,
-0.05194091796875,
0.0198516845703125,
-0.06573486328125,
-0.006771087646484375,
-0.0180206298828125,
-0.007678985595703125,
-0.01502227783203125,
0.01165771484375,
-0.0533447265625,
0.0170745849609375,
0.021728515625,
-0.0182037353515625,
0.04571533203125,
-0.01488494873046875,
0.003917694091796875,
-0.026214599609375,
0.0001678466796875,
-0.033905029296875,
-0.041839599609375,
-0.0633544921875,
0.00589752197265625,
0.0002219676971435547,
-0.022064208984375,
-0.046539306640625,
0.0361328125,
-0.040740966796875,
-0.0248260498046875,
-0.01708984375,
-0.024993896484375,
-0.05169677734375,
-0.0037746429443359375,
-0.0021724700927734375,
0.0113983154296875,
0.0175628662109375,
-0.003467559814453125,
0.0288543701171875,
0.022491455078125,
-0.0191497802734375,
0.0306549072265625,
0.0269775390625,
-0.0214691162109375,
0.004108428955078125,
0.004436492919921875,
-0.0272216796875,
-0.005077362060546875,
0.01421356201171875,
-0.020660400390625,
-0.03662109375,
0.022857666015625,
-0.0276641845703125,
0.00848388671875,
-0.023529052734375,
-0.0006246566772460938,
-0.0084075927734375,
-0.1048583984375,
-0.10284423828125,
0.03350830078125,
0.040130615234375,
0.003841400146484375,
-0.08978271484375,
0.060394287109375,
-0.043060302734375,
0.085205078125,
-0.014007568359375,
0.005100250244140625,
0.0219879150390625,
0.01500701904296875,
-0.0206451416015625,
0.036712646484375,
0.0005908012390136719,
-0.038665771484375,
0.0186004638671875,
-0.0030956268310546875,
-0.00441741943359375,
0.0159149169921875,
0.031524658203125,
0.00997161865234375,
-0.03863525390625,
0.05242919921875,
-0.0634765625,
-0.0245819091796875,
-0.02203369140625,
0.025543212890625,
0.004749298095703125,
-0.01538848876953125,
0.005916595458984375,
0.01337432861328125,
-0.0191192626953125,
0.0299530029296875,
-0.033294677734375,
-0.01482391357421875,
-0.037017822265625,
-0.0400390625,
0.0804443359375,
0.009002685546875,
-0.02911376953125,
0.0015048980712890625,
0.04736328125,
-0.0018911361694335938,
-0.00951385498046875,
0.00450897216796875,
-0.0179290771484375,
0.0165252685546875,
-0.0124664306640625,
0.035797119140625,
-0.049346923828125,
0.035919189453125,
0.00909423828125,
-0.03558349609375,
0.041259765625,
0.04937744140625,
0.003429412841796875,
-0.047393798828125,
0.0055084228515625,
0.016754150390625,
0.029449462890625,
-0.018280029296875,
0.00264739990234375,
0.03912353515625,
0.016571044921875,
0.007801055908203125,
-0.01154327392578125,
-0.03253173828125,
-0.03375244140625,
0.051239013671875,
0.0224761962890625,
0.0183258056640625,
-0.01300811767578125,
-0.032440185546875,
-0.035980224609375,
-0.01690673828125,
-0.00962066650390625,
0.03515625,
-0.09637451171875,
-0.00958251953125,
0.046875,
-0.006351470947265625,
0.0032749176025390625,
0.01029205322265625,
-0.0299224853515625,
-0.0162200927734375,
-0.0171966552734375,
-0.01058197021484375,
-0.061798095703125,
0.0233612060546875,
0.026153564453125,
-0.0357666015625,
-0.032379150390625,
-0.00777435302734375,
-0.006381988525390625,
-0.0157928466796875,
-0.037994384765625,
-0.05029296875,
-0.03497314453125,
-0.0093994140625,
0.05303955078125,
-0.0355224609375,
0.04705810546875,
-0.07781982421875,
0.0089111328125,
0.004642486572265625,
0.02191162109375,
0.01438140869140625,
0.03466796875,
-0.035736083984375,
0.057037353515625,
0.0185394287109375,
-0.0240325927734375,
-0.01763916015625,
-0.0196075439453125,
-0.036224365234375,
0.0269012451171875,
0.011260986328125,
-0.00496673583984375,
0.05426025390625,
-0.0043792724609375,
0.000911712646484375,
0.0215606689453125,
0.0228424072265625,
-0.0266265869140625,
0.013580322265625,
-0.05755615234375,
0.032257080078125,
0.005077362060546875
] |
d640d15796729828af891083f27682a8f82bfc4d
|
Wordpress Stackexchange
Q: Post type child of another post type This may be a stupid question but is it possible to have a post type child of another post type?
Let me explain with an example:
I created 2 post types, "Actors" and "Galleries".
What i want is to create a new actor like "Winona Ryder" and a new gallery like "Winona Pictures".
The adress in the browser bar should be;
www.mysite.com/actors/winona-ryder/galleries/winona-pictures
Also this should affect breadcrumbs as well.
I guess i have to play around with permalinks.
Can anyone take a look at this and tell me if this is possible?
Many thanks in advance. And sorry for any bad English
A: Attachments are post types someway, when you attach images to a post/page and display them in your post, you get a link like your-post-title/attachment/filename/.
Maybe you can create post types with hierarchical option and them filter the link to replace the attachment to post parent name instead.
|
Q: Post type child of another post type This may be a stupid question but is it possible to have a post type child of another post type?
Let me explain with an example:
I created 2 post types, "Actors" and "Galleries".
What i want is to create a new actor like "Winona Ryder" and a new gallery like "Winona Pictures".
The adress in the browser bar should be;
www.mysite.com/actors/winona-ryder/galleries/winona-pictures
Also this should affect breadcrumbs as well.
I guess i have to play around with permalinks.
Can anyone take a look at this and tell me if this is possible?
Many thanks in advance. And sorry for any bad English
A: Attachments are post types someway, when you attach images to a post/page and display them in your post, you get a link like your-post-title/attachment/filename/.
Maybe you can create post types with hierarchical option and them filter the link to replace the attachment to post parent name instead.
A: Regarding the child association, you cannot have it by default. I have implemented a similar scenario (Company CPT > Job CPT). I store the company id as the post meta of a particular job custom post, to indicate that that job/those jobs belong to this company. You can try that. And for URLs, yes, you're gonna have to work hard for it! ;)
A: Could you post some of your code?
I believe you may need a slug rewrite or a flush. You could also try going to your permalink structure and just hitting save. By doing this, you are having WordPress rewrite the .htaccess file so it can use the new custom post type.
A: Maybe you can create post types with hierarchical option and them filter the link to replace the attachment to post parent name instead.
|
wordpress
|
{
"language": "en",
"length": 298,
"provenance": "stackexchange_00019.jsonl.gz:420141",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52790"
}
|
[
0.044403076171875,
-0.0008592605590820312,
-0.01393890380859375,
-0.015716552734375,
-0.004150390625,
-0.028533935546875,
0.038177490234375,
-0.028411865234375,
-0.060699462890625,
0.01386260986328125,
-0.0011920928955078125,
0.003658294677734375,
-0.027923583984375,
-0.03399658203125,
0.01052093505859375,
-0.04296875,
0.01026153564453125,
0.0113525390625,
0.0274810791015625,
-0.0294342041015625,
0.0193328857421875,
-0.0247802734375,
0.03594970703125,
-0.0223846435546875,
0.0176849365234375,
0.00969696044921875,
0.0413818359375,
-0.0189056396484375,
0.0201873779296875,
0.007266998291015625,
0.031982421875,
-0.042816162109375,
0.00516510009765625,
0.0167236328125,
0.005435943603515625,
-0.0176239013671875,
-0.01983642578125,
0.0189971923828125,
0.009002685546875,
0.0089874267578125,
-0.01654052734375,
0.02349853515625,
0.034423828125,
0.0024700164794921875,
-0.0069122314453125,
-0.0205535888671875,
-0.0258636474609375,
-0.047698974609375,
0.037933349609375,
-0.02783203125,
-0.0220184326171875,
0.017578125,
0.00031566619873046875,
-0.0288848876953125,
-0.00862884521484375,
0.0215301513671875,
-0.0111846923828125,
0.020294189453125,
0.04620361328125,
-0.0214691162109375,
-0.022796630859375,
-0.019622802734375,
0.01739501953125,
-0.006656646728515625,
0.0176849365234375,
0.01291656494140625,
0.015106201171875,
0.007076263427734375,
-0.0207977294921875,
0.01259613037109375,
0.012542724609375,
-0.02685546875,
0.034088134765625,
-0.060943603515625,
0.0170135498046875,
-0.00400543212890625,
-0.0164794921875,
-0.020416259765625,
0.00601959228515625,
-0.0095367431640625,
-0.0338134765625,
0.0193634033203125,
-0.01294708251953125,
-0.035888671875,
-0.01169586181640625,
-0.029571533203125,
-0.021942138671875,
0.009674072265625,
-0.0278778076171875,
-0.0164947509765625,
-0.027130126953125,
-0.06689453125,
-0.0269317626953125,
0.073974609375,
0.005558013916015625,
0.0030803680419921875,
0.045318603515625,
0.0187530517578125,
-0.005092620849609375,
0.033843994140625,
-0.01238250732421875,
-0.04754638671875,
0.073974609375,
-0.03985595703125,
0.0225372314453125,
0.0181732177734375,
-0.00554656982421875,
-0.0013856887817382812,
0.073486328125,
0.0225830078125,
0.005023956298828125,
0.09979248046875,
0.009246826171875,
0.0026302337646484375,
-0.00240325927734375,
-0.008270263671875,
-0.041168212890625,
0.06689453125,
-0.00347900390625,
0.043304443359375,
-0.015869140625,
-0.01190948486328125,
0.03057861328125,
0.02362060546875,
0.0430908203125,
0.045318603515625,
-0.01503753662109375,
-0.030609130859375,
0.045013427734375,
0.005603790283203125,
-0.03704833984375,
0.0064697265625,
0.0560302734375,
0.01499176025390625,
0.018524169921875,
-0.01033782958984375,
-0.0031375885009765625,
-0.00914764404296875,
-0.00878143310546875,
0.004985809326171875,
0.02178955078125,
-0.051239013671875,
-0.0048370361328125,
0.033721923828125,
0.04132080078125,
0.058837890625,
0.0106353759765625,
-0.005184173583984375,
0.020355224609375,
-0.0243377685546875,
-0.00940704345703125,
-0.01531219482421875,
0.04425048828125,
-0.01605224609375,
0.006076812744140625,
-0.039337158203125,
0.017364501953125,
-0.0271759033203125,
0.007221221923828125,
-0.023956298828125,
0.01422882080078125,
0.0148162841796875,
0.07244873046875,
0.0018377304077148438,
-0.0179595947265625,
0.0169219970703125,
-0.08734130859375,
-0.0341796875,
0.010162353515625,
-0.040618896484375,
0.037841796875,
-0.0260009765625,
-0.0439453125,
-0.03125,
-0.000705718994140625,
0.00620269775390625,
-0.007396697998046875,
-0.039154052734375,
0.01776123046875,
0.0526123046875,
-0.0018796920776367188,
-0.02313232421875,
-0.0037899017333984375,
0.0048065185546875,
-0.0189208984375,
0.027191162109375,
0.0217132568359375,
0.001861572265625,
-0.016143798828125,
-0.0008769035339355469,
0.025146484375,
0.072998046875,
-0.037811279296875,
-0.00835418701171875,
-0.0255889892578125,
-0.00986480712890625,
-0.0011949539184570312,
0.0032405853271484375,
-0.00324249267578125,
0.0227203369140625,
-0.02801513671875,
0.0293731689453125,
0.0002467632293701172,
0.02001953125,
0.049041748046875,
0.00833892822265625,
0.00787353515625,
0.0384521484375,
-0.032501220703125,
0.0173797607421875,
0.037841796875,
0.0228271484375,
-0.041412353515625,
-0.03448486328125,
0.00855255126953125,
0.0280609130859375,
0.0005574226379394531,
0.0190277099609375,
-0.0100860595703125,
0.0225067138671875,
-0.0142364501953125,
-0.01800537109375,
-0.0186614990234375,
0.00710296630859375,
0.04534912109375,
0.01006317138671875,
-0.0273895263671875,
-0.002231597900390625,
-0.0006132125854492188,
0.057830810546875,
-0.1029052734375,
0.0005559921264648438,
-0.0145416259765625,
-0.06695556640625,
-0.06317138671875,
0.01482391357421875,
-0.0135040283203125,
-0.006198883056640625,
-0.0009450912475585938,
0.05364990234375,
0.034088134765625,
0.045440673828125,
-0.00942230224609375,
-0.004852294921875,
0.03228759765625,
-0.0255126953125,
0.01690673828125,
-0.03387451171875,
-0.03521728515625,
0.010986328125,
-0.011383056640625,
0.04693603515625,
0.025360107421875,
-0.01335906982421875,
0.01284027099609375,
0.0517578125,
0.0333251953125,
0.026031494140625,
-0.017608642578125,
0.00884246826171875,
0.00238037109375,
0.0015163421630859375,
-0.036590576171875,
0.0010480880737304688,
0.044586181640625,
0.004512786865234375,
0.0545654296875,
0.0248260498046875,
-0.01016998291015625,
-0.01316070556640625,
0.011016845703125,
0.00830078125,
-0.0015277862548828125,
0.05413818359375,
0.043670654296875,
0.0174102783203125,
-0.0208740234375,
-0.02850341796875,
0.00531768798828125,
0.04425048828125,
-0.002391815185546875,
0.00592041015625,
-0.0469970703125,
0.0005588531494140625,
-0.0077362060546875,
-0.003520965576171875,
0.0137176513671875,
0.0469970703125,
-0.051544189453125,
-0.036376953125,
0.01006317138671875,
-0.005157470703125,
-0.024261474609375,
0.0004925727844238281,
0.00290679931640625,
-0.0153350830078125,
0.04827880859375,
-0.054901123046875,
0.06689453125,
-0.050079345703125,
0.05572509765625,
0.05633544921875,
-0.0306549072265625,
0.03057861328125,
-0.0147247314453125,
-0.020599365234375,
-0.0330810546875,
0.042327880859375,
0.01091766357421875,
-0.08880615234375,
0.036590576171875,
0.01568603515625,
0.035369873046875,
0.0657958984375,
0.0269927978515625,
-0.0185089111328125,
0.039794921875,
0.069091796875,
0.0074920654296875,
-0.005702972412109375,
0.048095703125,
-0.07373046875,
-0.00823974609375,
-0.0150604248046875,
-0.0556640625,
-0.0204315185546875,
0.034271240234375,
0.00014901161193847656,
-0.0141143798828125,
-0.024688720703125,
-0.00624847412109375,
-0.0192413330078125,
-0.0220947265625,
-0.010650634765625,
0.007549285888671875,
-0.016204833984375,
0.0271453857421875,
0.0136260986328125,
0.0242767333984375,
-0.0296630859375,
0.04559326171875,
0.07415771484375,
-0.01468658447265625,
0.006420135498046875,
0.003204345703125,
-0.037445068359375,
0.007427215576171875,
-0.00959014892578125,
0.00568389892578125,
0.01244354248046875,
-0.0013208389282226562,
0.0008521080017089844,
-0.0262451171875,
0.0343017578125,
0.0364990234375,
-0.01116943359375,
0.001972198486328125,
0.061431884765625,
0.0396728515625,
-0.0199127197265625,
-0.033477783203125,
-0.01242828369140625,
-0.033966064453125,
0.0063323974609375,
0.00853729248046875,
0.0079345703125,
-0.038482666015625,
0.02691650390625,
0.00540924072265625,
0.0048675537109375,
0.037689208984375,
-0.032867431640625,
0.06646728515625,
-0.00507354736328125,
0.007045745849609375,
-0.03863525390625,
-0.02392578125,
-0.0269927978515625,
0.022857666015625,
-0.01485443115234375,
0.012603759765625,
-0.00388336181640625,
0.031341552734375,
0.0028934478759765625,
-0.06396484375,
0.045318603515625,
-0.0482177734375,
-0.0185546875,
-0.06475830078125,
-0.0097503662109375,
-0.0270233154296875,
0.07452392578125,
-0.033447265625,
-0.0197601318359375,
-0.008636474609375,
0.0251007080078125,
-0.05291748046875,
-0.06610107421875,
-0.029754638671875,
-0.004573822021484375,
-0.00452423095703125,
-0.0022525787353515625,
0.0015325546264648438,
0.0010242462158203125,
0.005573272705078125,
0.06854248046875,
0.03582763671875,
-0.019927978515625,
0.04400634765625,
-0.021881103515625,
0.015716552734375,
0.0283660888671875,
-0.006916046142578125,
0.0080413818359375,
-0.055206298828125,
0.005199432373046875,
-0.09454345703125,
-0.0306854248046875,
0.0294036865234375,
0.066650390625,
-0.039703369140625,
-0.010406494140625,
-0.026031494140625,
0.05828857421875,
0.00989532470703125,
0.053924560546875,
-0.0213165283203125,
-0.0151824951171875,
-0.02923583984375,
0.0323486328125,
0.0267791748046875,
-0.0081634521484375,
-0.032073974609375,
-0.0623779296875,
-0.0041961669921875,
0.0081939697265625,
-0.039642333984375,
-0.0042572021484375,
-0.049530029296875,
0.028228759765625,
-0.032501220703125,
-0.039459228515625,
-0.0016336441040039062,
0.0106353759765625,
-0.0113525390625,
-0.007129669189453125,
-0.0256500244140625,
-0.0386962890625,
0.0310211181640625,
-0.003269195556640625,
-0.0156402587890625,
0.007183074951171875,
0.06964111328125,
0.006103515625,
-0.00994873046875,
-0.008697509765625,
-0.028717041015625,
0.0047454833984375,
-0.00628662109375,
0.0308837890625,
0.030670166015625,
0.03643798828125,
-0.05096435546875,
-0.0087738037109375,
0.01763916015625,
-0.00022029876708984375,
0.0362548828125,
0.0091094970703125,
-0.022216796875,
0.0250396728515625,
0.01291656494140625,
-0.02532958984375,
0.026031494140625,
-0.032318115234375,
-0.006916046142578125,
-0.033203125,
0.03857421875,
-0.01934814453125,
0.0303955078125,
-0.037353515625,
-0.00943756103515625,
0.0081329345703125,
-0.0021152496337890625,
0.014617919921875,
0.050689697265625,
-0.0210418701171875,
0.0018949508666992188,
-0.025421142578125,
0.013336181640625,
-0.0114288330078125,
0.01422882080078125,
-0.01336669921875,
0.043914794921875,
-0.032196044921875,
-0.004970550537109375,
-0.0204010009765625,
0.0008497238159179688,
-0.006359100341796875,
-0.0007834434509277344,
-0.048065185546875,
0.00820159912109375,
0.0148773193359375,
0.030609130859375,
0.0125579833984375,
0.0174560546875,
0.0163726806640625,
0.0467529296875,
-0.0203857421875,
-0.01160430908203125,
0.0302886962890625,
0.034637451171875,
-0.0277099609375,
0.01103973388671875,
0.00305938720703125,
0.002048492431640625,
0.0241241455078125,
0.053863525390625,
0.0206298828125,
0.0162811279296875,
-0.039306640625,
0.039276123046875,
0.02032470703125,
0.017791748046875,
0.008056640625,
0.00879669189453125,
0.01104736328125,
-0.0128631591796875,
0.0204010009765625,
-0.04315185546875,
-0.008575439453125,
0.041412353515625,
0.0595703125,
0.016448974609375,
-0.006168365478515625,
-0.0163421630859375,
-0.028778076171875,
-0.0178680419921875,
0.00867462158203125,
0.040863037109375,
-0.005218505859375,
0.0006237030029296875,
0.01483154296875,
0.008331298828125,
0.015899658203125,
-0.0301055908203125,
0.0133819580078125,
-0.0194091796875,
0.0237274169921875,
0.0159912109375,
-0.040191650390625,
0.018524169921875,
0.0167999267578125,
-0.00933074951171875,
-0.030181884765625,
-0.009765625,
-0.0411376953125,
-0.0039215087890625,
-0.0267333984375,
-0.0106353759765625,
0.06024169921875,
-0.01438140869140625,
-0.01320648193359375,
-0.028900146484375,
0.0255279541015625,
-0.0147857666015625,
-0.0025615692138671875,
0.061492919921875,
0.01314544677734375,
0.0272979736328125,
-0.01103973388671875,
-0.043792724609375,
-0.04339599609375,
-0.02459716796875,
-0.022613525390625,
-0.0404052734375,
0.0165863037109375,
0.006191253662109375,
0.01800537109375,
-0.0104522705078125,
-0.0275421142578125,
0.0094757080078125,
0.0038852691650390625,
0.01250457763671875,
-0.00567626953125,
-0.0077667236328125,
0.060638427734375,
-0.0276031494140625,
0.021026611328125,
0.003086090087890625,
0.01552581787109375,
-0.0170440673828125,
0.00020229816436767578,
-0.011016845703125,
-0.0689697265625,
0.0142364501953125,
0.0002644062042236328,
0.00286102294921875,
0.0114593505859375,
-0.00569915771484375,
0.00495147705078125,
0.0289764404296875,
-0.001255035400390625,
0.005157470703125,
-0.01326751708984375,
-0.01087188720703125,
-0.004291534423828125,
0.0251312255859375,
-0.0013904571533203125,
-0.0176239013671875,
0.05126953125,
-0.008575439453125,
-0.01898193359375,
0.0184478759765625,
-0.0266571044921875,
0.0233154296875,
0.03704833984375,
-0.0173187255859375,
-0.00542449951171875,
0.0057373046875,
0.002193450927734375,
0.03204345703125,
-0.0099029541015625,
0.0350341796875,
0.01012420654296875,
0.01336669921875,
-0.0165252685546875,
-0.00762939453125,
0.06585693359375,
0.0294036865234375,
-0.0250701904296875,
0.04656982421875,
-0.03472900390625,
-0.0161590576171875,
-0.002384185791015625,
0.0139617919921875,
-0.00726318359375,
0.00682830810546875,
-0.0090179443359375,
-0.005268096923828125,
0.0097503662109375,
-0.0170440673828125,
0.0083160400390625,
0.030181884765625,
0.0005545616149902344,
0.0008625984191894531,
-0.045501708984375,
-0.0050811767578125,
0.010589599609375,
0.0006780624389648438,
0.01617431640625,
0.0266571044921875,
0.01526641845703125,
0.0158233642578125,
-0.034332275390625,
-0.0168914794921875,
0.0016727447509765625,
-0.01143646240234375,
0.0025768280029296875,
-0.013824462890625,
-0.0117340087890625,
-0.0187225341796875,
0.0218505859375,
-0.0308074951171875,
0.036041259765625,
-0.016937255859375,
0.00264739990234375,
0.0287628173828125,
0.01617431640625,
-0.01287078857421875,
-0.01273345947265625,
0.0007548332214355469,
0.00887298583984375,
-0.0070037841796875,
-0.02154541015625,
-0.0011224746704101562,
0.00901031494140625,
-0.045989990234375,
0.014984130859375,
-0.047637939453125,
-0.0046539306640625,
-0.020904541015625,
-0.033447265625,
0.054656982421875,
-0.0204315185546875,
-0.01093292236328125,
0.0460205078125,
-0.003810882568359375,
-0.038970947265625,
0.0416259765625,
-0.0218963623046875,
-0.03900146484375,
-0.08795166015625,
0.02947998046875,
-0.12078857421875,
-0.016357421875,
0.02618408203125,
-0.075439453125,
0.09124755859375,
0.0008039474487304688,
0.078369140625,
0.0305938720703125,
0.0182342529296875,
-0.0186767578125,
-0.01168060302734375,
-0.00634765625,
0.01026153564453125,
0.037750244140625,
0.0092620849609375,
-0.0305328369140625,
-0.02532958984375,
-0.0011653900146484375,
0.07342529296875,
0.037078857421875,
-0.003231048583984375,
-0.0246124267578125,
0.0002999305725097656,
0.061676025390625,
0.0156402587890625,
0.007640838623046875,
0.04595947265625,
0.0036258697509765625,
-0.056060791015625,
0.013336181640625,
0.0141754150390625,
0.033477783203125,
-0.033355712890625,
0.005046844482421875,
0.002704620361328125,
0.008056640625,
0.00653076171875,
0.0196075439453125,
0.031097412109375,
0.005878448486328125,
0.0034580230712890625,
-0.00024628639221191406,
-0.00702667236328125,
0.04840087890625,
0.028778076171875,
0.07830810546875,
-0.03509521484375,
0.01209259033203125,
-0.0270538330078125,
0.0731201171875,
0.0175018310546875,
-0.0013141632080078125,
0.030242919921875,
0.0177154541015625,
-0.0325927734375,
0.0087890625,
0.00689697265625,
0.0164337158203125,
-0.0170440673828125,
0.0172271728515625,
0.0224609375,
0.0210723876953125,
-0.0167083740234375,
0.0251007080078125,
0.049041748046875,
0.03192138671875,
-0.037017822265625,
-0.0626220703125,
0.02288818359375,
0.0194549560546875,
0.0213470458984375,
0.023468017578125,
0.0246429443359375,
-0.03936767578125,
0.029571533203125,
-0.021270751953125,
-0.00595855712890625,
0.016632080078125,
0.06268310546875,
0.0037479400634765625,
0.0229949951171875,
-0.0831298828125,
-0.037841796875,
-0.0323486328125,
-0.01436614990234375,
0.01043701171875,
0.038787841796875,
0.0220794677734375,
0.032440185546875,
-0.01242828369140625,
-0.0119781494140625,
-0.00873565673828125,
-0.0231475830078125,
0.002910614013671875,
0.0015583038330078125,
0.008758544921875,
0.0162506103515625,
0.0279388427734375,
0.019195556640625,
0.014556884765625,
0.023468017578125,
0.04144287109375,
0.039398193359375,
-0.01006317138671875,
-0.0005841255187988281,
0.050506591796875,
-0.00968170166015625,
0.02734375,
-0.043853759765625,
-0.01538848876953125,
-0.010528564453125,
-0.0233917236328125,
0.004962921142578125,
-0.05126953125,
0.05352783203125,
-0.012176513671875,
0.033050537109375,
-0.003040313720703125,
-0.0300140380859375,
0.06280517578125,
-0.004993438720703125,
0.09674072265625,
0.0165557861328125,
-0.0926513671875,
-0.0279693603515625,
-0.0011644363403320312,
-0.08355712890625,
0.044525146484375,
0.0531005859375,
-0.04058837890625,
0.0021495819091796875,
0.0144805908203125,
-0.047088623046875,
-0.0009164810180664062,
0.0227813720703125,
0.02960205078125,
0.02606201171875,
-0.011322021484375,
0.01122283935546875,
-0.037933349609375,
-0.0242919921875,
-0.016510009765625,
0.01513671875,
0.0029926300048828125,
0.07305908203125,
-0.0185699462890625,
0.01739501953125,
-0.041778564453125,
0.0455322265625,
-0.052093505859375,
-0.0531005859375,
0.072265625,
0.00154876708984375,
-0.01407623291015625,
0.00312042236328125,
-0.01132965087890625,
-0.0030078887939453125,
0.036224365234375,
-0.0224761962890625,
-0.00623321533203125,
-0.01397705078125,
0.02496337890625,
-0.0081787109375,
0.035980224609375,
-0.01427459716796875,
-0.01062774658203125,
-0.04608154296875,
-0.038818359375,
0.048065185546875,
0.03314208984375,
-0.01380157470703125,
0.034088134765625,
0.039886474609375,
-0.0125274658203125,
0.0270233154296875,
-0.0180816650390625,
0.023773193359375,
0.010223388671875,
0.024322509765625,
-0.04986572265625,
0.036895751953125,
0.00916290283203125,
-0.00241851806640625,
0.022735595703125,
0.05126953125,
0.03607177734375,
-0.06927490234375,
0.001129150390625,
-0.00457000732421875,
0.0249786376953125,
0.0013408660888671875,
-0.01207733154296875,
-0.0068359375,
-0.02227783203125,
0.007572174072265625,
-0.0244903564453125,
-0.018341064453125,
-0.053558349609375,
0.0182647705078125,
0.0175628662109375,
0.0038661956787109375,
-0.021087646484375,
-0.0140380859375,
-0.01084136962890625,
0.06854248046875,
0.05596923828125,
-0.0712890625,
0.0394287109375,
-0.0019588470458984375,
-0.0040740966796875,
0.05938720703125,
-0.08172607421875,
0.0243072509765625,
0.0278167724609375,
0.0198822021484375,
-0.00696563720703125,
-0.04071044921875,
-0.0018243789672851562,
-0.036529541015625,
0.0419921875,
0.03448486328125,
-0.042877197265625,
0.032470703125,
0.046051025390625,
0.0556640625,
0.08782958984375,
0.0266265869140625,
-0.0206756591796875,
-0.0194549560546875,
0.0034942626953125,
-0.01435089111328125,
0.015869140625,
0.028411865234375,
-0.025482177734375,
-0.043487548828125,
0.00438690185546875,
0.0248870849609375,
0.054168701171875,
-0.0015516281127929688,
-0.03851318359375,
0.14208984375,
-0.0302581787109375,
-0.0182342529296875,
-0.057647705078125,
-0.001964569091796875,
-0.0193939208984375,
0.03424072265625,
0.0006079673767089844,
-0.044708251953125,
-0.006191253662109375,
0.04400634765625,
-0.016143798828125,
0.00540924072265625,
0.00666046142578125,
-0.04742431640625,
-0.020294189453125,
0.009918212890625,
0.040618896484375,
-0.003871917724609375,
0.02325439453125,
0.0074462890625,
0.0280914306640625,
0.0494384765625,
-0.031341552734375,
0.0640869140625,
-0.0070648193359375,
-0.0132598876953125,
0.007511138916015625,
0.006145477294921875,
-0.049285888671875,
-0.029296875,
0.034576416015625,
0.062347412109375,
0.0170135498046875,
0.0012493133544921875,
-0.034210205078125,
-0.061065673828125,
-0.0745849609375,
-0.0244293212890625,
0.031524658203125,
-0.0736083984375,
0.0144805908203125,
0.0087890625,
0.0227508544921875,
-0.0020351409912109375,
0.01000213623046875,
0.007442474365234375,
-0.026580810546875,
0.0242919921875,
-0.0179290771484375,
0.00005930662155151367,
0.037689208984375,
0.021148681640625,
-0.012847900390625,
0.039520263671875,
-0.0035343170166015625,
-0.0204010009765625,
0.0303497314453125,
0.043365478515625,
-0.0141754150390625,
-0.016357421875,
-0.0157318115234375,
0.027130126953125,
-0.0172576904296875,
0.022613525390625,
-0.051239013671875,
-0.0015516281127929688,
-0.0291900634765625,
0.0165863037109375,
0.0156707763671875,
0.0016651153564453125,
-0.01096343994140625,
0.035308837890625,
0.00997161865234375,
0.04742431640625,
0.021240234375,
0.004871368408203125,
-0.007297515869140625,
0.0618896484375,
-0.01122283935546875,
-0.0296478271484375,
0.01085662841796875,
-0.0362548828125,
-0.006622314453125,
-0.00927734375,
-0.0276336669921875,
-0.06463623046875,
0.0305938720703125,
0.0223388671875,
-0.01438140869140625,
0.0262908935546875
] |
bd32840410e13753d8c210d64274ecef50922984
|
Wordpress Stackexchange
Q: Store source permalink on XMLRPC calls In a theme I'm developing, I need to link to the source post when the post has been stored using XMLRPC. That implies that every time Wordpress asks for a permalink (using get_permalink()) the theme will return a previously saved link. That's accomplished by adding a new filter:
add_action('the_permalink', 'filterPermalink');
function filterPermalink($url) {
$permalink = get_previously_saved_permalink(get_the_ID());
return $permalink? $permalink : $url;
}
That's not the problem (by the moment). The problem is, how to make the same with the metaWeblog.newPost function.
I've already tried something like this:
add_filter('xmlrpc_methods','xml_rpc_functions_to_add');
function xml_rpc_functions_to_add($args) {
$args['metaWeblog.newPost'] = 'add_permalink';
return $args;
}
function add_permalink($args) {
// Do it
}
What I need is to know how to call the previous 'metaWeblog.newPost' from 'add_permalink'.
A: From look at source metaWeblog.newPost seems to be processed in wp_xmlrpc_server->mw_newPost() method.
At the end of this method there is following hook call:
do_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args );
which seems to be very fitting to process and save any additional information for post that have just been created by its ID provided.
|
Q: Store source permalink on XMLRPC calls In a theme I'm developing, I need to link to the source post when the post has been stored using XMLRPC. That implies that every time Wordpress asks for a permalink (using get_permalink()) the theme will return a previously saved link. That's accomplished by adding a new filter:
add_action('the_permalink', 'filterPermalink');
function filterPermalink($url) {
$permalink = get_previously_saved_permalink(get_the_ID());
return $permalink? $permalink : $url;
}
That's not the problem (by the moment). The problem is, how to make the same with the metaWeblog.newPost function.
I've already tried something like this:
add_filter('xmlrpc_methods','xml_rpc_functions_to_add');
function xml_rpc_functions_to_add($args) {
$args['metaWeblog.newPost'] = 'add_permalink';
return $args;
}
function add_permalink($args) {
// Do it
}
What I need is to know how to call the previous 'metaWeblog.newPost' from 'add_permalink'.
A: From look at source metaWeblog.newPost seems to be processed in wp_xmlrpc_server->mw_newPost() method.
At the end of this method there is following hook call:
do_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args );
which seems to be very fitting to process and save any additional information for post that have just been created by its ID provided.
|
wordpress
|
{
"language": "en",
"length": 178,
"provenance": "stackexchange_00019.jsonl.gz:420151",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52815"
}
|
[
0.0634765625,
-0.053863525390625,
0.0787353515625,
-0.018035888671875,
-0.035797119140625,
0.0056610107421875,
0.0284881591796875,
-0.035430908203125,
-0.0020580291748046875,
0.0017261505126953125,
-0.0187530517578125,
0.0187835693359375,
-0.0113525390625,
-0.0247039794921875,
0.0308074951171875,
-0.01059722900390625,
0.045806884765625,
-0.0169525146484375,
0.0440673828125,
0.006069183349609375,
-0.02655029296875,
0.0238037109375,
0.061004638671875,
-0.00690460205078125,
0.011749267578125,
0.006977081298828125,
0.056610107421875,
-0.051239013671875,
0.035858154296875,
-0.0073699951171875,
0.0027065277099609375,
-0.04052734375,
0.034912109375,
-0.01038360595703125,
0.01071929931640625,
0.0019664764404296875,
0.0016450881958007812,
-0.01338958740234375,
0.0026607513427734375,
0.0141754150390625,
0.0239715576171875,
-0.0181884765625,
0.00926971435546875,
0.0301055908203125,
-0.0173187255859375,
-0.0135345458984375,
0.0081634521484375,
-0.035430908203125,
0.003154754638671875,
0.053375244140625,
-0.004520416259765625,
0.00970458984375,
-0.004344940185546875,
0.017547607421875,
0.013031005859375,
-0.0072479248046875,
-0.0240631103515625,
-0.01824951171875,
0.02545166015625,
0.0095367431640625,
-0.0016107559204101562,
-0.01404571533203125,
0.0132904052734375,
-0.0188751220703125,
-0.017181396484375,
0.0120849609375,
-0.004749298095703125,
0.0226287841796875,
-0.0302734375,
-0.0364990234375,
0.0030364990234375,
-0.0219268798828125,
-0.0238800048828125,
0.00482940673828125,
-0.0086517333984375,
-0.013092041015625,
0.01715087890625,
-0.01100921630859375,
-0.0099945068359375,
0.036956787109375,
0.0273590087890625,
0.0018949508666992188,
-0.000514984130859375,
-0.049591064453125,
0.014404296875,
-0.0426025390625,
-0.01055145263671875,
0.00600433349609375,
-0.02508544921875,
-0.055450439453125,
-0.0178375244140625,
-0.0194549560546875,
-0.0229339599609375,
-0.0236968994140625,
-0.041290283203125,
-0.022125244140625,
0.0034122467041015625,
0.042633056640625,
-0.0406494140625,
0.0198974609375,
-0.01224517822265625,
-0.02960205078125,
0.032989501953125,
-0.03277587890625,
-0.0299224853515625,
0.060546875,
0.04119873046875,
0.0277862548828125,
0.0224151611328125,
0.01479339599609375,
0.020233154296875,
0.0125732421875,
0.00498199462890625,
-0.0175933837890625,
-0.0003509521484375,
0.023101806640625,
-0.0247039794921875,
0.033294677734375,
0.00716400146484375,
0.038970947265625,
-0.040679931640625,
-0.00411224365234375,
0.0096588134765625,
-0.0298919677734375,
0.036895751953125,
0.017120361328125,
0.003513336181640625,
-0.023193359375,
-0.0174102783203125,
0.044891357421875,
-0.0007586479187011719,
-0.0070343017578125,
0.00914764404296875,
0.04180908203125,
0.005092620849609375,
-0.028076171875,
0.046600341796875,
-0.05743408203125,
-0.002899169921875,
0.006702423095703125,
0.032440185546875,
-0.0199127197265625,
-0.043243408203125,
0.01274871826171875,
0.038482666015625,
-0.0118560791015625,
0.0020847320556640625,
0.04571533203125,
0.038330078125,
0.040252685546875,
-0.0167388916015625,
0.00609588623046875,
0.01824951171875,
-0.01507568359375,
0.002559661865234375,
-0.06268310546875,
0.00800323486328125,
-0.04290771484375,
0.0258331298828125,
-0.055328369140625,
0.0277252197265625,
-0.0119781494140625,
-0.0193328857421875,
0.0075225830078125,
-0.050567626953125,
0.0275421142578125,
-0.0130157470703125,
-0.0231781005859375,
0.01739501953125,
0.07940673828125,
-0.039306640625,
0.0072784423828125,
-0.0185699462890625,
-0.00786590576171875,
-0.0275726318359375,
-0.023681640625,
-0.037750244140625,
0.01432037353515625,
0.01506805419921875,
0.01763916015625,
-0.00791168212890625,
-0.032958984375,
0.0494384765625,
0.00756072998046875,
-0.07843017578125,
0.058990478515625,
0.031890869140625,
0.108154296875,
-0.0131378173828125,
0.0157928466796875,
0.07110595703125,
0.00977325439453125,
-0.031982421875,
0.00951385498046875,
-0.0007309913635253906,
-0.030609130859375,
0.01220703125,
-0.015411376953125,
-0.0008845329284667969,
0.02935791015625,
-0.0003826618194580078,
0.0276031494140625,
-0.00676727294921875,
0.0118255615234375,
-0.03839111328125,
0.0225372314453125,
-0.0256805419921875,
0.0277557373046875,
-0.00473785400390625,
0.019500732421875,
0.004161834716796875,
-0.01355743408203125,
0.01007080078125,
-0.04412841796875,
-0.003997802734375,
0.037689208984375,
-0.02301025390625,
0.0175018310546875,
-0.0162353515625,
0.019256591796875,
-0.0068817138671875,
-0.038238525390625,
-0.02313232421875,
-0.001819610595703125,
0.03302001953125,
-0.0145416259765625,
-0.008941650390625,
-0.0268402099609375,
-0.029541015625,
0.02020263671875,
-0.07794189453125,
0.03594970703125,
0.0308380126953125,
0.037078857421875,
-0.031494140625,
-0.0158843994140625,
-0.0168609619140625,
-0.041015625,
0.00856781005859375,
0.052032470703125,
0.031402587890625,
0.014251708984375,
0.0290069580078125,
0.0270538330078125,
0.07354736328125,
-0.006488800048828125,
0.03338623046875,
-0.01049041748046875,
-0.0200347900390625,
0.0298309326171875,
0.0205230712890625,
0.039215087890625,
0.01849365234375,
-0.024200439453125,
-0.02130126953125,
0.048309326171875,
-0.020904541015625,
-0.0019330978393554688,
-0.03839111328125,
0.00001817941665649414,
0.02789306640625,
-0.007045745849609375,
-0.0296783447265625,
0.007007598876953125,
0.044403076171875,
-0.00786590576171875,
0.0416259765625,
0.02740478515625,
-0.01282501220703125,
-0.016326904296875,
0.018524169921875,
0.0247650146484375,
-0.0072479248046875,
0.0017290115356445312,
0.046600341796875,
-0.002681732177734375,
-0.023223876953125,
-0.004718780517578125,
0.0020198822021484375,
-0.0009622573852539062,
-0.0138702392578125,
0.037750244140625,
-0.0070037841796875,
-0.0251007080078125,
-0.01396942138671875,
-0.0526123046875,
-0.01776123046875,
-0.039642333984375,
0.0223541259765625,
-0.0341796875,
-0.004398345947265625,
-0.00006723403930664062,
-0.038055419921875,
0.0596923828125,
0.02410888671875,
-0.05206298828125,
-0.002811431884765625,
-0.031280517578125,
0.012481689453125,
-0.031951904296875,
0.060211181640625,
0.0560302734375,
-0.0029735565185546875,
0.013580322265625,
0.00008958578109741211,
-0.0247955322265625,
-0.00930023193359375,
0.005615234375,
-0.0290374755859375,
-0.0194854736328125,
-0.074462890625,
-0.014373779296875,
0.0093536376953125,
-0.033935546875,
-0.002399444580078125,
-0.035491943359375,
-0.01154327392578125,
-0.0147552490234375,
-0.09075927734375,
-0.037811279296875,
-0.00557708740234375,
-0.05938720703125,
-0.008087158203125,
-0.010345458984375,
-0.032379150390625,
-0.0072021484375,
-0.0006742477416992188,
0.0011358261108398438,
0.002155303955078125,
-0.00896453857421875,
-0.0928955078125,
-0.0577392578125,
-0.08538818359375,
0.01141357421875,
-0.0161285400390625,
0.016448974609375,
0.00649261474609375,
0.007541656494140625,
-0.0162506103515625,
-0.04681396484375,
-0.01230621337890625,
0.0166778564453125,
-0.028564453125,
-0.03582763671875,
-0.0089874267578125,
-0.0294036865234375,
-0.0035686492919921875,
-0.01552581787109375,
0.055633544921875,
0.03753662109375,
-0.0244903564453125,
0.03173828125,
-0.007045745849609375,
0.0029125213623046875,
0.0245361328125,
0.0066680908203125,
0.005863189697265625,
0.0108642578125,
0.030731201171875,
-0.034759521484375,
-0.00897216796875,
-0.00588226318359375,
-0.038360595703125,
-0.02044677734375,
0.0156097412109375,
-0.00270843505859375,
-0.01035308837890625,
0.005954742431640625,
0.011810302734375,
0.0167083740234375,
0.0670166015625,
0.0151519775390625,
-0.00830841064453125,
-0.03509521484375,
-0.060211181640625,
-0.055145263671875,
0.06048583984375,
-0.0191650390625,
0.00855255126953125,
0.020660400390625,
-0.0183868408203125,
-0.005657196044921875,
-0.037872314453125,
-0.021728515625,
-0.0261077880859375,
0.0304412841796875,
-0.0693359375,
-0.0008959770202636719,
-0.0528564453125,
-0.0094451904296875,
-0.036407470703125,
0.060302734375,
-0.014068603515625,
-0.0266265869140625,
-0.03216552734375,
0.01007080078125,
-0.021575927734375,
-0.0582275390625,
0.023406982421875,
-0.0034427642822265625,
-0.032623291015625,
-0.0261077880859375,
-0.006793975830078125,
-0.0205230712890625,
0.01325225830078125,
-0.020477294921875,
-0.017730712890625,
-0.02935791015625,
0.045654296875,
-0.0297088623046875,
0.040985107421875,
0.004741668701171875,
0.01409149169921875,
-0.00640106201171875,
-0.04241943359375,
-0.01009368896484375,
-0.1107177734375,
-0.01824951171875,
0.01300811767578125,
0.07769775390625,
0.0106658935546875,
-0.068115234375,
-0.034576416015625,
0.046722412109375,
-0.0308685302734375,
0.029144287109375,
-0.0265045166015625,
0.020233154296875,
-0.0174713134765625,
0.00641632080078125,
-0.0170440673828125,
-0.01068115234375,
0.01251983642578125,
0.0142364501953125,
-0.01953125,
0.0297698974609375,
-0.04229736328125,
-0.018798828125,
-0.0195770263671875,
-0.0357666015625,
-0.05596923828125,
-0.033111572265625,
0.0035800933837890625,
0.0198822021484375,
-0.011932373046875,
-0.0005383491516113281,
-0.0574951171875,
-0.058135986328125,
-0.01434326171875,
-0.045928955078125,
-0.022064208984375,
0.0256195068359375,
0.0489501953125,
0.0232391357421875,
0.016754150390625,
-0.0472412109375,
0.0173187255859375,
0.00662994384765625,
-0.0149688720703125,
0.069091796875,
0.031494140625,
0.022857666015625,
-0.0207366943359375,
-0.0300750732421875,
0.02056884765625,
-0.0203857421875,
0.02154541015625,
0.00585174560546875,
-0.01119232177734375,
0.027923583984375,
0.004970550537109375,
-0.01479339599609375,
0.0258941650390625,
-0.0211029052734375,
-0.01568603515625,
-0.021942138671875,
0.05194091796875,
-0.031829833984375,
0.050750732421875,
-0.0406494140625,
-0.047332763671875,
0.0233306884765625,
-0.050048828125,
0.0445556640625,
0.033050537109375,
-0.016845703125,
0.0269317626953125,
-0.0110931396484375,
0.01529693603515625,
-0.0275115966796875,
0.0079498291015625,
-0.026153564453125,
0.05609130859375,
-0.03900146484375,
0.0025081634521484375,
-0.0138702392578125,
-0.0034694671630859375,
-0.01450347900390625,
0.0170440673828125,
-0.0149993896484375,
0.00839996337890625,
-0.0108489990234375,
-0.00879669189453125,
-0.0022602081298828125,
-0.011688232421875,
0.035797119140625,
0.0221405029296875,
-0.0300750732421875,
-0.0191802978515625,
-0.006778717041015625,
-0.032562255859375,
-0.047027587890625,
-0.00411224365234375,
-0.01163482666015625,
0.004543304443359375,
-0.0206451416015625,
0.07464599609375,
-0.0233612060546875,
0.04620361328125,
-0.0222015380859375,
0.003414154052734375,
0.04632568359375,
0.0172271728515625,
0.042327880859375,
-0.01181793212890625,
-0.0180206298828125,
-0.00724029541015625,
0.00867462158203125,
-0.0297393798828125,
-0.0270843505859375,
0.02764892578125,
0.0245819091796875,
-0.0079193115234375,
0.00518798828125,
0.018768310546875,
0.02825927734375,
-0.00943756103515625,
0.0121917724609375,
0.0206146240234375,
-0.0293731689453125,
-0.0089263916015625,
0.0218963623046875,
0.01617431640625,
-0.01094818115234375,
0.00986480712890625,
-0.006244659423828125,
0.034088134765625,
0.0489501953125,
-0.035919189453125,
0.021087646484375,
0.003803253173828125,
-0.01030731201171875,
0.01611328125,
-0.03466796875,
0.00799560546875,
0.03216552734375,
0.042816162109375,
-0.06292724609375,
-0.0304412841796875,
0.062408447265625,
0.01360321044921875,
0.08056640625,
-0.034820556640625,
-0.043212890625,
-0.0250701904296875,
0.0015249252319335938,
0.0216064453125,
0.003482818603515625,
-0.053253173828125,
-0.00098419189453125,
-0.00670623779296875,
0.0038299560546875,
0.004772186279296875,
-0.003253936767578125,
-0.0237884521484375,
-0.01454925537109375,
-0.003204345703125,
0.008331298828125,
-0.0254974365234375,
-0.0017995834350585938,
0.017242431640625,
0.0244293212890625,
-0.0147705078125,
0.01552581787109375,
-0.0281982421875,
0.09454345703125,
-0.02239990234375,
0.07171630859375,
0.004367828369140625,
0.0279083251953125,
-0.040863037109375,
-0.009124755859375,
-0.0101776123046875,
-0.062347412109375,
-0.03631591796875,
0.0255584716796875,
-0.0367431640625,
0.02862548828125,
0.016876220703125,
-0.0065460205078125,
0.0209197998046875,
-0.0031795501708984375,
-0.00933837890625,
-0.016693115234375,
-0.029510498046875,
0.003444671630859375,
-0.00984954833984375,
0.0211334228515625,
-0.0029754638671875,
0.03076171875,
-0.005702972412109375,
0.0054779052734375,
-0.011474609375,
-0.01102447509765625,
-0.0027599334716796875,
0.0167999267578125,
0.0030612945556640625,
0.045318603515625,
0.0621337890625,
0.0191802978515625,
0.054718017578125,
0.0264434814453125,
0.0216522216796875,
-0.00164794921875,
0.004764556884765625,
0.0180816650390625,
0.0182037353515625,
0.03729248046875,
0.0004439353942871094,
0.0131988525390625,
0.0210113525390625,
-0.0279388427734375,
-0.00391387939453125,
-0.029449462890625,
0.0249786376953125,
0.0225372314453125,
0.0232391357421875,
0.025634765625,
-0.0048370361328125,
0.01995849609375,
0.034881591796875,
-0.0163421630859375,
-0.00516510009765625,
0.00724029541015625,
-0.048675537109375,
-0.0037708282470703125,
0.01216888427734375,
-0.01224517822265625,
-0.00377655029296875,
0.0079803466796875,
-0.0130462646484375,
0.0133514404296875,
-0.026611328125,
0.0064697265625,
0.0221710205078125,
0.00647735595703125,
-0.0458984375,
-0.00545501708984375,
-0.0298614501953125,
-0.004638671875,
-0.06488037109375,
-0.0298614501953125,
-0.0201873779296875,
0.031982421875,
0.031768798828125,
-0.02294921875,
0.05523681640625,
0.032806396484375,
-0.0009307861328125,
0.021331787109375,
0.0035419464111328125,
0.037353515625,
-0.035858154296875,
-0.0577392578125,
0.02203369140625,
0.01134490966796875,
-0.01105499267578125,
0.036712646484375,
0.0194091796875,
-0.07244873046875,
0.01947021484375,
0.0149078369140625,
0.05316162109375,
-0.03863525390625,
-0.0182647705078125,
0.047607421875,
-0.01523590087890625,
-0.0218505859375,
-0.00746917724609375,
0.01474761962890625,
-0.0672607421875,
-0.046600341796875,
-0.01427459716796875,
-0.05218505859375,
0.00547027587890625,
-0.0380859375,
-0.061767578125,
0.1378173828125,
0.011932373046875,
0.051116943359375,
0.009552001953125,
0.0399169921875,
-0.022125244140625,
0.0229949951171875,
-0.043701171875,
0.060821533203125,
-0.002330780029296875,
0.0203857421875,
-0.08331298828125,
-0.016387939453125,
-0.02935791015625,
0.037811279296875,
0.0869140625,
0.02130126953125,
-0.0767822265625,
0.003570556640625,
0.0592041015625,
-0.00396728515625,
-0.01348876953125,
0.07379150390625,
-0.0231781005859375,
0.043487548828125,
0.0297088623046875,
-0.06451416015625,
0.0194244384765625,
-0.019927978515625,
-0.0296173095703125,
-0.01415252685546875,
0.005138397216796875,
0.0156097412109375,
-0.002277374267578125,
-0.00926971435546875,
-0.0208740234375,
-0.0010776519775390625,
0.024322509765625,
-0.0341796875,
0.00492095947265625,
-0.0175628662109375,
-0.01270294189453125,
-0.06365966796875,
-0.036590576171875,
-0.00965118408203125,
0.01201629638671875,
-0.01580810546875,
0.0189361572265625,
0.039886474609375,
0.0182342529296875,
0.04486083984375,
-0.03314208984375,
0.009490966796875,
-0.019500732421875,
-0.0039005279541015625,
0.09588623046875,
0.04718017578125,
0.053314208984375,
-0.0249786376953125,
-0.0020389556884765625,
0.0330810546875,
0.11383056640625,
-0.058807373046875,
-0.0237884521484375,
0.0068206787109375,
0.0162353515625,
0.00940704345703125,
0.00026154518127441406,
0.04241943359375,
-0.0218658447265625,
0.00861358642578125,
-0.031402587890625,
-0.001956939697265625,
0.03076171875,
0.04241943359375,
-0.0010356903076171875,
-0.01190185546875,
-0.064208984375,
-0.0186004638671875,
-0.00337982177734375,
-0.023345947265625,
-0.0224761962890625,
0.059967041015625,
0.034637451171875,
0.04144287109375,
-0.0751953125,
-0.0201263427734375,
-0.01222991943359375,
0.0141143798828125,
0.00528717041015625,
0.0207061767578125,
-0.0256805419921875,
-0.00029587745666503906,
0.004169464111328125,
0.0182342529296875,
0.033111572265625,
0.05169677734375,
0.047119140625,
-0.021942138671875,
-0.047454833984375,
0.0165252685546875,
-0.0017576217651367188,
-0.044677734375,
0.052734375,
-0.045745849609375,
-0.01126861572265625,
-0.0244598388671875,
-0.032440185546875,
-0.020050048828125,
-0.047882080078125,
0.041168212890625,
-0.037322998046875,
0.00922393798828125,
-0.009979248046875,
-0.03887939453125,
0.026611328125,
-0.0164947509765625,
0.049102783203125,
-0.01090240478515625,
-0.029083251953125,
0.01561737060546875,
-0.035797119140625,
-0.0305023193359375,
0.01934814453125,
0.029876708984375,
-0.01389312744140625,
0.0225372314453125,
-0.0016307830810546875,
0.0276031494140625,
-0.0030498504638671875,
-0.0172119140625,
-0.020294189453125,
0.0247955322265625,
0.050537109375,
0.01288604736328125,
-0.015777587890625,
-0.01212310791015625,
0.00634002685546875,
0.0281829833984375,
-0.003253936767578125,
0.0830078125,
-0.020721435546875,
0.0017137527465820312,
-0.01004791259765625,
-0.038421630859375,
0.022247314453125,
-0.00965118408203125,
-0.0033893585205078125,
0.019439697265625,
0.005939483642578125,
-0.004673004150390625,
-0.0239105224609375,
0.00225067138671875,
0.0236358642578125,
-0.0214385986328125,
-0.0019626617431640625,
-0.0280303955078125,
0.0228729248046875,
0.00830841064453125,
0.048492431640625,
-0.040557861328125,
-0.040740966796875,
-0.072998046875,
-0.03192138671875,
0.0298614501953125,
0.00211334228515625,
-0.008056640625,
0.06884765625,
0.01439666748046875,
-0.00835418701171875,
0.0230560302734375,
-0.04937744140625,
0.032745361328125,
0.03497314453125,
0.003875732421875,
-0.00444793701171875,
0.0153350830078125,
-0.018951416015625,
0.017669677734375,
-0.0020046234130859375,
0.0078277587890625,
0.0238037109375,
-0.07135009765625,
-0.01432037353515625,
0.00965118408203125,
0.0280914306640625,
-0.013580322265625,
0.00644683837890625,
-0.0006685256958007812,
-0.00711822509765625,
-0.02191162109375,
0.020294189453125,
-0.0305023193359375,
-0.068603515625,
0.01056671142578125,
-0.0105438232421875,
-0.021209716796875,
-0.05889892578125,
0.01525115966796875,
0.01201629638671875,
0.060577392578125,
0.0204315185546875,
-0.052337646484375,
0.038818359375,
-0.0222930908203125,
0.0082244873046875,
0.032745361328125,
-0.01251983642578125,
0.00701904296875,
0.057769775390625,
-0.0033206939697265625,
-0.05157470703125,
-0.0166778564453125,
0.037078857421875,
-0.046478271484375,
-0.022674560546875,
0.006305694580078125,
-0.01059722900390625,
-0.032684326171875,
-0.046356201171875,
-0.00698089599609375,
0.0016317367553710938,
0.04022216796875,
-0.01317596435546875,
0.022979736328125,
0.01141357421875,
-0.0024585723876953125,
-0.04327392578125,
-0.009735107421875,
-0.019073486328125,
0.02117919921875,
-0.038421630859375,
0.0155181884765625,
0.01091766357421875,
-0.0282135009765625,
-0.04315185546875,
0.0300750732421875,
-0.0178070068359375,
-0.01265716552734375,
-0.08367919921875,
0.0183868408203125,
0.01885986328125,
0.0263519287109375,
-0.0176849365234375,
-0.0282745361328125,
-0.0521240234375,
0.0240936279296875,
0.0021533966064453125,
0.00797271728515625,
0.034942626953125,
-0.0189666748046875,
-0.00795745849609375,
-0.006092071533203125,
0.005168914794921875,
-0.0170135498046875,
0.0004608631134033203,
-0.02008056640625,
0.0323486328125,
0.039031982421875,
-0.047088623046875,
-0.01416015625,
0.0029354095458984375,
0.030670166015625,
-0.01119232177734375,
-0.053314208984375,
-0.0330810546875,
-0.0282135009765625,
0.07537841796875,
0.03692626953125,
0.0243988037109375,
-0.03448486328125,
0.030181884765625,
0.005558013916015625,
-0.020599365234375,
-0.0025463104248046875,
0.0287628173828125,
-0.05963134765625,
-0.0158538818359375,
0.0110321044921875,
-0.00788116455078125,
0.0181121826171875,
-0.02386474609375,
-0.037139892578125,
0.005878448486328125,
-0.0150909423828125,
0.0035800933837890625,
-0.06256103515625,
-0.029205322265625,
0.0726318359375,
-0.0399169921875,
0.0240325927734375,
-0.003299713134765625,
0.016021728515625,
0.050445556640625,
0.0126495361328125,
0.0033893585205078125,
0.0307159423828125,
-0.01165008544921875,
-0.00969696044921875,
0.047027587890625,
-0.0005006790161132812,
0.0269012451171875,
-0.00949859619140625,
-0.0007429122924804688,
-0.00560760498046875,
-0.008880615234375,
-0.0302276611328125,
-0.0094146728515625,
-0.0018758773803710938,
-0.027374267578125,
0.1058349609375,
-0.036224365234375,
-0.01291656494140625,
-0.01348114013671875,
0.01486968994140625,
-0.018798828125,
0.0087738037109375,
0.0301361083984375,
-0.02288818359375,
0.004451751708984375,
-0.0165863037109375,
0.0007195472717285156,
-0.03521728515625,
0.0138397216796875,
-0.0248260498046875,
-0.0172882080078125,
0.01375579833984375
] |
10a61c98a97cec9a6265355aa2daf35d8d713684
|
Wordpress Stackexchange
Q: Integrate Wordpress and bbpress profiles? I have installed bbforum plugin in my wordpress. However It has two separate profiles for the blog users and the forum users. Blog users have profiles url:
/author/test/
While forum users have profile:
/forums/users/test/
Is it possible to integrate both profiles and make only a single profile? So that the users in forums also have same url as the blog profile? Thanks
A: Get redirection plugin to redirect the /profile.php to bbpress profile. Then there is a plugin called admin menu editor where you can completely remove the profile the admin menu (and other unwanted admin menu items).
Or you can replace the wordpress profile with just email and password
wordpress.org/extend/plugins/change-password-e-mail/
|
Q: Integrate Wordpress and bbpress profiles? I have installed bbforum plugin in my wordpress. However It has two separate profiles for the blog users and the forum users. Blog users have profiles url:
/author/test/
While forum users have profile:
/forums/users/test/
Is it possible to integrate both profiles and make only a single profile? So that the users in forums also have same url as the blog profile? Thanks
A: Get redirection plugin to redirect the /profile.php to bbpress profile. Then there is a plugin called admin menu editor where you can completely remove the profile the admin menu (and other unwanted admin menu items).
Or you can replace the wordpress profile with just email and password
wordpress.org/extend/plugins/change-password-e-mail/
A: The short answer is that it is possible. The long answer is that you'll likely have to adjust one or the other's authentication methods to use the other scripts functions. You would also need to alter the session handling sections of both codes so that a user will be logged into both when they log into one of the scripts. This can be extremely complicated and will require a break check every time either application is altered.
A possible third option is to add a hook into the user creation methods of both scripts and add the user to the alternate application at the same time. You would also need to update the password for the alternate application at the same time as well. The big problem with this method is that users would still need to log into both applications independently.
A: Personally, i'd go for another plugin: WP Symposium (http://wordpress.org/extend/plugins/wp-symposium/). It allows a lot of customization, provides profile and forum functionality (among many others) and the plugin author is very good at listening to its users.
|
wordpress
|
{
"language": "en",
"length": 296,
"provenance": "stackexchange_00019.jsonl.gz:420157",
"question_score": "17",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52830"
}
|
[
0.08355712890625,
-0.00617218017578125,
0.032073974609375,
-0.047332763671875,
-0.0015077590942382812,
0.0023193359375,
0.01093292236328125,
-0.051239013671875,
-0.01375579833984375,
0.0265655517578125,
0.0299072265625,
0.007747650146484375,
-0.01331329345703125,
-0.033538818359375,
-0.00579833984375,
-0.01837158203125,
0.005405426025390625,
0.00759124755859375,
0.009979248046875,
-0.0220184326171875,
0.018096923828125,
-0.0207977294921875,
-0.013275146484375,
-0.0232696533203125,
0.026885986328125,
-0.010894775390625,
0.02899169921875,
-0.034332275390625,
0.035980224609375,
-0.0035724639892578125,
0.029693603515625,
-0.02374267578125,
-0.007297515869140625,
0.03961181640625,
-0.0273590087890625,
-0.05841064453125,
-0.01325225830078125,
0.027496337890625,
0.006694793701171875,
0.006801605224609375,
0.01026153564453125,
0.006191253662109375,
-0.0105438232421875,
0.08197021484375,
-0.0335693359375,
-0.07269287109375,
0.0289764404296875,
-0.023406982421875,
0.04193115234375,
0.0205535888671875,
0.019256591796875,
0.0029621124267578125,
0.0219879150390625,
-0.038177490234375,
-0.020538330078125,
-0.0188751220703125,
-0.022613525390625,
0.01253509521484375,
0.0175933837890625,
0.0030040740966796875,
0.0021991729736328125,
-0.0034008026123046875,
0.01349639892578125,
0.0035266876220703125,
-0.0175323486328125,
-0.034515380859375,
-0.050079345703125,
0.02496337890625,
-0.055084228515625,
-0.03704833984375,
0.047637939453125,
-0.032196044921875,
0.0159759521484375,
-0.02398681640625,
-0.054595947265625,
0.00339508056640625,
0.0028076171875,
-0.02099609375,
0.0263214111328125,
-0.0311279296875,
-0.03619384765625,
-0.044952392578125,
-0.03594970703125,
-0.0284271240234375,
0.0123291015625,
0.01342010498046875,
-0.0110626220703125,
0.00989532470703125,
-0.027557373046875,
0.0263519287109375,
-0.032745361328125,
-0.03900146484375,
-0.034515380859375,
0.0830078125,
0.01410675048828125,
0.0276031494140625,
0.009735107421875,
0.036895751953125,
-0.00881195068359375,
0.0252838134765625,
0.0128936767578125,
-0.04248046875,
0.04046630859375,
-0.032867431640625,
0.01010894775390625,
0.06646728515625,
-0.02117919921875,
-0.006160736083984375,
0.03173828125,
0.034881591796875,
0.0238189697265625,
-0.0011320114135742188,
-0.0123443603515625,
-0.0306243896484375,
0.01206207275390625,
0.012451171875,
-0.041595458984375,
0.042144775390625,
0.01222991943359375,
0.0019483566284179688,
-0.036651611328125,
-0.0009055137634277344,
-0.00815582275390625,
0.053314208984375,
-0.04339599609375,
-0.032440185546875,
0.02423095703125,
-0.00949859619140625,
-0.048919677734375,
0.0002627372741699219,
-0.0027141571044921875,
0.027130126953125,
0.055755615234375,
0.039642333984375,
-0.01377105712890625,
-0.018280029296875,
0.0291290283203125,
-0.0203857421875,
-0.03192138671875,
0.0300140380859375,
-0.00431060791015625,
-0.023193359375,
-0.024505615234375,
-0.039703369140625,
-0.01396942138671875,
0.058563232421875,
0.0301513671875,
-0.027099609375,
-0.03509521484375,
-0.0362548828125,
-0.05047607421875,
-0.00955963134765625,
-0.0100250244140625,
0.02508544921875,
0.039215087890625,
-0.013580322265625,
0.027740478515625,
-0.033416748046875,
0.037872314453125,
-0.0111236572265625,
-0.0033817291259765625,
-0.0084991455078125,
0.03314208984375,
-0.0081024169921875,
-0.038238525390625,
0.006320953369140625,
-0.01015472412109375,
-0.00560760498046875,
0.0108184814453125,
-0.0948486328125,
0.01309967041015625,
-0.00766754150390625,
-0.0005087852478027344,
-0.0006895065307617188,
0.039398193359375,
0.04168701171875,
0.0008983612060546875,
0.06353759765625,
0.01499176025390625,
0.033050537109375,
0.005977630615234375,
-0.037139892578125,
0.08917236328125,
-0.0291290283203125,
-0.052581787109375,
0.043060302734375,
-0.001224517822265625,
0.03662109375,
0.0263519287109375,
0.0031890869140625,
0.0262298583984375,
0.03167724609375,
-0.01824951171875,
0.03521728515625,
0.00789642333984375,
-0.047119140625,
0.0199432373046875,
-0.01096343994140625,
0.0114593505859375,
-0.00945281982421875,
-0.0034542083740234375,
0.02264404296875,
-0.006809234619140625,
0.000057697296142578125,
-0.040771484375,
0.01220703125,
-0.004436492919921875,
0.032684326171875,
0.00823974609375,
0.0080413818359375,
-0.005329132080078125,
-0.010772705078125,
0.00797271728515625,
-0.040496826171875,
-0.01154327392578125,
0.025726318359375,
-0.00653839111328125,
0.0166778564453125,
0.00853729248046875,
0.027435302734375,
-0.00611114501953125,
0.033355712890625,
-0.0186004638671875,
-0.014068603515625,
0.050567626953125,
-0.034881591796875,
-0.01177215576171875,
-0.037933349609375,
0.014739990234375,
-0.017059326171875,
-0.0283966064453125,
0.048858642578125,
-0.026580810546875,
-0.0111236572265625,
-0.03155517578125,
0.0238189697265625,
-0.00969696044921875,
0.0119171142578125,
-0.01457977294921875,
0.0203094482421875,
0.024444580078125,
0.006496429443359375,
-0.00940704345703125,
-0.0036220550537109375,
0.0192108154296875,
-0.02056884765625,
0.01355743408203125,
-0.005840301513671875,
0.057586669921875,
0.1033935546875,
-0.04150390625,
-0.005954742431640625,
0.0010700225830078125,
-0.0693359375,
0.0161590576171875,
0.035247802734375,
-0.045654296875,
-0.0293121337890625,
0.034698486328125,
-0.03375244140625,
0.00017821788787841797,
-0.0693359375,
0.000438690185546875,
-0.037139892578125,
0.0364990234375,
-0.04974365234375,
0.00994110107421875,
0.0107269287109375,
-0.01342010498046875,
-0.036224365234375,
0.02801513671875,
0.0209808349609375,
-0.013458251953125,
-0.01068878173828125,
0.041534423828125,
-0.0091400146484375,
-0.023773193359375,
0.0030689239501953125,
0.0213165283203125,
-0.0016574859619140625,
0.0188751220703125,
-0.01043701171875,
-0.0217742919921875,
0.0026721954345703125,
0.02685546875,
-0.0196075439453125,
0.0171966552734375,
0.050323486328125,
-0.01000213623046875,
-0.026397705078125,
0.0122222900390625,
-0.00888824462890625,
-0.033905029296875,
0.034332275390625,
-0.0341796875,
-0.037628173828125,
-0.004856109619140625,
-0.045074462890625,
0.050506591796875,
-0.0372314453125,
0.0217132568359375,
0.06988525390625,
0.0026569366455078125,
0.00785064697265625,
-0.00914764404296875,
0.02728271484375,
-0.0233001708984375,
0.038787841796875,
0.018402099609375,
-0.08038330078125,
0.060302734375,
0.048828125,
0.01346588134765625,
-0.039306640625,
0.04443359375,
0.013641357421875,
-0.0022983551025390625,
0.021270751953125,
0.01445770263671875,
0.0338134765625,
-0.055023193359375,
-0.065673828125,
0.00203704833984375,
0.0083160400390625,
-0.0213623046875,
0.0161590576171875,
0.0406494140625,
0.020050048828125,
-0.0040740966796875,
-0.005619049072265625,
-0.05743408203125,
-0.0804443359375,
-0.07684326171875,
-0.041168212890625,
-0.0133514404296875,
0.0081634521484375,
-0.0008435249328613281,
0.0172576904296875,
-0.0019044876098632812,
-0.001766204833984375,
0.02587890625,
0.04364013671875,
0.01500701904296875,
-0.0191650390625,
-0.0259246826171875,
0.0033664703369140625,
-0.01068878173828125,
-0.003917694091796875,
0.068603515625,
0.01486968994140625,
-0.0360107421875,
0.01194000244140625,
0.0038394927978515625,
-0.0265350341796875,
-0.006977081298828125,
-0.0203704833984375,
0.0017833709716796875,
-0.01045989990234375,
-0.0305938720703125,
-0.04901123046875,
0.03448486328125,
0.00354766845703125,
-0.01293182373046875,
-0.029693603515625,
-0.001956939697265625,
-0.037933349609375,
-0.013397216796875,
-0.018280029296875,
0.00799560546875,
0.03509521484375,
0.01593017578125,
-0.0079193115234375,
0.038665771484375,
-0.01360321044921875,
-0.006900787353515625,
-0.030853271484375,
-0.018463134765625,
-0.049591064453125,
-0.01290130615234375,
-0.04669189453125,
-0.039459228515625,
-0.03363037109375,
0.0151824951171875,
-0.01490020751953125,
-0.03985595703125,
0.039215087890625,
-0.036376953125,
0.014617919921875,
-0.048187255859375,
-0.014678955078125,
-0.026519775390625,
0.07611083984375,
-0.01136016845703125,
0.0171661376953125,
0.006534576416015625,
0.005279541015625,
-0.06268310546875,
-0.03607177734375,
-0.08966064453125,
0.00414276123046875,
-0.007556915283203125,
-0.020416259765625,
-0.031158447265625,
-0.0029659271240234375,
0.01013946533203125,
-0.032379150390625,
0.0282135009765625,
-0.045501708984375,
0.0236663818359375,
-0.01108551025390625,
0.0237884521484375,
0.025848388671875,
0.0238037109375,
-0.00695037841796875,
-0.01800537109375,
-0.006855010986328125,
-0.062347412109375,
0.0035419464111328125,
0.0037975311279296875,
0.0275726318359375,
-0.00896453857421875,
-0.0245513916015625,
-0.023773193359375,
0.0210113525390625,
-0.0087432861328125,
0.01206207275390625,
0.0228424072265625,
0.03424072265625,
-0.0230712890625,
0.007656097412109375,
0.01389312744140625,
-0.0293426513671875,
-0.0029544830322265625,
-0.0141143798828125,
-0.028472900390625,
-0.016632080078125,
-0.024261474609375,
-0.0176239013671875,
-0.00028204917907714844,
-0.046173095703125,
-0.06561279296875,
-0.034637451171875,
-0.0158233642578125,
-0.0180816650390625,
0.016326904296875,
-0.0164337158203125,
-0.0312347412109375,
-0.0479736328125,
0.03521728515625,
-0.057647705078125,
-0.0017900466918945312,
0.01166534423828125,
0.07330322265625,
0.00769805908203125,
-0.0005092620849609375,
-0.01403045654296875,
0.0268402099609375,
0.01328277587890625,
-0.036773681640625,
0.08203125,
0.036773681640625,
0.0169677734375,
0.0229034423828125,
-0.036346435546875,
0.01910400390625,
-0.035614013671875,
0.038848876953125,
-0.0015411376953125,
0.007511138916015625,
0.017333984375,
0.00009816884994506836,
-0.00691986083984375,
-0.0037136077880859375,
0.004177093505859375,
-0.018402099609375,
0.018768310546875,
0.040863037109375,
-0.00485992431640625,
-0.004116058349609375,
-0.0128936767578125,
-0.042266845703125,
0.01068115234375,
-0.036163330078125,
0.0236968994140625,
0.005504608154296875,
0.0058441162109375,
0.0224609375,
0.034423828125,
-0.0220947265625,
0.045440673828125,
-0.013916015625,
0.0193634033203125,
-0.0014781951904296875,
0.033660888671875,
-0.0240631103515625,
0.0102996826171875,
-0.0033721923828125,
0.058807373046875,
0.01055145263671875,
-0.0391845703125,
-0.0172119140625,
-0.01276397705078125,
0.0078277587890625,
0.00839996337890625,
0.0222015380859375,
0.042633056640625,
0.0017805099487304688,
-0.021820068359375,
-0.0085906982421875,
-0.011871337890625,
-0.0283355712890625,
-0.047210693359375,
0.0191650390625,
-0.033172607421875,
0.0146942138671875,
0.0285491943359375,
0.056976318359375,
0.00847625732421875,
0.0297088623046875,
-0.019683837890625,
0.054931640625,
0.06256103515625,
0.0169219970703125,
0.0239410400390625,
0.0052337646484375,
-0.0589599609375,
0.0306854248046875,
-0.0596923828125,
-0.007659912109375,
0.043792724609375,
0.01322174072265625,
-0.00433349609375,
0.052215576171875,
-0.005126953125,
-0.0023632049560546875,
-0.0238494873046875,
-0.031768798828125,
0.016357421875,
0.019622802734375,
-0.01641845703125,
-0.0028705596923828125,
-0.003021240234375,
-0.006160736083984375,
0.00841522216796875,
0.0167999267578125,
-0.01544952392578125,
0.00965118408203125,
-0.012481689453125,
0.01561737060546875,
-0.037841796875,
-0.010467529296875,
0.0107879638671875,
0.0280914306640625,
-0.03424072265625,
0.0010061264038085938,
-0.0246124267578125,
0.0242156982421875,
-0.0452880859375,
-0.0138092041015625,
0.0494384765625,
-0.02606201171875,
0.022064208984375,
-0.034576416015625,
0.01059722900390625,
-0.00670623779296875,
-0.01519775390625,
0.091796875,
0.06646728515625,
-0.0249176025390625,
0.01094818115234375,
-0.0321044921875,
-0.020843505859375,
0.007476806640625,
-0.0281982421875,
-0.041046142578125,
-0.019378662109375,
0.0121307373046875,
0.0177459716796875,
0.02587890625,
0.037322998046875,
0.0015420913696289062,
0.016357421875,
-0.0132293701171875,
0.0255889892578125,
-0.02020263671875,
0.02960205078125,
0.01462554931640625,
0.0635986328125,
0.01299285888671875,
0.0229644775390625,
-0.01103973388671875,
-0.036163330078125,
0.00882720947265625,
-0.009674072265625,
-0.0187530517578125,
-0.01102447509765625,
-0.0203857421875,
0.01259613037109375,
0.06671142578125,
-0.00829315185546875,
-0.01983642578125,
0.0179595947265625,
0.021575927734375,
-0.00775146484375,
-0.0287017822265625,
0.031585693359375,
-0.02752685546875,
0.0013704299926757812,
-0.030487060546875,
0.0002455711364746094,
0.0050811767578125,
-0.006290435791015625,
-0.0018167495727539062,
-0.0025844573974609375,
-0.0051727294921875,
0.015350341796875,
-0.0478515625,
0.0556640625,
0.06463623046875,
0.02392578125,
0.0213470458984375,
0.005035400390625,
0.008209228515625,
-0.042572021484375,
0.00920867919921875,
0.004364013671875,
0.026947021484375,
-0.0132904052734375,
-0.0182952880859375,
0.002040863037109375,
-0.0328369140625,
-0.00939178466796875,
0.00914764404296875,
0.06005859375,
0.03173828125,
-0.09344482421875,
0.0171051025390625,
-0.00925445556640625,
0.0030956268310546875,
0.0203704833984375,
-0.0203857421875,
0.00656890869140625,
-0.01274871826171875,
0.0225830078125,
0.0030460357666015625,
-0.0259552001953125,
0.01032257080078125,
-0.01042938232421875,
-0.0246124267578125,
-0.0117034912109375,
-0.030029296875,
0.0037822723388671875,
-0.0191802978515625,
0.0064544677734375,
0.0228424072265625,
-0.0092315673828125,
-0.0218048095703125,
-0.01294708251953125,
0.0025081634521484375,
-0.0263519287109375,
-0.07879638671875,
-0.01629638671875,
-0.0311126708984375,
-0.0107879638671875,
0.022918701171875,
0.01898193359375,
0.068603515625,
0.044342041015625,
0.0135955810546875,
-0.007144927978515625,
0.0028057098388671875,
0.028350830078125,
0.0274200439453125,
-0.01849365234375,
0.0007596015930175781,
0.00528717041015625,
-0.023651123046875,
0.00543212890625,
-0.0106048583984375,
-0.00136566162109375,
-0.0207977294921875,
0.026824951171875,
0.09332275390625,
0.0095672607421875,
-0.0399169921875,
0.028717041015625,
0.0261383056640625,
-0.01708984375,
0.00630950927734375,
0.0227508544921875,
-0.051605224609375,
-0.054412841796875,
0.00821685791015625,
-0.07421875,
-0.0017309188842773438,
-0.01360321044921875,
-0.08489990234375,
0.0919189453125,
-0.0254058837890625,
0.04541015625,
-0.0222625732421875,
0.020660400390625,
0.0156402587890625,
0.016387939453125,
-0.01110076904296875,
0.033355712890625,
0.00977325439453125,
0.0281524658203125,
-0.0138397216796875,
-0.0120086669921875,
0.0156402587890625,
0.050994873046875,
0.06201171875,
0.0197906494140625,
-0.0261688232421875,
-0.0013418197631835938,
0.04339599609375,
0.0184783935546875,
-0.0169677734375,
0.033599853515625,
0.006748199462890625,
-0.0248870849609375,
-0.0143890380859375,
-0.0443115234375,
0.0192413330078125,
-0.0684814453125,
0.0160980224609375,
0.006877899169921875,
0.0163726806640625,
0.019012451171875,
-0.031402587890625,
0.017822265625,
0.019561767578125,
-0.0234527587890625,
-0.00689697265625,
-0.03387451171875,
-0.006847381591796875,
-0.01157379150390625,
-0.02984619140625,
-0.014984130859375,
0.061553955078125,
-0.03082275390625,
0.037689208984375,
-0.0030689239501953125,
-0.0223846435546875,
0.042510986328125,
0.0151519775390625,
0.029327392578125,
-0.04266357421875,
-0.0164642333984375,
-0.0167388916015625,
0.0180206298828125,
0.063720703125,
0.019805908203125,
0.03582763671875,
-0.04315185546875,
0.0062255859375,
0.0201416015625,
0.06805419921875,
-0.05401611328125,
-0.106689453125,
-0.00443267822265625,
0.0047607421875,
0.046844482421875,
0.042022705078125,
0.0450439453125,
-0.042144775390625,
0.0535888671875,
-0.0216217041015625,
0.0406494140625,
0.033782958984375,
-0.038604736328125,
-0.00611114501953125,
0.0069122314453125,
-0.01043701171875,
0.0872802734375,
-0.014892578125,
0.01385498046875,
0.00447845458984375,
-0.017578125,
-0.01142120361328125,
0.0304412841796875,
0.0384521484375,
0.0223388671875,
-0.02447509765625,
0.0249176025390625,
0.048187255859375,
0.016845703125,
-0.0740966796875,
-0.040618896484375,
0.08819580078125,
0.05096435546875,
0.01523590087890625,
0.00846099853515625,
0.044036865234375,
0.03680419921875,
-0.031036376953125,
-0.0137176513671875,
0.047149658203125,
-0.0071563720703125,
-0.007671356201171875,
-0.00618743896484375,
-0.0257720947265625,
-0.007419586181640625,
-0.0296630859375,
-0.0183868408203125,
0.0157928466796875,
0.010406494140625,
-0.00833892822265625,
0.01806640625,
0.00475311279296875,
-0.0026493072509765625,
0.0040740966796875,
0.0229339599609375,
-0.00963592529296875,
0.0293121337890625,
-0.08056640625,
-0.01898193359375,
-0.01183319091796875,
-0.0826416015625,
0.06427001953125,
0.0704345703125,
-0.0233612060546875,
-0.0242767333984375,
0.0183258056640625,
0.0159149169921875,
0.02301025390625,
-0.049774169921875,
0.033355712890625,
0.01300811767578125,
0.01308441162109375,
0.019195556640625,
-0.038818359375,
-0.0188446044921875,
-0.00200653076171875,
0.0340576171875,
0.00007736682891845703,
0.112548828125,
-0.039337158203125,
-0.007518768310546875,
-0.0266876220703125,
-0.01010894775390625,
-0.0006074905395507812,
-0.0072021484375,
-0.0293121337890625,
0.01340484619140625,
0.0167236328125,
-0.004360198974609375,
-0.049560546875,
0.020172119140625,
0.024078369140625,
-0.001903533935546875,
0.0258636474609375,
0.00026917457580566406,
0.00814056396484375,
-0.012908935546875,
0.022796630859375,
-0.035308837890625,
-0.0237274169921875,
0.0037746429443359375,
-0.00395965576171875,
-0.00579833984375,
-0.0266571044921875,
-0.013092041015625,
0.00173187255859375,
-0.0114593505859375,
-0.004199981689453125,
-0.0218048095703125,
0.01540374755859375,
-0.042144775390625,
0.0186309814453125,
-0.006214141845703125,
-0.04730224609375,
-0.0090484619140625,
-0.0078582763671875,
-0.033111572265625,
0.023529052734375,
0.0232086181640625,
0.01004791259765625,
-0.034393310546875,
0.019317626953125,
0.043487548828125,
0.04150390625,
-0.0321044921875,
0.02252197265625,
0.0458984375,
-0.0020580291748046875,
-0.0006117820739746094,
-0.0299530029296875,
-0.034271240234375,
-0.042236328125,
-0.00445556640625,
0.01474761962890625,
-0.041351318359375,
-0.05609130859375,
-0.07598876953125,
-0.00614166259765625,
-0.0021381378173828125,
-0.007602691650390625,
-0.0198974609375,
0.0290374755859375,
-0.027435302734375,
-0.005298614501953125,
-0.0279541015625,
-0.036590576171875,
0.0139923095703125,
0.08734130859375,
-0.0181427001953125,
-0.002780914306640625,
-0.035552978515625,
-0.04266357421875,
-0.061431884765625,
0.01497650146484375,
0.06439208984375,
-0.01666259765625,
-0.0013456344604492188,
-0.0095062255859375,
0.0007510185241699219,
0.0303192138671875,
-0.080078125,
-0.0203094482421875,
-0.018035888671875,
-0.0002505779266357422,
-0.01418304443359375,
-0.0302581787109375,
0.0252685546875,
-0.041107177734375,
-0.040313720703125,
0.003658294677734375,
-0.0036029815673828125,
0.01256561279296875,
-0.04144287109375,
-0.07135009765625,
0.035980224609375,
0.0170440673828125,
-0.0308074951171875,
-0.09906005859375,
0.0086669921875,
0.03192138671875,
-0.022491455078125,
-0.048828125,
0.01116180419921875,
-0.05633544921875,
0.053253173828125,
0.01444244384765625,
0.0305938720703125,
-0.016754150390625,
0.0260009765625,
0.00975799560546875,
0.06573486328125,
0.052703857421875,
-0.025848388671875,
0.0275115966796875,
-0.01806640625,
0.040802001953125,
0.055633544921875,
-0.0306243896484375,
-0.0021953582763671875,
-0.00980377197265625,
-0.05548095703125,
-0.00672149658203125,
-0.027069091796875,
-0.01316070556640625,
-0.01702880859375,
0.0269927978515625,
0.0298614501953125,
0.003971099853515625,
-0.0281219482421875,
-0.024566650390625,
-0.0207672119140625,
0.0241546630859375,
0.0284881591796875,
0.0150909423828125,
-0.0504150390625,
0.0250091552734375,
0.04266357421875,
-0.00710296630859375,
-0.0012826919555664062,
0.0007424354553222656,
-0.02703857421875,
-0.0036792755126953125,
-0.00414276123046875,
-0.021484375,
-0.005565643310546875,
-0.01537322998046875,
0.047698974609375,
-0.04168701171875,
-0.034881591796875,
0.0283355712890625,
0.01080322265625,
-0.0126953125,
0.0024127960205078125,
0.0183563232421875,
0.01153564453125,
-0.0255279541015625,
0.01500701904296875,
0.0079193115234375,
0.052886962890625,
-0.032684326171875,
-0.021270751953125,
0.0085906982421875,
0.022247314453125,
-0.00577545166015625,
0.0177154541015625,
-0.0154266357421875,
0.034942626953125,
-0.0025844573974609375,
0.0574951171875,
0.0034694671630859375,
-0.0132598876953125,
-0.019134521484375,
0.035400390625,
-0.00047588348388671875,
-0.016632080078125,
0.007663726806640625,
-0.004199981689453125,
-0.004650115966796875,
0.024444580078125,
0.0025119781494140625,
-0.052947998046875,
0.024627685546875,
0.0765380859375,
0.0303802490234375,
0.017730712890625
] |
a98a059b8ae834c551eab517a7e652eb010b5619
|
Wordpress Stackexchange
Q: How do I get the author's page url from their ID? What is the best way to get the author's page url, so http://example.com/author/user73, from their ID number?
A: http://codex.wordpress.org/Function_Reference/get_author_posts_url
|
Q: How do I get the author's page url from their ID? What is the best way to get the author's page url, so http://example.com/author/user73, from their ID number?
A: http://codex.wordpress.org/Function_Reference/get_author_posts_url
|
wordpress
|
{
"language": "en",
"length": 31,
"provenance": "stackexchange_00019.jsonl.gz:420161",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/52842"
}
|
[
0.039031982421875,
0.0005326271057128906,
0.0192413330078125,
-0.0078582763671875,
0.00304412841796875,
-0.00963592529296875,
0.01038360595703125,
-0.037017822265625,
-0.013336181640625,
0.0294189453125,
-0.0246124267578125,
0.01503753662109375,
-0.014862060546875,
-0.0146331787109375,
-0.01512908935546875,
-0.039825439453125,
0.020050048828125,
-0.011077880859375,
0.0182342529296875,
-0.00031757354736328125,
0.0144195556640625,
0.0032253265380859375,
0.0149078369140625,
0.00580596923828125,
0.057830810546875,
-0.0236358642578125,
0.04180908203125,
-0.01248931884765625,
0.0287933349609375,
-0.01151275634765625,
0.03619384765625,
-0.031341552734375,
-0.01507568359375,
0.0116424560546875,
0.020294189453125,
-0.0292205810546875,
-0.029632568359375,
0.035064697265625,
0.0232391357421875,
-0.0034008026123046875,
0.0219268798828125,
-0.0014123916625976562,
-0.048126220703125,
0.03216552734375,
-0.04425048828125,
-0.06280517578125,
0.0482177734375,
0.01010894775390625,
0.0025386810302734375,
0.065185546875,
0.00836181640625,
0.057220458984375,
-0.006500244140625,
0.05340576171875,
-0.0018262863159179688,
-0.03515625,
0.07904052734375,
-0.042327880859375,
0.0261383056640625,
-0.09893798828125,
-0.048675537109375,
-0.00296783447265625,
0.063232421875,
0.06268310546875,
0.0024127960205078125,
-0.00208282470703125,
0.024383544921875,
0.04241943359375,
-0.006916046142578125,
-0.0125732421875,
-0.006816864013671875,
0.003673553466796875,
-0.02313232421875,
0.0248870849609375,
-0.0521240234375,
-0.0418701171875,
0.0244598388671875,
-0.058135986328125,
0.0037517547607421875,
0.03802490234375,
-0.052642822265625,
-0.033477783203125,
-0.08294677734375,
-0.0180816650390625,
0.0061492919921875,
0.01922607421875,
-0.016021728515625,
-0.00542449951171875,
-0.0654296875,
0.0027446746826171875,
-0.04412841796875,
-0.0160980224609375,
-0.032928466796875,
-0.0184173583984375,
-0.0294952392578125,
-0.00487518310546875,
0.039886474609375,
0.03680419921875,
-0.0216217041015625,
-0.01435089111328125,
-0.010284423828125,
-0.0226287841796875,
-0.0048980712890625,
-0.0208740234375,
-0.000354766845703125,
0.065673828125,
0.03924560546875,
0.0633544921875,
0.02630615234375,
-0.00769805908203125,
0.0016889572143554688,
-0.0102386474609375,
-0.0226898193359375,
-0.001251220703125,
-0.0369873046875,
-0.007793426513671875,
-0.058319091796875,
0.0010290145874023438,
-0.0009069442749023438,
0.0005440711975097656,
-0.0012083053588867188,
0.0192413330078125,
0.0013675689697265625,
0.0008015632629394531,
-0.004077911376953125,
-0.0177001953125,
-0.024017333984375,
-0.015625,
0.00482177734375,
-0.0196533203125,
-0.0188446044921875,
0.0276947021484375,
0.039398193359375,
0.010284423828125,
-0.006114959716796875,
-0.00989532470703125,
-0.0123748779296875,
-0.020477294921875,
-0.009857177734375,
0.005535125732421875,
-0.037506103515625,
-0.02276611328125,
0.0255126953125,
-0.033905029296875,
-0.030609130859375,
0.016937255859375,
0.0133514404296875,
0.0239105224609375,
-0.02056884765625,
-0.03753662109375,
-0.03955078125,
0.011474609375,
-0.005336761474609375,
0.00951385498046875,
0.0723876953125,
-0.029022216796875,
0.0616455078125,
-0.035400390625,
0.032989501953125,
0.0114288330078125,
0.041351318359375,
0.0239105224609375,
0.01519775390625,
0.035858154296875,
0.00897979736328125,
-0.041473388671875,
-0.0186614990234375,
-0.00681304931640625,
0.02587890625,
0.039215087890625,
0.0018901824951171875,
-0.0167236328125,
-0.03228759765625,
0.041168212890625,
0.014892578125,
0.03118896484375,
0.0186920166015625,
-0.006381988525390625,
-0.02020263671875,
0.1009521484375,
0.037445068359375,
-0.0113677978515625,
-0.01299285888671875,
0.01019287109375,
-0.049560546875,
0.07427978515625,
-0.004390716552734375,
0.09039306640625,
0.0198822021484375,
0.00702667236328125,
0.0034732818603515625,
0.01378631591796875,
-0.035491943359375,
0.00838470458984375,
-0.006519317626953125,
0.01036834716796875,
-0.00511932373046875,
0.015899658203125,
-0.0205535888671875,
-0.007076263427734375,
-0.00142669677734375,
0.004993438720703125,
0.0229034423828125,
0.0277557373046875,
0.014007568359375,
0.025970458984375,
-0.0049591064453125,
0.01363372802734375,
0.052764892578125,
0.0328369140625,
-0.01271820068359375,
0.00966644287109375,
-0.0086669921875,
-0.0438232421875,
-0.0352783203125,
0.031890869140625,
-0.003742218017578125,
-0.022857666015625,
-0.0180511474609375,
0.01450347900390625,
-0.0305938720703125,
0.0193328857421875,
-0.03985595703125,
0.01152801513671875,
0.01515960693359375,
-0.024658203125,
-0.0168914794921875,
-0.0290679931640625,
-0.0128021240234375,
-0.00614166259765625,
-0.048614501953125,
0.032470703125,
0.027862548828125,
0.038726806640625,
-0.0306396484375,
-0.0151519775390625,
-0.00626373291015625,
-0.0274505615234375,
0.0251007080078125,
0.0474853515625,
0.036041259765625,
-0.017547607421875,
-0.002780914306640625,
0.01357269287109375,
0.0158538818359375,
-0.020477294921875,
0.01065826416015625,
-0.0022106170654296875,
0.02288818359375,
0.0604248046875,
0.0264129638671875,
-0.01351165771484375,
-0.00133514404296875,
-0.057281494140625,
-0.0019931793212890625,
0.038116455078125,
-0.0127410888671875,
0.0321044921875,
-0.057464599609375,
0.00933074951171875,
-0.007007598876953125,
0.00330352783203125,
0.01152801513671875,
-0.0309600830078125,
-0.00421142578125,
0.0180511474609375,
0.01885986328125,
0.037689208984375,
-0.0247955322265625,
-0.015045166015625,
0.00771331787109375,
0.0233001708984375,
0.0147705078125,
0.033111572265625,
-0.0004475116729736328,
-0.025115966796875,
0.0211639404296875,
-0.0259857177734375,
-0.002544403076171875,
0.017791748046875,
-0.0162506103515625,
0.01419830322265625,
-0.012725830078125,
0.001224517822265625,
-0.03375244140625,
-0.03228759765625,
0.028594970703125,
0.0305938720703125,
-0.01103973388671875,
0.0186614990234375,
0.033905029296875,
0.048004150390625,
-0.013885498046875,
0.032379150390625,
-0.019989013671875,
-0.0022602081298828125,
0.055084228515625,
-0.058990478515625,
0.06536865234375,
-0.04071044921875,
0.029205322265625,
0.05645751953125,
-0.008026123046875,
0.01129913330078125,
0.0201568603515625,
-0.0318603515625,
0.01094818115234375,
0.0093841552734375,
0.01363372802734375,
0.0273895263671875,
-0.05731201171875,
0.0258941650390625,
0.007175445556640625,
0.05487060546875,
-0.0207977294921875,
-0.044189453125,
-0.00868988037109375,
0.009246826171875,
-0.10260009765625,
-0.11041259765625,
0.00556182861328125,
-0.05712890625,
-0.053466796875,
-0.00479888916015625,
-0.050933837890625,
0.020416259765625,
0.0157623291015625,
-0.01708984375,
0.023834228515625,
-0.023101806640625,
-0.12396240234375,
-0.06201171875,
-0.1180419921875,
-0.0090484619140625,
-0.03271484375,
0.0264739990234375,
0.00753021240234375,
-0.02978515625,
-0.0235595703125,
-0.040924072265625,
-0.0211944580078125,
0.045867919921875,
0.0018548965454101562,
-0.05010986328125,
-0.04522705078125,
0.05548095703125,
-0.0134124755859375,
0.0196075439453125,
0.053375244140625,
0.021240234375,
-0.0204620361328125,
0.0018777847290039062,
-0.0279693603515625,
0.005245208740234375,
0.00904083251953125,
0.0022869110107421875,
0.024749755859375,
0.00724029541015625,
0.03729248046875,
-0.04296875,
-0.0045166015625,
0.003612518310546875,
-0.035308837890625,
0.03271484375,
0.01477813720703125,
-0.01226806640625,
-0.00696563720703125,
0.00982666015625,
0.0212249755859375,
0.0011358261108398438,
-0.017730712890625,
0.0078887939453125,
0.044158935546875,
-0.0090789794921875,
0.041473388671875,
-0.01580810546875,
0.0205230712890625,
-0.0247955322265625,
0.003444671630859375,
0.0016222000122070312,
0.0195465087890625,
0.00463104248046875,
-0.0263824462890625,
-0.0251312255859375,
-0.040069580078125,
0.05792236328125,
0.00015842914581298828,
-0.0252227783203125,
-0.0034923553466796875,
-0.0277252197265625,
-0.0091552734375,
0.0450439453125,
0.0205535888671875,
-0.019378662109375,
0.0149993896484375,
0.017852783203125,
-0.07525634765625,
-0.04248046875,
-0.054931640625,
0.00479888916015625,
-0.01568603515625,
-0.0008878707885742188,
0.00962066650390625,
-0.023590087890625,
-0.0225982666015625,
0.048797607421875,
-0.008392333984375,
0.0128936767578125,
0.0185699462890625,
-0.0042266845703125,
-0.021331787109375,
0.03253173828125,
-0.023345947265625,
0.029022216796875,
-0.014617919921875,
-0.0016021728515625,
-0.06695556640625,
-0.025909423828125,
0.00373077392578125,
0.049835205078125,
-0.00966644287109375,
-0.01099395751953125,
-0.0290679931640625,
0.037506103515625,
-0.01154327392578125,
0.032440185546875,
0.0091552734375,
0.0162506103515625,
0.0157623291015625,
0.00005984306335449219,
0.015655517578125,
-0.026947021484375,
0.01229095458984375,
-0.01412200927734375,
-0.051116943359375,
-0.023529052734375,
-0.0394287109375,
-0.0021514892578125,
-0.01186370849609375,
-0.0305938720703125,
-0.070556640625,
-0.0474853515625,
0.0036163330078125,
0.016876220703125,
-0.00025081634521484375,
0.015228271484375,
-0.049713134765625,
-0.08197021484375,
0.061798095703125,
0.00791168212890625,
-0.0082855224609375,
-0.0156402587890625,
0.032989501953125,
0.01506805419921875,
-0.04083251953125,
0.0184478759765625,
-0.0102691650390625,
0.0364990234375,
0.009857177734375,
0.0352783203125,
0.0284576416015625,
-0.0254058837890625,
0.052337646484375,
0.0018253326416015625,
-0.02362060546875,
-0.00600433349609375,
0.044525146484375,
-0.0223236083984375,
-0.0270538330078125,
0.01186370849609375,
-0.05999755859375,
0.042266845703125,
0.02777099609375,
-0.0263214111328125,
0.004062652587890625,
0.0174407958984375,
0.0311126708984375,
-0.06695556640625,
0.052398681640625,
-0.0084991455078125,
-0.031494140625,
0.009124755859375,
-0.026702880859375,
0.0465087890625,
0.0229949951171875,
-0.007511138916015625,
0.0298004150390625,
0.0183563232421875,
-0.004924774169921875,
0.0160064697265625,
-0.018096923828125,
0.02008056640625,
0.035919189453125,
-0.036407470703125,
-0.0056915283203125,
0.0151214599609375,
-0.01514434814453125,
0.103759765625,
0.01136016845703125,
-0.0350341796875,
0.0330810546875,
-0.024749755859375,
-0.01715087890625,
0.01198577880859375,
-0.02130126953125,
0.035491943359375,
0.0284423828125,
-0.0036983489990234375,
0.0226287841796875,
-0.0477294921875,
0.028656005859375,
-0.042510986328125,
-0.0189208984375,
-0.0137939453125,
0.00011235475540161133,
-0.0191497802734375,
0.1107177734375,
-0.032958984375,
0.048980712890625,
-0.0167388916015625,
0.039947509765625,
0.0136566162109375,
0.0172119140625,
0.00443267822265625,
0.031951904296875,
0.00952911376953125,
-0.01384735107421875,
-0.005451202392578125,
-0.006175994873046875,
0.02130126953125,
0.0162353515625,
0.019195556640625,
0.055450439453125,
0.00522613525390625,
-0.01611328125,
-0.042083740234375,
0.0150146484375,
0.0008597373962402344,
-0.00791168212890625,
-0.01471710205078125,
-0.0081939697265625,
0.01003265380859375,
0.003818511962890625,
-0.00966644287109375,
-0.00800323486328125,
0.00353240966796875,
0.005443572998046875,
0.00521087646484375,
0.003391265869140625,
-0.0272369384765625,
0.0025482177734375,
0.01233673095703125,
0.0121612548828125,
-0.01549530029296875,
-0.0097503662109375,
-0.01959228515625,
0.01259613037109375,
-0.0300445556640625,
-0.006900787353515625,
0.04498291015625,
-0.0010528564453125,
0.040740966796875,
-0.039276123046875,
-0.00824737548828125,
0.00922393798828125,
-0.0110931396484375,
0.0703125,
0.0281524658203125,
-0.048858642578125,
0.005443572998046875,
-0.054595947265625,
0.01374053955078125,
0.04107666015625,
-0.00937652587890625,
-0.004901885986328125,
-0.0229339599609375,
-0.003253936767578125,
0.01220703125,
-0.011199951171875,
0.01145172119140625,
0.01464080810546875,
0.01617431640625,
-0.0160980224609375,
-0.004207611083984375,
0.0236968994140625,
0.0733642578125,
-0.031524658203125,
0.05670166015625,
0.0203094482421875,
0.041107177734375,
-0.06005859375,
-0.021881103515625,
-0.00379180908203125,
0.0094451904296875,
-0.004207611083984375,
-0.02227783203125,
0.0294342041015625,
-0.029449462890625,
0.0125579833984375,
0.00292205810546875,
-0.01392364501953125,
-0.0180511474609375,
0.00017070770263671875,
-0.0177764892578125,
0.036865234375,
0.01082611083984375,
-0.028839111328125,
-0.0022182464599609375,
0.00665283203125,
0.0361328125,
0.007335662841796875,
0.037750244140625,
-0.044403076171875,
0.00604248046875,
-0.01427459716796875,
-0.0177459716796875,
-0.0343017578125,
0.03857421875,
0.10498046875,
0.002674102783203125,
0.058746337890625,
0.03887939453125,
0.01526641845703125,
0.016357421875,
0.032073974609375,
-0.0275726318359375,
-0.02471923828125,
0.033538818359375,
0.03155517578125,
-0.00875091552734375,
0.031646728515625,
-0.0114288330078125,
0.016021728515625,
0.01558685302734375,
0.06622314453125,
-0.0423583984375,
0.0162811279296875,
0.01505279541015625,
-0.00957489013671875,
0.03924560546875,
0.006587982177734375,
-0.01265716552734375,
-0.0279541015625,
0.060821533203125,
-0.047821044921875,
0.00039196014404296875,
0.018280029296875,
-0.011566162109375,
0.01068115234375,
-0.04681396484375,
0.0418701171875,
0.01093292236328125,
-0.01271820068359375,
0.0007295608520507812,
0.0287017822265625,
-0.007167816162109375,
-0.05181884765625,
-0.0015363693237304688,
0.045074462890625,
0.024169921875,
0.015350341796875,
0.11260986328125,
-0.030029296875,
0.038238525390625,
-0.0247650146484375,
0.03436279296875,
0.0136260986328125,
0.033782958984375,
-0.0010709762573242188,
-0.0273590087890625,
0.01314544677734375,
-0.0159454345703125,
0.04840087890625,
-0.02294921875,
-0.01727294921875,
0.0310821533203125,
-0.0150146484375,
0.00860595703125,
-0.0007481575012207031,
-0.0182037353515625,
-0.0283966064453125,
-0.025146484375,
0.1209716796875,
-0.04937744140625,
-0.0191497802734375,
0.00460052490234375,
0.01433563232421875,
-0.00907135009765625,
0.007312774658203125,
-0.01236724853515625,
-0.0184326171875,
0.033599853515625,
-0.007122039794921875,
0.01666259765625,
0.03924560546875,
0.0112152099609375,
-0.059539794921875,
0.0167083740234375,
0.006961822509765625,
0.010986328125,
-0.00412750244140625,
0.00516510009765625,
-0.0004782676696777344,
-0.01345062255859375,
-0.012908935546875,
0.01708984375,
0.015045166015625,
0.0007061958312988281,
-0.0105438232421875,
-0.00977325439453125,
-0.0078887939453125,
0.0408935546875,
0.09332275390625,
0.0180206298828125,
-0.03814697265625,
0.0009703636169433594,
0.0252838134765625,
0.019744873046875,
-0.0220184326171875,
0.04388427734375,
0.021759033203125,
0.0101470947265625,
0.06634521484375,
-0.0182037353515625,
0.0288543701171875,
-0.02337646484375,
0.0182647705078125,
0.024322509765625,
0.0230712890625,
0.01438140869140625,
0.020538330078125,
-0.019805908203125,
-0.045257568359375,
0.0204315185546875,
0.032958984375,
-0.029083251953125,
-0.01120758056640625,
0.0265960693359375,
0.05291748046875,
-0.0212249755859375,
-0.005634307861328125,
-0.016754150390625,
0.05816650390625,
0.036468505859375,
0.004180908203125,
0.039459228515625,
0.02392578125,
-0.0007805824279785156,
0.00774383544921875,
0.0132904052734375,
0.01715087890625,
0.010284423828125,
0.10009765625,
0.02642822265625,
0.022613525390625,
-0.058197021484375,
-0.005023956298828125,
0.02374267578125,
0.0963134765625,
-0.06317138671875,
-0.0243988037109375,
0.0032329559326171875,
-0.021759033203125,
0.0166778564453125,
-0.00826263427734375,
0.0227508544921875,
0.012847900390625,
0.004955291748046875,
-0.042755126953125,
-0.004425048828125,
0.01287841796875,
0.0423583984375,
-0.009246826171875,
-0.031158447265625,
-0.033172607421875,
-0.007549285888671875,
-0.0171051025390625,
-0.0457763671875,
-0.01308441162109375,
-0.0033512115478515625,
0.05029296875,
-0.00891876220703125,
0.0293426513671875,
-0.0008831024169921875,
0.02008056640625,
0.0199737548828125,
0.0307159423828125,
-0.033111572265625,
-0.006378173828125,
-0.0249786376953125,
0.005985260009765625,
0.031463623046875,
0.010589599609375,
0.002422332763671875,
0.01258087158203125,
-0.0062713623046875,
-0.032073974609375,
-0.01012420654296875,
0.0096435546875,
-0.03558349609375,
0.037261962890625,
-0.047027587890625,
0.036346435546875,
-0.0038738250732421875,
-0.0035037994384765625,
-0.01180267333984375,
-0.01522064208984375,
0.04656982421875,
-0.002010345458984375,
0.036346435546875,
0.017486572265625,
0.0031280517578125,
0.0039520263671875,
0.0035037994384765625,
-0.0247344970703125,
0.00635528564453125,
-0.06719970703125,
0.0181732177734375,
-0.0548095703125,
-0.037506103515625,
0.03594970703125,
0.035247802734375,
-0.0272064208984375,
0.0361328125,
-0.040496826171875,
0.028778076171875,
0.007709503173828125,
-0.022491455078125,
-0.025634765625,
0.05462646484375,
0.03887939453125,
0.007144927978515625,
-0.050323486328125,
-0.00872039794921875,
-0.01303863525390625,
-0.020172119140625,
0.02423095703125,
0.0305328369140625,
0.031036376953125,
0.0038051605224609375,
-0.0185394287109375,
0.01267242431640625,
-0.059661865234375,
-0.0455322265625,
0.06689453125,
-0.04473876953125,
-0.0163726806640625,
0.01030731201171875,
-0.0703125,
0.06561279296875,
-0.009307861328125,
0.044677734375,
0.0657958984375,
-0.0306243896484375,
0.004180908203125,
0.0002837181091308594,
-0.0288543701171875,
-0.027313232421875,
-0.0533447265625,
-0.03118896484375,
0.005565643310546875,
0.010009765625,
0.0180206298828125,
-0.022247314453125,
-0.005458831787109375,
-0.0124359130859375,
-0.038970947265625,
0.01143646240234375,
-0.0022296905517578125,
0.0006995201110839844,
0.0170440673828125,
-0.004779815673828125,
-0.027618408203125,
0.0251312255859375,
-0.0136566162109375,
0.0313720703125,
-0.0084075927734375,
0.060791015625,
0.029754638671875,
-0.00856781005859375,
0.002712249755859375,
-0.0367431640625,
0.03924560546875,
0.019439697265625,
-0.0179443359375,
-0.0291748046875,
0.019500732421875,
-0.053619384765625,
-0.01151275634765625,
-0.01415252685546875,
-0.0082244873046875,
0.0215911865234375,
0.0218658447265625,
0.042236328125,
0.0227508544921875,
-0.014923095703125,
-0.0105743408203125,
-0.02423095703125,
-0.0236053466796875,
-0.0216217041015625,
0.0069580078125,
-0.0124969482421875,
0.0310211181640625,
-0.0755615234375,
0.0282745361328125,
-0.0056915283203125,
0.0013713836669921875,
-0.061187744140625,
0.0212860107421875,
-0.028045654296875,
-0.0220184326171875,
-0.0022068023681640625,
0.0180511474609375,
0.0487060546875,
-0.020751953125,
-0.009490966796875,
0.04925537109375,
0.018157958984375,
0.113525390625,
-0.06982421875,
-0.01323699951171875,
0.00872802734375,
0.0005221366882324219,
-0.0472412109375,
-0.08367919921875,
0.0274810791015625,
-0.069091796875,
-0.005535125732421875,
0.0029964447021484375,
-0.0015211105346679688,
0.0133514404296875,
-0.02105712890625,
-0.0096588134765625,
0.08038330078125,
-0.006702423095703125,
-0.0276947021484375,
-0.00931549072265625,
0.00022411346435546875,
0.0140838623046875,
-0.028076171875,
-0.0035858154296875,
-0.016754150390625,
-0.04412841796875,
-0.005580902099609375,
0.02020263671875,
0.017425537109375,
0.007354736328125,
0.0214996337890625,
-0.048736572265625,
0.015350341796875,
-0.0023097991943359375,
0.00849151611328125,
0.026275634765625,
-0.0160675048828125,
0.0114288330078125,
0.03240966796875,
-0.045074462890625,
-0.00598907470703125,
-0.0169525146484375,
0.0174560546875,
-0.045654296875,
-0.03924560546875,
0.0158538818359375,
0.01258087158203125,
0.0162811279296875,
0.06475830078125,
-0.005290985107421875,
-0.04205322265625,
0.00580596923828125,
-0.0011510848999023438,
-0.01495361328125,
-0.02398681640625,
0.00905609130859375,
-0.041259765625,
-0.0224609375,
0.003459930419921875,
-0.03253173828125,
-0.0149383544921875,
0.01401519775390625,
-0.045623779296875,
-0.0007357597351074219,
-0.00977325439453125,
-0.0233917236328125,
-0.006855010986328125,
-0.0011844635009765625,
0.01617431640625,
-0.0208587646484375,
-0.0033817291259765625,
0.007030487060546875,
0.01059722900390625,
0.005596160888671875,
-0.0168914794921875,
0.00592041015625,
0.019744873046875,
-0.0201263427734375,
0.00780487060546875,
0.01337432861328125,
0.036163330078125,
-0.0219879150390625,
-0.0107879638671875,
-0.0189971923828125,
0.0523681640625,
0.00911712646484375,
0.037261962890625,
0.01026153564453125,
-0.001377105712890625,
0.00998687744140625,
-0.0011548995971679688,
-0.025238037109375,
0.034271240234375,
-0.00583648681640625,
0.038055419921875,
-0.03741455078125,
0.0011034011840820312,
0.00891876220703125,
-0.0297088623046875,
-0.01320648193359375,
0.003940582275390625,
0.01546478271484375,
-0.025909423828125,
0.0154571533203125,
0.005527496337890625,
0.0082550048828125,
0.0166168212890625
] |
28df22d588f1cf6e2e91748c1032bbab9ebb0bf6
|
Wordpress Stackexchange
Q: Allow admin login at /admin I am interested in:
*
*how can we change the default login url /wp-admin to /login
*how can we add another url for login so that both /wp-admin and /login would work
I tried to use a custom filter and .htaccess as in the following example but without success.
functions.php
add_filter('admin_url', 'my_new_admin_url');
function my_new_admin_url()
{
return '/login/';
}
.htaccess
Redirect permanent /wp-admin/ /login/
A: another option - redirect /admin/ to wp-login.php with a parse_query action hook:
function wpa53048_parse_query( $query ){
if( $query->query_vars['pagename'] == 'admin' ):
wp_redirect( wp_login_url() );
exit;
endif;
}
add_action( 'parse_query', 'wpa53048_parse_query' );
EDIT
Well the above apparently only works with certain permalink structures. Here's another method hooked to parse_request:
function wpa53048_parse_request( $query ){
if( $query->request == 'admin' ):
wp_redirect( wp_login_url() );
exit;
endif;
}
add_action( 'parse_request', 'wpa53048_parse_request' );
|
Q: Allow admin login at /admin I am interested in:
*
*how can we change the default login url /wp-admin to /login
*how can we add another url for login so that both /wp-admin and /login would work
I tried to use a custom filter and .htaccess as in the following example but without success.
functions.php
add_filter('admin_url', 'my_new_admin_url');
function my_new_admin_url()
{
return '/login/';
}
.htaccess
Redirect permanent /wp-admin/ /login/
A: another option - redirect /admin/ to wp-login.php with a parse_query action hook:
function wpa53048_parse_query( $query ){
if( $query->query_vars['pagename'] == 'admin' ):
wp_redirect( wp_login_url() );
exit;
endif;
}
add_action( 'parse_query', 'wpa53048_parse_query' );
EDIT
Well the above apparently only works with certain permalink structures. Here's another method hooked to parse_request:
function wpa53048_parse_request( $query ){
if( $query->request == 'admin' ):
wp_redirect( wp_login_url() );
exit;
endif;
}
add_action( 'parse_request', 'wpa53048_parse_request' );
A: I use just this at the top of my .htaccess file:
RewriteRule ^login/?$ /wp-login.php [NC,L]
or the following, case WordPress resides in a folder, and the rule refers to the root:
RewriteRule ^login/?$ /wp/wp-login.php [NC,L]
I've seen [QSA,L] used instead of [NC,L], but don't know the difference...
Reference: http://planetozh.com/blog/2011/01/pretty-login-url-a-simple-rewrite-api-plugin-example/
|
wordpress
|
{
"language": "en",
"length": 187,
"provenance": "stackexchange_00019.jsonl.gz:420211",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53048"
}
|
[
0.09613037109375,
0.0005621910095214844,
0.0299835205078125,
-0.0545654296875,
0.02099609375,
-0.027862548828125,
0.033905029296875,
-0.02490234375,
-0.0528564453125,
0.0015277862548828125,
0.005153656005859375,
0.00969696044921875,
-0.01377105712890625,
-0.041351318359375,
0.049774169921875,
-0.039215087890625,
0.006801605224609375,
0.0225067138671875,
0.00588226318359375,
-0.01442718505859375,
0.023223876953125,
-0.013946533203125,
-0.00982666015625,
0.0186004638671875,
-0.015777587890625,
0.024810791015625,
0.06634521484375,
-0.043792724609375,
-0.0019063949584960938,
-0.00009131431579589844,
-0.00858306884765625,
-0.033416748046875,
0.00970458984375,
0.0216064453125,
-0.0219268798828125,
-0.08038330078125,
-0.0106048583984375,
0.0259246826171875,
-0.0023097991943359375,
0.0025272369384765625,
0.056549072265625,
-0.0288848876953125,
-0.038421630859375,
0.02264404296875,
-0.0289764404296875,
-0.021881103515625,
0.0290679931640625,
-0.00882720947265625,
0.0220489501953125,
-0.017242431640625,
-0.002105712890625,
0.00760650634765625,
0.005458831787109375,
-0.02587890625,
-0.01806640625,
-0.0036525726318359375,
0.02374267578125,
-0.034088134765625,
0.03533935546875,
0.00745391845703125,
-0.034820556640625,
-0.034027099609375,
0.025634765625,
-0.0489501953125,
-0.00428009033203125,
-0.006378173828125,
-0.03155517578125,
0.03399658203125,
-0.0305023193359375,
-0.0173187255859375,
-0.0000030994415283203125,
-0.03955078125,
-0.0030059814453125,
0.0012540817260742188,
-0.007762908935546875,
-0.01099395751953125,
0.010650634765625,
0.01410675048828125,
0.0225677490234375,
0.0204620361328125,
0.014251708984375,
-0.0172576904296875,
-0.00940704345703125,
0.0095367431640625,
0.0197296142578125,
0.0216064453125,
-0.00984954833984375,
-0.032928466796875,
-0.02587890625,
-0.013458251953125,
-0.020843505859375,
-0.043548583984375,
-0.029510498046875,
0.0080413818359375,
0.0018129348754882812,
-0.0362548828125,
-0.001255035400390625,
4.172325134277344e-7,
0.0195770263671875,
0.0106048583984375,
-0.008148193359375,
-0.0219573974609375,
-0.030975341796875,
-0.00545501708984375,
-0.00873565673828125,
0.05853271484375,
0.041961669921875,
0.047027587890625,
0.0025634765625,
-0.01531219482421875,
0.01493072509765625,
0.0182647705078125,
-0.032196044921875,
-0.0171966552734375,
-0.0297698974609375,
0.01436614990234375,
-0.05126953125,
-0.01555633544921875,
-0.0179901123046875,
0.006786346435546875,
-0.0335693359375,
-0.01025390625,
0.0413818359375,
-0.00234222412109375,
-0.0009751319885253906,
-0.0262603759765625,
-0.014068603515625,
-0.0229949951171875,
-0.004314422607421875,
0.0247344970703125,
0.0026302337646484375,
0.0032634735107421875,
-0.0181884765625,
0.00978851318359375,
-0.01275634765625,
-0.0163421630859375,
0.04937744140625,
-0.0256195068359375,
0.0107269287109375,
0.0057525634765625,
0.031707763671875,
-0.01093292236328125,
-0.022918701171875,
0.018646240234375,
0.0196533203125,
0.040283203125,
0.0291595458984375,
-0.0015401840209960938,
-0.0204620361328125,
-0.06494140625,
0.0118255615234375,
-0.01351165771484375,
0.006244659423828125,
0.0219879150390625,
-0.00226593017578125,
0.031585693359375,
0.0149383544921875,
0.00666046142578125,
-0.0452880859375,
0.006805419921875,
0.00492095947265625,
-0.004573822021484375,
0.01166534423828125,
-0.0338134765625,
-0.042083740234375,
-0.01934814453125,
-0.054534912109375,
-0.0175323486328125,
0.0174102783203125,
0.0142669677734375,
0.01386260986328125,
-0.005054473876953125,
0.01155853271484375,
0.03521728515625,
0.0173187255859375,
0.00032329559326171875,
-0.0245513916015625,
0.042236328125,
-0.0022068023681640625,
0.0188446044921875,
0.029144287109375,
-0.028045654296875,
0.004558563232421875,
0.036376953125,
-0.04052734375,
0.032745361328125,
0.00971221923828125,
0.053619384765625,
-0.00777435302734375,
0.01526641845703125,
0.0280609130859375,
0.0192718505859375,
-0.025482177734375,
0.00695037841796875,
-0.016326904296875,
-0.04644775390625,
0.0258026123046875,
-0.006465911865234375,
-0.01207733154296875,
0.01250457763671875,
-0.0019989013671875,
-0.0007910728454589844,
-0.014892578125,
0.031951904296875,
0.000018656253814697266,
0.0007767677307128906,
0.0028476715087890625,
0.0036106109619140625,
0.039276123046875,
0.051544189453125,
-0.01259613037109375,
0.03460693359375,
0.0011234283447265625,
-0.04534912109375,
-0.0166015625,
0.023590087890625,
-0.021453857421875,
0.047698974609375,
-0.005115509033203125,
0.046295166015625,
-0.0097808837890625,
-0.051116943359375,
-0.0110015869140625,
-0.0208892822265625,
0.018310546875,
-0.0178375244140625,
-0.0016193389892578125,
-0.0235443115234375,
0.0286102294921875,
-0.011871337890625,
-0.0000826120376586914,
0.040771484375,
0.05389404296875,
0.031524658203125,
-0.029388427734375,
0.0058441162109375,
-0.01113128662109375,
-0.043548583984375,
-0.0146331787109375,
0.042388916015625,
0.0445556640625,
0.022613525390625,
-0.017730712890625,
-0.00838470458984375,
0.0216522216796875,
-0.070068359375,
0.0047149658203125,
-0.005947113037109375,
-0.00589752197265625,
0.0270843505859375,
-0.033721923828125,
0.005702972412109375,
0.032379150390625,
-0.0253753662109375,
-0.01473236083984375,
0.03253173828125,
-0.001922607421875,
-0.03607177734375,
-0.06036376953125,
0.031219482421875,
0.01678466796875,
-0.06329345703125,
-0.05059814453125,
-0.006378173828125,
-0.02276611328125,
-0.015655517578125,
-0.001811981201171875,
-0.006595611572265625,
-0.0114593505859375,
-0.03253173828125,
0.03021240234375,
0.0091552734375,
-0.01480865478515625,
-0.007843017578125,
0.06597900390625,
-0.071044921875,
-0.040771484375,
0.004344940185546875,
0.0286865234375,
-0.0247802734375,
0.006237030029296875,
0.054779052734375,
-0.04681396484375,
-0.0249176025390625,
-0.013702392578125,
-0.027984619140625,
-0.014617919921875,
0.01715087890625,
0.05267333984375,
-0.0207061767578125,
0.0296783447265625,
-0.022796630859375,
-0.0195159912109375,
0.044921875,
-0.0014858245849609375,
-0.07525634765625,
0.02166748046875,
-0.06085205078125,
0.05462646484375,
-0.0278167724609375,
0.052764892578125,
0.0794677734375,
0.000006973743438720703,
0.0205230712890625,
0.005214691162109375,
-0.0047607421875,
-0.003269195556640625,
0.023712158203125,
-0.0014324188232421875,
-0.0264434814453125,
-0.0357666015625,
-0.00342559814453125,
0.0167083740234375,
-0.0073699951171875,
0.0309906005859375,
-0.0192413330078125,
0.01334381103515625,
0.0080108642578125,
-0.0311737060546875,
-0.039093017578125,
-0.06146240234375,
-0.0714111328125,
0.01198577880859375,
0.01427459716796875,
-0.0287017822265625,
0.028717041015625,
0.0300140380859375,
0.0189971923828125,
-0.0097198486328125,
-0.00772857666015625,
-0.059051513671875,
-0.027069091796875,
-0.05157470703125,
0.01215362548828125,
-0.01332855224609375,
-0.00405120849609375,
0.0184783935546875,
0.05291748046875,
0.026458740234375,
-0.033966064453125,
0.040008544921875,
0.032073974609375,
-0.0194091796875,
-0.007190704345703125,
-0.03741455078125,
-0.01885986328125,
0.06768798828125,
-0.020599365234375,
0.07196044921875,
0.0266876220703125,
0.0158233642578125,
0.01605224609375,
0.00835418701171875,
-0.033721923828125,
0.0165863037109375,
-0.0180206298828125,
-0.0283355712890625,
-0.036468505859375,
-0.005584716796875,
-0.0643310546875,
0.00424957275390625,
-0.01024627685546875,
-0.032257080078125,
0.01491546630859375,
0.0196075439453125,
-0.0227508544921875,
0.0276031494140625,
-0.03143310546875,
0.0240936279296875,
0.0230560302734375,
0.0157928466796875,
-0.005764007568359375,
0.01055908203125,
-0.0116119384765625,
-0.0024547576904296875,
-0.0196380615234375,
0.04498291015625,
-0.0230865478515625,
-0.006591796875,
0.022491455078125,
0.005977630615234375,
0.045501708984375,
-0.04864501953125,
0.0330810546875,
-0.040252685546875,
0.0548095703125,
-0.019195556640625,
0.004344940185546875,
-0.058868408203125,
-0.0219268798828125,
-0.048828125,
0.0728759765625,
-0.01885986328125,
0.0025386810302734375,
-0.0233917236328125,
0.0186767578125,
-0.04705810546875,
-0.06829833984375,
-0.032958984375,
0.004291534423828125,
-0.07171630859375,
-0.03387451171875,
-0.05987548828125,
-0.01020050048828125,
0.0032558441162109375,
-0.04473876953125,
0.00392913818359375,
-0.07305908203125,
0.015533447265625,
0.01113128662109375,
0.0003275871276855469,
0.0345458984375,
-0.0240478515625,
0.0126495361328125,
0.009552001953125,
-0.012542724609375,
-0.07470703125,
-0.02178955078125,
0.006317138671875,
0.07452392578125,
0.0321044921875,
-0.044830322265625,
-0.0112457275390625,
0.043121337890625,
-0.02191162109375,
-0.00106048583984375,
-0.01265716552734375,
0.01430511474609375,
-0.02056884765625,
-0.0109710693359375,
-0.019439697265625,
-0.025177001953125,
-0.006256103515625,
-0.0030364990234375,
-0.01215362548828125,
-0.00787353515625,
-0.027557373046875,
-0.047882080078125,
0.014892578125,
-0.031585693359375,
-0.07958984375,
-0.0275726318359375,
0.00792694091796875,
-0.01128387451171875,
-0.00595855712890625,
-0.0021495819091796875,
-0.006168365478515625,
-0.05987548828125,
0.062103271484375,
0.0115509033203125,
-0.0171661376953125,
-0.0205535888671875,
0.061553955078125,
0.01406097412109375,
-0.030548095703125,
0.01360321044921875,
-0.0015001296997070312,
0.007110595703125,
-0.0599365234375,
0.06707763671875,
0.0185699462890625,
0.0159912109375,
0.038421630859375,
-0.05267333984375,
0.022796630859375,
-0.0330810546875,
0.0095367431640625,
-0.017578125,
-0.0416259765625,
0.031707763671875,
-0.03326416015625,
0.003475189208984375,
0.048614501953125,
0.0167236328125,
-0.0186004638671875,
0.00844573974609375,
0.0120391845703125,
-0.0207366943359375,
-0.0029144287109375,
-0.010406494140625,
-0.032684326171875,
0.0113067626953125,
0.0014123916625976562,
-0.0058746337890625,
0.0491943359375,
-0.02996826171875,
0.003047943115234375,
-0.01739501953125,
-0.004436492919921875,
0.0048980712890625,
-0.00991058349609375,
0.01374053955078125,
0.039398193359375,
-0.0310211181640625,
-0.0081634521484375,
0.0106964111328125,
-0.005588531494140625,
0.0841064453125,
0.00899505615234375,
-0.0311126708984375,
-0.00617218017578125,
-0.0171661376953125,
-0.011749267578125,
0.0224609375,
-0.0102996826171875,
0.0511474609375,
-0.01020050048828125,
-0.046630859375,
-0.00783538818359375,
0.004730224609375,
-0.0833740234375,
-0.05841064453125,
0.03155517578125,
0.0004572868347167969,
0.0265655517578125,
0.019927978515625,
0.0887451171875,
0.0102386474609375,
0.06500244140625,
-0.0360107421875,
-0.007328033447265625,
0.0269927978515625,
0.0198974609375,
0.018035888671875,
0.002288818359375,
0.0080108642578125,
-0.01279449462890625,
0.0236663818359375,
-0.0355224609375,
-0.0181427001953125,
0.0207672119140625,
0.033935546875,
-0.001861572265625,
-0.0022029876708984375,
0.003398895263671875,
-0.00406646728515625,
-0.006160736083984375,
0.03961181640625,
0.00843048095703125,
-0.03826904296875,
-0.031463623046875,
-0.0093994140625,
0.042083740234375,
-0.0244140625,
-0.0178375244140625,
0.0305328369140625,
-0.04486083984375,
0.0082244873046875,
0.0501708984375,
-0.0220489501953125,
-0.0199432373046875,
-0.029388427734375,
-0.003849029541015625,
-0.031890869140625,
-0.047119140625,
0.0274505615234375,
0.02154541015625,
-0.0279541015625,
-0.0205841064453125,
0.0279541015625,
0.00199127197265625,
0.0235748291015625,
-0.0248870849609375,
-0.005126953125,
0.0298004150390625,
-0.01016998291015625,
0.053497314453125,
-0.01412200927734375,
-0.05841064453125,
-0.01561737060546875,
-0.03515625,
-0.01242828369140625,
-0.00711822509765625,
0.0059661865234375,
-0.0172576904296875,
-0.0051422119140625,
0.016754150390625,
0.02716064453125,
0.02215576171875,
0.02935791015625,
-0.028564453125,
0.0091094970703125,
-0.00360870361328125,
0.039703369140625,
-0.040985107421875,
0.07781982421875,
-0.0185089111328125,
0.0201416015625,
-0.0206146240234375,
0.036773681640625,
0.006992340087890625,
0.015625,
0.0092620849609375,
-0.00894927978515625,
-0.024658203125,
-0.030059814453125,
-0.0030956268310546875,
0.013916015625,
0.0655517578125,
-0.015777587890625,
0.00647735595703125,
-0.00634765625,
-0.0029430389404296875,
-0.0185546875,
0.0289154052734375,
-0.00014960765838623047,
0.0242919921875,
-0.001415252685546875,
0.03302001953125,
0.0694580078125,
-0.04486083984375,
-0.053131103515625,
0.007476806640625,
0.0201568603515625,
0.01690673828125,
0.043670654296875,
-0.0780029296875,
0.038543701171875,
0.05792236328125,
0.052825927734375,
0.06298828125,
-0.0183868408203125,
0.0423583984375,
0.040374755859375,
-0.05792236328125,
0.01528167724609375,
0.059967041015625,
0.014892578125,
-0.024200439453125,
0.03387451171875,
0.03448486328125,
-0.003292083740234375,
0.00786590576171875,
0.08489990234375,
0.06964111328125,
-0.1444091796875,
0.0178375244140625,
0.01175689697265625,
0.03521728515625,
0.05010986328125,
-0.01119232177734375,
-0.01416778564453125,
-0.005023956298828125,
0.023651123046875,
-0.00008612871170043945,
-0.03753662109375,
-0.005931854248046875,
0.03399658203125,
-0.01433563232421875,
-0.01113128662109375,
0.00716400146484375,
0.004077911376953125,
0.0005922317504882812,
0.001804351806640625,
0.01477813720703125,
-0.004856109619140625,
0.006977081298828125,
-0.002956390380859375,
-0.0020961761474609375,
-0.03887939453125,
-0.07159423828125,
-0.02099609375,
-0.01318359375,
-0.0164947509765625,
0.00798797607421875,
0.003993988037109375,
0.056915283203125,
0.054779052734375,
0.00763702392578125,
-0.005199432373046875,
0.01154327392578125,
0.00011843442916870117,
0.04754638671875,
-0.0204620361328125,
-0.004734039306640625,
-0.010833740234375,
-0.029541015625,
0.0032253265380859375,
-0.0238800048828125,
-0.02142333984375,
-0.007556915283203125,
-0.02508544921875,
0.042572021484375,
-0.028289794921875,
0.000004708766937255859,
0.036834716796875,
-0.0090179443359375,
-0.00701141357421875,
-0.01160430908203125,
0.0127105712890625,
-0.057708740234375,
-0.056732177734375,
-0.0284423828125,
-0.0849609375,
0.0247955322265625,
-0.046783447265625,
-0.043792724609375,
0.08831787109375,
0.01386260986328125,
0.01308441162109375,
0.033050537109375,
0.0198822021484375,
-0.06524658203125,
0.00551605224609375,
-0.022186279296875,
0.050048828125,
0.032440185546875,
0.0185394287109375,
0.01030731201171875,
0.00894927978515625,
0.033050537109375,
-0.00007069110870361328,
0.0240020751953125,
0.0188140869140625,
-0.090087890625,
-0.00305938720703125,
0.033447265625,
0.02734375,
0.0191497802734375,
0.07171630859375,
0.0052642822265625,
0.0153350830078125,
0.012359619140625,
-0.04766845703125,
0.0016622543334960938,
-0.00669097900390625,
-0.0192413330078125,
0.0247955322265625,
0.00342559814453125,
-0.0107421875,
-0.0028972625732421875,
0.0416259765625,
-0.06024169921875,
0.01094818115234375,
0.041168212890625,
-0.0091094970703125,
-0.0010118484497070312,
0.0096893310546875,
0.002445220947265625,
0.0145111083984375,
0.01314544677734375,
-0.02691650390625,
0.0304412841796875,
0.0072174072265625,
0.00689697265625,
-0.01218414306640625,
0.00986480712890625,
0.0086669921875,
-0.03277587890625,
-0.00904083251953125,
0.032196044921875,
-0.031768798828125,
0.06585693359375,
0.03643798828125,
0.037994384765625,
-0.0211029052734375,
-0.0024394989013671875,
0.019622802734375,
0.07049560546875,
-0.0465087890625,
-0.05291748046875,
0.00012022256851196289,
0.009918212890625,
0.04669189453125,
0.03436279296875,
0.07073974609375,
-0.0210113525390625,
0.0086669921875,
0.0025615692138671875,
0.01258087158203125,
0.051605224609375,
-0.03741455078125,
0.0094146728515625,
0.0196075439453125,
-0.0066375732421875,
0.062347412109375,
0.005413055419921875,
-0.0249176025390625,
-0.003936767578125,
0.03302001953125,
0.007659912109375,
0.01015472412109375,
-0.017822265625,
-0.01140594482421875,
-0.032867431640625,
0.052978515625,
-0.0120697021484375,
0.022705078125,
-0.054046630859375,
-0.05560302734375,
-0.0187225341796875,
0.04510498046875,
0.01043701171875,
0.0307464599609375,
-0.016632080078125,
-0.0195770263671875,
0.02703857421875,
0.0166473388671875,
0.045196533203125,
-0.022430419921875,
0.042236328125,
-0.0110321044921875,
0.007328033447265625,
-0.0007672309875488281,
-0.0176239013671875,
-0.0127410888671875,
0.0186614990234375,
0.01369476318359375,
-0.0026607513427734375,
-0.008575439453125,
0.0026340484619140625,
-0.048065185546875,
0.017059326171875,
-0.01519775390625,
0.07794189453125,
0.00701141357421875,
-0.08099365234375,
-0.0361328125,
-0.005451202392578125,
-0.018829345703125,
0.048736572265625,
0.0531005859375,
-0.0033397674560546875,
-0.0095367431640625,
0.00146484375,
-0.00040793418884277344,
0.0164794921875,
-0.0399169921875,
-0.010009765625,
-0.0645751953125,
0.01076507568359375,
-0.030303955078125,
-0.049224853515625,
-0.0311279296875,
-0.030364990234375,
0.0301361083984375,
0.019866943359375,
0.101318359375,
-0.0303955078125,
0.01544189453125,
-0.042266845703125,
-0.01039886474609375,
-0.024810791015625,
-0.01450347900390625,
0.0167999267578125,
-0.022125244140625,
-0.0540771484375,
0.004238128662109375,
-0.023193359375,
0.03887939453125,
-0.00804901123046875,
-0.01922607421875,
0.04974365234375,
-0.048858642578125,
0.00374603271484375,
-0.034332275390625,
0.025970458984375,
-0.02252197265625,
-0.06378173828125,
-0.0418701171875,
0.0311126708984375,
0.015472412109375,
0.01337432861328125,
-0.05389404296875,
0.059539794921875,
-0.056549072265625,
-0.00628662109375,
0.004245758056640625,
-0.05889892578125,
-0.0014095306396484375,
0.043243408203125,
-0.062255859375,
0.025177001953125,
-0.0086669921875,
-0.024261474609375,
0.0161285400390625,
0.0093231201171875,
-0.02154541015625,
0.005855560302734375,
0.031463623046875,
-0.0003838539123535156,
0.004405975341796875,
0.01439666748046875,
-0.01407623291015625,
-0.00989532470703125,
0.00478363037109375,
-0.0198516845703125,
0.007049560546875,
-0.0284881591796875,
-0.0391845703125,
-0.041412353515625,
-0.0204010009765625,
0.002101898193359375,
-0.013702392578125,
-0.08770751953125,
-0.0304718017578125,
0.05682373046875,
0.001308441162109375,
-0.0198822021484375,
-0.0419921875,
0.0472412109375,
-0.05694580078125,
0.0634765625,
-0.036956787109375,
-0.0085296630859375,
0.00969696044921875,
0.031951904296875,
-0.0369873046875,
0.019012451171875,
-0.046234130859375,
-0.04656982421875,
-0.0286407470703125,
-0.00019621849060058594,
0.055145263671875,
-0.01309967041015625,
-0.02374267578125,
-0.046539306640625,
-0.03369140625,
0.004184722900390625,
-0.07421875,
0.005523681640625,
0.00894927978515625,
0.0189666748046875,
-0.03814697265625,
-0.040985107421875,
0.004055023193359375,
0.00749969482421875,
0.0091094970703125,
0.0206146240234375,
-0.00951385498046875,
0.00624847412109375,
-0.0311431884765625,
-0.0762939453125,
0.01018524169921875,
0.00582122802734375,
-0.03369140625,
-0.0313720703125,
0.0273895263671875,
-0.01515960693359375,
0.007656097412109375,
-0.0047454833984375,
-0.019073486328125,
0.0013628005981445312,
0.0153656005859375,
0.006320953369140625,
-0.0011577606201171875,
0.006378173828125,
0.0287017822265625,
-0.0176849365234375,
0.048065185546875,
0.04241943359375,
-0.0204010009765625,
-0.00238800048828125,
-0.0132598876953125,
0.049774169921875,
0.04388427734375,
-0.01038360595703125,
0.01274871826171875,
0.01861572265625,
-0.0197906494140625,
-0.0046539306640625,
-0.042999267578125,
0.01151275634765625,
-0.00524139404296875,
0.0291748046875,
0.0235443115234375,
-0.000030040740966796875,
-0.01454925537109375,
-0.04150390625,
-0.055908203125,
-0.0021533966064453125,
-0.0258026123046875,
0.01995849609375,
-0.06597900390625,
-0.00783538818359375,
0.006877899169921875,
-0.00040793418884277344,
-0.00879669189453125,
0.016845703125,
-0.01277923583984375,
-0.009490966796875,
0.043731689453125,
-0.0013227462768554688,
-0.0292205810546875,
0.0024585723876953125,
0.06817626953125,
-0.053955078125,
-0.040557861328125,
0.0058135986328125,
0.0247802734375,
-0.0163726806640625,
-0.05596923828125,
0.0187530517578125,
0.0304107666015625,
-0.01108551025390625,
-0.00925445556640625,
0.03680419921875,
-0.0325927734375,
0.0091094970703125,
-0.03253173828125,
-0.00782012939453125,
0.0165252685546875,
-0.01264190673828125,
0.01459503173828125,
0.01122283935546875,
0.0193023681640625,
0.0189971923828125,
0.038604736328125,
-0.00047016143798828125,
-0.00141143798828125,
0.00406646728515625,
0.0112152099609375,
0.00983428955078125,
-0.0164031982421875,
0.0426025390625,
-0.02490234375,
0.005428314208984375,
-0.0025157928466796875,
0.01488494873046875,
-0.03704833984375,
0.02252197265625,
0.01180267333984375,
0.0127105712890625,
0.0274505615234375
] |
c6baeb7fd4290656ee6ebc739c9c8e8c0d65274b
|
Wordpress Stackexchange
Q: Export all posts as individual plain txt files I wish to export all of my posts as individual plain text files. So, the format may be something like:
title.txt
Title: title
Pub date: date
Category: cat
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
Is this possible? Is there a plugin or workaround to do this?
Thanks.
A: Try this (you may need to bootstrap WP by loading wp-load.php, depending on where you put this code).
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
//'posts_per_page' => -1 //uncomment this to get all posts
);
$query = new WP_Query($args);
while ( $query->have_posts() ) : $query->the_post();
$f = fopen(get_the_title() . '.txt', 'w');
$content = 'Title: ' . get_the_title() . PHP_EOL;
$content .= 'Pub date: ' . get_the_date() . PHP_EOL;
$content .= 'Category: ';
foreach (get_the_category() as $cat) {
$content .= $cat->cat_name . ', ';
}
$content .= PHP_EOL . PHP_EOL;
$content .= get_the_content();
fwrite($f, $content);
fclose($f);
endwhile;
Keep in mind, if two posts have the same title, you'll only get one text file.
|
Q: Export all posts as individual plain txt files I wish to export all of my posts as individual plain text files. So, the format may be something like:
title.txt
Title: title
Pub date: date
Category: cat
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
Is this possible? Is there a plugin or workaround to do this?
Thanks.
A: Try this (you may need to bootstrap WP by loading wp-load.php, depending on where you put this code).
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
//'posts_per_page' => -1 //uncomment this to get all posts
);
$query = new WP_Query($args);
while ( $query->have_posts() ) : $query->the_post();
$f = fopen(get_the_title() . '.txt', 'w');
$content = 'Title: ' . get_the_title() . PHP_EOL;
$content .= 'Pub date: ' . get_the_date() . PHP_EOL;
$content .= 'Category: ';
foreach (get_the_category() as $cat) {
$content .= $cat->cat_name . ', ';
}
$content .= PHP_EOL . PHP_EOL;
$content .= get_the_content();
fwrite($f, $content);
fclose($f);
endwhile;
Keep in mind, if two posts have the same title, you'll only get one text file.
A: A cursory search doesn't turn up any plugins that do this ... but you could use the built-in exporter as an example for building out your own plugin. It's located in /wp-admin/includes/export.php.
Essentially, it's a PHP page that queries the database to get all of your posts, then dumps the content into a pre-build XML template that can be imported later.
A: It looks very much as if you wanted to switch to a static blog generator like Jekyll. The following answer is based on pdb's answer and should be ready-to-use. My answer can deal with:
*
*multiple post with the same title
*German umlauts
Here it is:
<?
require_once('wp-load.php');
function getFeaturedImage($postid) {
$featured_image = "";
$array = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
if (count($array)>1) {
$featured_image = $array[0];
$featured_image = str_replace('http://martin-thoma.com/wp-content/uploads/', '', $featured_image);
}
return $featured_image;
}
$args = array(
'post_type' => 'post',
'post_status' => 'draft',
'posts_per_page' => -1 //uncomment this to get all posts
);
$query = new WP_Query($args);
$i=0;
$titles = array();
while ( $query->have_posts() ) : $query->the_post();
$i++;
$name = $post->post_name;
if ($name == "") {
$name = strtolower(get_the_title());
$replacements = array(
' ' => '-',
'#' => 'nr',
'/' => 'or',
'ö' => 'o',
'ü' => 'u',
'ä' => 'a',
'ß' => 'ss'
);
$name = str_replace(array_keys($replacements), $replacements, $name);
}
if (array_key_exists($name, $titles)) {
$name = $post->post_name."-".$post->ID;
} else {
$titles[$name] = true;
}
echo $name."<br/>";
$f = fopen("export/".$name. '.md', 'w');
$content = "---".PHP_EOL;
$content.= "layout: post".PHP_EOL;
$content.= "title: ".get_the_title().PHP_EOL;
$content.= "author: ".get_the_author().PHP_EOL;
$content.= "date: ".get_the_date('Y-m-d h:i:s').PHP_EOL;
$content.= "categories: ".PHP_EOL;
$cats = get_the_category();
if ($cats) {
foreach($cats as $category) {
$content .= '- '.$category->name.PHP_EOL;
}
}
$content .= 'tags: ';
$posttags = get_the_tags();
if ($posttags) {
$content .= PHP_EOL;
foreach($posttags as $tag) {
$content.= "- ".$tag->name.PHP_EOL;
}
} else {
$content .= "[]".PHP_EOL;
}
echo wp_get_attachment_image_src(get_the_post_thumbnail($post->ID));
$content .= 'featured_image: '.getFeaturedImage($postid).PHP_EOL;
$content .= '---'.PHP_EOL;
$content .= get_the_content();
fwrite($f, $content);
fclose($f);
endwhile;
echo $i." posts exported."
?>
A: "Why not just work with the default XML export"
I don't have an answer, but the OP might want to do this so he or she can import the posts into Devonthink Pro or a similar program.
|
wordpress
|
{
"language": "en",
"length": 541,
"provenance": "stackexchange_00019.jsonl.gz:420218",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53069"
}
|
[
0.0263214111328125,
-0.02935791015625,
0.0121307373046875,
-0.03289794921875,
-0.015869140625,
-0.0248870849609375,
0.01788330078125,
0.0086669921875,
0.0175933837890625,
0.0172119140625,
-0.018280029296875,
0.0035533905029296875,
-0.0143280029296875,
-0.028045654296875,
-0.00559234619140625,
-0.01102447509765625,
0.027069091796875,
-0.0020580291748046875,
0.02142333984375,
-0.002101898193359375,
0.0034694671630859375,
0.019134521484375,
0.00372314453125,
0.0176544189453125,
0.0258941650390625,
0.0233306884765625,
0.05035400390625,
-0.0247344970703125,
0.0110015869140625,
-0.02783203125,
0.00963592529296875,
-0.009490966796875,
0.024078369140625,
0.03863525390625,
-0.0692138671875,
0.00870513916015625,
-0.0440673828125,
0.032623291015625,
-0.00893402099609375,
0.01052093505859375,
-0.006732940673828125,
0.0125274658203125,
0.070068359375,
0.04400634765625,
0.0030536651611328125,
-0.03045654296875,
0.005702972412109375,
-0.04815673828125,
0.0159912109375,
0.00254058837890625,
0.01776123046875,
0.0123291015625,
0.02215576171875,
0.0034637451171875,
-0.019012451171875,
0.004940032958984375,
-0.0029125213623046875,
-0.0123291015625,
0.059906005859375,
-0.04754638671875,
-0.0726318359375,
-0.064208984375,
0.053009033203125,
-0.01438140869140625,
-0.01519012451171875,
-0.0199737548828125,
0.036346435546875,
0.020416259765625,
-0.0487060546875,
-0.0175628662109375,
0.053192138671875,
-0.01216888427734375,
-0.005458831787109375,
-0.0289459228515625,
-0.007167816162109375,
0.04827880859375,
-0.048370361328125,
-0.024383544921875,
0.034332275390625,
-0.0027370452880859375,
-0.0128021240234375,
0.0184478759765625,
-0.0171966552734375,
-0.01922607421875,
0.003009796142578125,
-0.0164337158203125,
-0.02301025390625,
-0.01009368896484375,
-0.03277587890625,
-0.01317596435546875,
-0.03338623046875,
0.03265380859375,
-0.039947509765625,
0.0033054351806640625,
-0.01020050048828125,
-0.00806427001953125,
-0.00995635986328125,
0.008575439453125,
-0.020111083984375,
0.04180908203125,
-0.01241302490234375,
-0.0239715576171875,
0.056549072265625,
-0.0430908203125,
0.011566162109375,
0.060577392578125,
0.0006089210510253906,
-0.0635986328125,
0.01215362548828125,
0.00475311279296875,
-0.005222320556640625,
0.03253173828125,
-0.0229034423828125,
-0.01331329345703125,
-0.0035686492919921875,
0.06268310546875,
-0.01061248779296875,
0.02532958984375,
-0.02410888671875,
0.06060791015625,
-0.007740020751953125,
0.0234527587890625,
-0.0233154296875,
-0.021636962890625,
-0.02679443359375,
-0.042236328125,
0.005092620849609375,
0.0022144317626953125,
0.0594482421875,
0.034423828125,
-0.01568603515625,
0.00412750244140625,
-0.027313232421875,
-0.01318359375,
-0.00666046142578125,
-0.017913818359375,
-0.02655029296875,
-0.053619384765625,
-0.028289794921875,
0.024261474609375,
-0.01512908935546875,
-0.035614013671875,
0.0357666015625,
-0.023162841796875,
-0.0252838134765625,
0.0079193115234375,
0.0036468505859375,
0.0168609619140625,
0.0170440673828125,
-0.00940704345703125,
-0.029327392578125,
-0.0125885009765625,
0.06304931640625,
-0.0211944580078125,
-0.06842041015625,
-0.03363037109375,
-0.01245880126953125,
-0.0207977294921875,
-0.0188140869140625,
-0.05267333984375,
0.034210205078125,
0.0019006729125976562,
0.0037899017333984375,
0.01806640625,
-0.00832366943359375,
-0.004367828369140625,
-0.03955078125,
-0.01416778564453125,
0.017242431640625,
0.0008792877197265625,
-0.071533203125,
-0.01050567626953125,
0.005893707275390625,
-0.007770538330078125,
-0.02032470703125,
0.046356201171875,
-0.04241943359375,
-0.055694580078125,
0.043731689453125,
0.040008544921875,
-0.0257415771484375,
-0.020477294921875,
-0.035125732421875,
0.0257415771484375,
-0.04266357421875,
0.007144927978515625,
0.01200103759765625,
0.042572021484375,
0.044891357421875,
0.01708984375,
0.01555633544921875,
-0.028656005859375,
-0.0345458984375,
-0.01146697998046875,
-0.01175689697265625,
0.00936126708984375,
-0.00905609130859375,
0.004573822021484375,
-0.0007915496826171875,
0.00463104248046875,
0.02960205078125,
-0.03912353515625,
0.02630615234375,
0.007526397705078125,
-0.0244140625,
-0.01122283935546875,
-0.0030517578125,
0.0015974044799804688,
-0.03851318359375,
0.0198516845703125,
0.036865234375,
0.019927978515625,
-0.031005859375,
-0.05718994140625,
-0.0135040283203125,
0.0005621910095214844,
0.0312347412109375,
-0.00324249267578125,
0.00597381591796875,
-0.018951416015625,
0.021331787109375,
-0.00832366943359375,
-0.00203704833984375,
0.077392578125,
0.0246124267578125,
0.0003859996795654297,
0.00016701221466064453,
-0.010498046875,
0.045928955078125,
0.005039215087890625,
0.04034423828125,
-0.01042938232421875,
0.050445556640625,
0.061065673828125,
-0.031280517578125,
-0.0008606910705566406,
-0.0013475418090820312,
0.00023698806762695312,
-0.0102081298828125,
0.033721923828125,
0.049041748046875,
0.038970947265625,
0.004001617431640625,
-0.0260467529296875,
0.07562255859375,
-0.0322265625,
0.0143280029296875,
-0.043792724609375,
0.039764404296875,
0.06512451171875,
-0.0227203369140625,
0.0096588134765625,
0.0215301513671875,
-0.036834716796875,
0.02459716796875,
0.05218505859375,
-0.0097503662109375,
0.0036411285400390625,
-0.0196380615234375,
0.01690673828125,
0.01335906982421875,
0.01172637939453125,
0.00013887882232666016,
0.004741668701171875,
0.0249176025390625,
0.0223388671875,
0.0234375,
0.03289794921875,
-0.03448486328125,
0.006237030029296875,
0.0020904541015625,
0.031829833984375,
0.002288818359375,
0.0307159423828125,
-0.00917816162109375,
0.0222930908203125,
-0.0207366943359375,
-0.01019287109375,
-0.0036869049072265625,
0.0219573974609375,
0.00804901123046875,
0.042572021484375,
0.03851318359375,
-0.006359100341796875,
0.008575439453125,
-0.023773193359375,
0.00748443603515625,
-0.0235595703125,
-0.0670166015625,
0.0012664794921875,
0.0139617919921875,
0.058380126953125,
0.0021877288818359375,
-0.01416778564453125,
-0.0033054351806640625,
0.04339599609375,
0.0888671875,
-0.04241943359375,
0.0279693603515625,
-0.00876617431640625,
0.10198974609375,
0.051513671875,
-0.0121002197265625,
0.016143798828125,
-0.01364898681640625,
0.0255889892578125,
0.0048980712890625,
-0.025970458984375,
-0.030242919921875,
-0.014129638671875,
-0.046478271484375,
-0.0014400482177734375,
0.009521484375,
0.082275390625,
-0.0311737060546875,
-0.06195068359375,
0.003864288330078125,
0.0121002197265625,
-0.0947265625,
-0.1046142578125,
0.0209808349609375,
-0.067138671875,
0.020172119140625,
-0.01497650146484375,
-0.04327392578125,
-0.0283966064453125,
0.00968170166015625,
0.013946533203125,
0.0357666015625,
-0.003875732421875,
-0.06134033203125,
-0.0022125244140625,
-0.076904296875,
-0.0117645263671875,
-0.00014066696166992188,
0.01033782958984375,
0.017669677734375,
0.07818603515625,
0.01397705078125,
-0.05535888671875,
-0.0261383056640625,
0.0665283203125,
-0.0207977294921875,
-0.026763916015625,
-0.00943756103515625,
0.0046539306640625,
-0.00670623779296875,
0.0181121826171875,
0.04400634765625,
0.00881195068359375,
-0.015899658203125,
-0.01390838623046875,
-0.00867462158203125,
0.014007568359375,
0.0080108642578125,
-0.026123046875,
-0.001354217529296875,
0.020660400390625,
-0.01302337646484375,
-0.032684326171875,
0.0022106170654296875,
-0.009033203125,
-0.0211944580078125,
0.0149688720703125,
0.0200347900390625,
-0.005825042724609375,
-0.005462646484375,
0.006237030029296875,
-0.03082275390625,
0.006969451904296875,
0.035491943359375,
-0.0161285400390625,
-0.0207366943359375,
-0.02294921875,
-0.031585693359375,
0.00038909912109375,
0.02374267578125,
-0.0182037353515625,
-0.005847930908203125,
0.003177642822265625,
-0.0191192626953125,
-0.0124359130859375,
0.0084991455078125,
0.0025806427001953125,
-0.07965087890625,
0.057220458984375,
-0.05853271484375,
-0.03509521484375,
-0.0533447265625,
-0.0207977294921875,
-0.01410675048828125,
0.0791015625,
-0.039581298828125,
-0.0289306640625,
-0.0062408447265625,
0.0208892822265625,
-0.024322509765625,
-0.06781005859375,
-0.01546478271484375,
-0.006015777587890625,
-0.02655029296875,
0.01190948486328125,
-0.01406097412109375,
-0.0081329345703125,
0.004886627197265625,
-0.06640625,
0.0098876953125,
-0.040863037109375,
0.0240936279296875,
0.02276611328125,
0.03277587890625,
-0.0018978118896484375,
0.0283966064453125,
-0.01204681396484375,
-0.0093841552734375,
-0.0161285400390625,
-0.0679931640625,
0.001293182373046875,
-0.035064697265625,
0.0214385986328125,
0.0067901611328125,
0.008056640625,
-0.027008056640625,
0.03582763671875,
-0.0012340545654296875,
0.04107666015625,
-0.01076507568359375,
-0.001911163330078125,
0.00809478759765625,
0.0208282470703125,
0.00846099853515625,
-0.01084136962890625,
-0.01172637939453125,
-0.035552978515625,
-0.041015625,
0.018585205078125,
-0.036346435546875,
0.0238494873046875,
-0.01629638671875,
-0.01270294189453125,
-0.034820556640625,
-0.017120361328125,
-0.00695037841796875,
-0.007678985595703125,
-0.016845703125,
-0.01186370849609375,
0.0009026527404785156,
-0.034027099609375,
0.0102386474609375,
0.01395416259765625,
-0.055633544921875,
0.01153564453125,
0.033721923828125,
0.0240631103515625,
-0.0156402587890625,
-0.09417724609375,
0.004199981689453125,
0.049713134765625,
-0.00731658935546875,
0.066650390625,
0.0268707275390625,
-0.031982421875,
0.08880615234375,
0.020172119140625,
-0.00197601318359375,
-0.059661865234375,
0.052215576171875,
-0.004451751708984375,
0.019073486328125,
-0.004909515380859375,
-0.0231475830078125,
0.06787109375,
0.0212554931640625,
0.0252227783203125,
0.007801055908203125,
0.04205322265625,
0.01155853271484375,
0.0135955810546875,
-0.051361083984375,
-0.005657196044921875,
-0.035888671875,
-0.0030117034912109375,
0.02862548828125,
0.0031871795654296875,
0.036773681640625,
-0.007495880126953125,
0.01419830322265625,
0.036712646484375,
-0.003215789794921875,
0.006717681884765625,
0.00609588623046875,
-0.0184478759765625,
0.01245880126953125,
0.0118255615234375,
-0.0440673828125,
0.005748748779296875,
0.00978851318359375,
-0.08258056640625,
-0.01010894775390625,
-0.03094482421875,
-0.0192718505859375,
0.0254364013671875,
0.040008544921875,
0.00850677490234375,
-0.00974273681640625,
0.01517486572265625,
0.0264892578125,
-0.013763427734375,
-0.00501251220703125,
-0.0270843505859375,
0.00746917724609375,
-0.0136566162109375,
0.02789306640625,
0.0008444786071777344,
-0.0143280029296875,
0.0667724609375,
0.01140594482421875,
-0.03131103515625,
0.047149658203125,
-0.0167999267578125,
0.021697998046875,
0.017791748046875,
0.037200927734375,
0.0218505859375,
-0.0313720703125,
-0.020965576171875,
0.028472900390625,
-0.0198822021484375,
-0.044921875,
0.02813720703125,
0.004543304443359375,
0.05560302734375,
0.0075836181640625,
-0.0300140380859375,
0.017730712890625,
-0.043365478515625,
-0.01450347900390625,
0.0205230712890625,
0.00341033935546875,
-0.0186004638671875,
-0.028656005859375,
-0.03753662109375,
0.0011920928955078125,
0.0091400146484375,
-0.00823211669921875,
-0.00011897087097167969,
-0.04730224609375,
-0.005779266357421875,
0.01210784912109375,
-0.0214691162109375,
-0.0025787353515625,
-0.0034847259521484375,
-0.018157958984375,
-0.0274505615234375,
0.0029888153076171875,
-0.008026123046875,
0.0174560546875,
-0.02642822265625,
-0.0308685302734375,
0.0281524658203125,
0.003307342529296875,
0.0582275390625,
-0.05023193359375,
-0.0240020751953125,
-0.02642822265625,
-0.02001953125,
0.08465576171875,
0.056121826171875,
0.01371002197265625,
0.00858306884765625,
-0.005619049072265625,
-0.0178070068359375,
0.03887939453125,
-0.04541015625,
-0.0191650390625,
-0.055572509765625,
0.0285797119140625,
0.0124969482421875,
0.0206451416015625,
-0.031585693359375,
0.00743865966796875,
0.0015735626220703125,
0.0138702392578125,
0.0305633544921875,
-0.033203125,
0.0771484375,
0.00249481201171875,
0.06982421875,
-0.0049591064453125,
0.034698486328125,
-0.00324249267578125,
-0.0150604248046875,
-0.01174163818359375,
-0.058074951171875,
0.01116180419921875,
0.01495361328125,
0.044281005859375,
-0.00872802734375,
-0.037017822265625,
0.012451171875,
-0.0238037109375,
0.0158843994140625,
0.005889892578125,
0.007030487060546875,
-0.0093994140625,
0.061126708984375,
-0.0232086181640625,
0.039459228515625,
0.0098419189453125,
0.029327392578125,
-0.037445068359375,
-0.0193023681640625,
0.01500701904296875,
-0.0190582275390625,
0.004383087158203125,
0.034393310546875,
-0.0367431640625,
0.047088623046875,
0.07867431640625,
-0.025360107421875,
0.032135009765625,
0.02349853515625,
0.003849029541015625,
0.0496826171875,
0.0098724365234375,
0.054229736328125,
0.0260772705078125,
0.0501708984375,
-0.017791748046875,
-0.01030731201171875,
-0.00701141357421875,
-0.041259765625,
0.010955810546875,
0.0264434814453125,
0.046173095703125,
-0.052490234375,
0.0162506103515625,
0.01529693603515625,
-0.02801513671875,
0.01435089111328125,
0.020538330078125,
-0.01503753662109375,
-0.01427459716796875,
-0.001491546630859375,
-0.0125732421875,
-0.024078369140625,
-0.01071929931640625,
0.004302978515625,
0.0198822021484375,
0.0266876220703125,
0.01348876953125,
-0.0085296630859375,
-0.10748291015625,
-0.019287109375,
0.0648193359375,
-0.01568603515625,
-0.04486083984375,
-0.0026340484619140625,
0.0024166107177734375,
0.00897216796875,
-0.03863525390625,
0.030670166015625,
-0.00771331787109375,
0.029571533203125,
-0.01543426513671875,
-0.026763916015625,
0.0111236572265625,
0.043914794921875,
-0.0364990234375,
0.0016326904296875,
0.02392578125,
-0.036041259765625,
-0.048675537109375,
-0.01216888427734375,
0.0024433135986328125,
0.038482666015625,
-0.0202484130859375,
0.026123046875,
-0.0162811279296875,
0.0008158683776855469,
-0.025421142578125,
-0.068359375,
0.073486328125,
-0.0247039794921875,
-0.025299072265625,
0.0145416259765625,
-0.0153656005859375,
-0.0094451904296875,
0.012725830078125,
0.0606689453125,
-0.042816162109375,
-0.0232696533203125,
0.0291595458984375,
-0.006557464599609375,
-0.023773193359375,
0.006862640380859375,
-0.0667724609375,
0.11572265625,
-0.00836944580078125,
0.0224761962890625,
0.0244903564453125,
0.034637451171875,
-0.027008056640625,
0.011077880859375,
-0.029083251953125,
0.07470703125,
0.06512451171875,
0.01532745361328125,
-0.0579833984375,
-0.039154052734375,
0.01824951171875,
0.06939697265625,
0.0309600830078125,
0.0081939697265625,
-0.03509521484375,
0.0009508132934570312,
0.0260009765625,
0.00818634033203125,
-0.0210113525390625,
0.049560546875,
0.00919342041015625,
-0.00688934326171875,
0.037841796875,
-0.011322021484375,
0.03948974609375,
-0.014373779296875,
-0.00885772705078125,
0.0301361083984375,
0.01241302490234375,
0.01554107666015625,
-0.0036106109619140625,
-0.013427734375,
-0.015960693359375,
0.008056640625,
-0.00707244873046875,
0.0217132568359375,
0.031341552734375,
0.043365478515625,
0.0723876953125,
-0.0631103515625,
0.015838623046875,
-0.03887939453125,
0.07354736328125,
0.00016701221466064453,
0.011383056640625,
0.033905029296875,
0.0194854736328125,
0.05865478515625,
-0.0018320083618164062,
0.00585174560546875,
0.00036454200744628906,
0.039154052734375,
0.0390625,
0.0201263427734375,
0.030120849609375,
0.0131988525390625,
0.040496826171875,
0.0350341796875,
0.03631591796875,
-0.037872314453125,
-0.040069580078125,
0.00844573974609375,
0.0212860107421875,
0.01221466064453125,
0.0012645721435546875,
0.0161285400390625,
-0.0223541259765625,
0.037139892578125,
-0.057525634765625,
-0.0070648193359375,
0.042144775390625,
-0.006053924560546875,
-0.002536773681640625,
-0.01258087158203125,
0.023162841796875,
0.002315521240234375,
-0.048980712890625,
0.04534912109375,
0.0236663818359375,
0.037841796875,
-0.02484130859375,
0.07537841796875,
0.006137847900390625,
-0.01158905029296875,
0.01114654541015625,
0.0286102294921875,
0.019073486328125,
-0.0247650146484375,
0.020538330078125,
-0.01464080810546875,
0.006351470947265625,
-0.00032901763916015625,
0.034454345703125,
0.0458984375,
0.08984375,
0.08966064453125,
-0.012603759765625,
-0.0026912689208984375,
0.02996826171875,
0.004184722900390625,
-0.02569580078125,
-0.0205078125,
-0.0021724700927734375,
0.015045166015625,
0.003093719482421875,
0.01055908203125,
0.06011962890625,
0.002414703369140625,
-0.0279083251953125,
0.047088623046875,
-0.01629638671875,
-0.00009936094284057617,
0.046844482421875,
-0.039306640625,
0.0302581787109375,
-0.0222320556640625,
-0.07891845703125,
-0.019012451171875,
-0.037445068359375,
-0.00371551513671875,
0.0285186767578125,
0.03271484375,
0.0125274658203125,
0.01079559326171875,
-0.0089874267578125,
0.024444580078125,
0.038238525390625,
-0.046875,
-0.0194091796875,
0.04547119140625,
0.04754638671875,
0.015594482421875,
-0.0237579345703125,
-0.01708984375,
-0.027679443359375,
0.05999755859375,
0.072998046875,
0.023651123046875,
0.0101776123046875,
0.050567626953125,
0.0316162109375,
0.031524658203125,
-0.047027587890625,
-0.0124969482421875,
0.053680419921875,
-0.02191162109375,
0.02978515625,
-0.0223541259765625,
-0.017974853515625,
-0.0316162109375,
0.06158447265625,
-0.035980224609375,
-0.03900146484375,
-0.00009530782699584961,
0.03619384765625,
-0.0288848876953125,
0.0177001953125,
-0.0199737548828125,
0.01140594482421875,
-0.004108428955078125,
-0.0404052734375,
0.0426025390625,
0.024993896484375,
0.034423828125,
-0.00827789306640625,
0.04827880859375,
-0.028717041015625,
0.04937744140625,
0.01216888427734375,
0.0555419921875,
0.0239715576171875,
0.0232696533203125,
-0.0236053466796875,
0.012115478515625,
-0.00937652587890625,
0.0009002685546875,
0.028411865234375,
0.0229644775390625,
0.003246307373046875,
-0.01068115234375,
0.0018415451049804688,
0.003337860107421875,
0.0048370361328125,
-0.03271484375,
-0.00545501708984375,
0.031829833984375,
-0.009765625,
-0.031036376953125,
-0.004123687744140625,
-0.038848876953125,
-0.046539306640625,
-0.005645751953125,
-0.00001239776611328125,
-0.025909423828125,
-0.038726806640625,
-0.056427001953125,
-0.026031494140625,
0.0263824462890625,
-0.01259613037109375,
0.03240966796875,
-0.019989013671875,
-0.021240234375,
-0.01506805419921875,
0.00847625732421875,
-0.004901885986328125,
-0.0224456787109375,
-0.035552978515625,
-0.025543212890625,
-0.05316162109375,
-0.041900634765625,
0.080322265625,
-0.01142120361328125,
0.0012311935424804688,
0.01580810546875,
-0.00928497314453125,
-0.02978515625,
0.01605224609375,
0.0013647079467773438,
0.063720703125,
-0.00356292724609375,
0.000530242919921875,
0.038818359375,
-0.0027923583984375,
-0.037078857421875,
-0.06439208984375,
-0.0008072853088378906,
-0.00958251953125,
-0.00894927978515625,
-0.00563812255859375,
0.0065765380859375,
0.005290985107421875,
-0.01519775390625,
-0.035919189453125,
0.0252532958984375,
-0.0009579658508300781,
-0.01708984375,
-0.04498291015625,
0.0237884521484375,
-0.00617218017578125,
0.004993438720703125,
-0.017791748046875,
0.01326751708984375,
0.006420135498046875,
0.03662109375,
0.020233154296875,
0.0190887451171875,
0.01751708984375,
0.0254974365234375,
-0.0261383056640625,
0.0170745849609375,
-0.01247406005859375,
-0.029388427734375,
0.0048370361328125,
-0.00786590576171875,
0.055389404296875,
0.04779052734375,
-0.0087432861328125,
0.03924560546875,
0.0178680419921875,
-0.03564453125,
-0.00453948974609375,
0.0039825439453125,
-0.061981201171875,
0.007404327392578125,
0.037567138671875,
0.1046142578125,
0.023223876953125,
-0.056396484375,
-0.017425537109375,
-0.0345458984375,
-0.0118560791015625,
-0.0261688232421875,
0.00414276123046875,
-0.050811767578125,
-0.01102447509765625,
-0.0135345458984375,
-0.01666259765625,
0.01276397705078125,
-0.019744873046875,
-0.0191802978515625,
-0.0026721954345703125,
-0.01323699951171875,
-0.013946533203125,
0.002071380615234375,
-0.0166473388671875,
0.0304107666015625,
-0.017913818359375,
-0.00017380714416503906,
0.0017261505126953125,
0.0133819580078125,
0.0038356781005859375,
0.0222320556640625,
-0.025604248046875,
0.0196533203125,
-0.01708984375,
0.005718231201171875,
0.004695892333984375,
0.021331787109375,
-0.005558013916015625,
0.0175323486328125,
-0.0189056396484375,
0.007137298583984375,
0.0158843994140625,
-0.0042572021484375,
-0.01297760009765625,
0.0090484619140625,
0.006206512451171875,
0.00397491455078125,
-0.0125885009765625,
-0.00821685791015625,
-0.0255584716796875,
0.0275421142578125,
-0.0255889892578125,
-0.004184722900390625,
-0.0004305839538574219,
-0.0271759033203125,
0.01654052734375,
-0.04931640625,
-0.0050201416015625,
-0.017181396484375,
0.007320404052734375,
-0.050445556640625,
-0.046783447265625,
0.02130126953125
] |
e7aa2ade136475a13cb95de174b3eefcf76a56aa
|
Wordpress Stackexchange
Q: Login in Wordpress using external database data I have a WP site and also have a external DB (means not WP DB) with users. The insertion process at that table uses the same algorithm as WP uses. What I'm need to do here is login in WP but using this external DB which is in the same host by the way. I check this links http://www.tyssendesign.com.au/articles/cms/connecting-to-external-database-from-within-wordpress/ and http://wordpress.org/extend/plugins/external-database-authentication/ and for the first is not what I'm want but for the second one is not compatible with WP 3+ and I'm using 3.3.1, any suggestion or docs or something else?
A: You can override the core wp_authenticate function.
You would need to create a custom plugin and declare a new version of wp_authenticate. The function accepts a username and a password and returns a WP $user object.
wp_authenticate is a 'pluggable' function and it is found in the wp-includes/pluggable.php file.
|
Q: Login in Wordpress using external database data I have a WP site and also have a external DB (means not WP DB) with users. The insertion process at that table uses the same algorithm as WP uses. What I'm need to do here is login in WP but using this external DB which is in the same host by the way. I check this links http://www.tyssendesign.com.au/articles/cms/connecting-to-external-database-from-within-wordpress/ and http://wordpress.org/extend/plugins/external-database-authentication/ and for the first is not what I'm want but for the second one is not compatible with WP 3+ and I'm using 3.3.1, any suggestion or docs or something else?
A: You can override the core wp_authenticate function.
You would need to create a custom plugin and declare a new version of wp_authenticate. The function accepts a username and a password and returns a WP $user object.
wp_authenticate is a 'pluggable' function and it is found in the wp-includes/pluggable.php file.
A: I needed more features than I could find elsewhere so I wrote my own plugin - External Login.
It has these main features:
*
*Map a different DB table structure to be compatible with the WordPress fields
*Handle different hashing methods from your external database (bcrypt, MD 2 4 and 5, SHA 256 384 and 512, and many many more)
*Allow for different salting methods
*Generate a copied version of the user in the database so that you can continue to use common WordPress features with users and roles
*Map roles from your ‘external database’ to those found in WordPress e.g. a student in the ‘external database’ becomes an editor in the WordPress database.
Let me know if you require another feature :)
https://en-gb.wordpress.org/plugins/external-login/
A: Have you tried the External Database Authentication plugin? Just because it hasn't been updated in a while doesn't mean it won't necessarily work. At the very least you can look at their source code to see how they did what they did and use that as a basis to get what you need done.
Here is the code http://plugins.trac.wordpress.org/browser/external-database-authentication/trunk/ext_db_auth.php
A: I've just updated that old plugin for my needs. You can find the update @ http://www.7mediaws.org/extend/plugins/external-db-auth-reloaded
A: Yes, your plugin is awesome. Just what you need to improve and finalize your plugin is that in newer WordPress versions, there are two different tables that contain user data. They are wp_user and wp_usermeta. And in the plugin, it is provided only one table to authenticate. So if this feature goes right, definitely your plugin is 100% successful.
What else, is that there is a bug. As there is only one table to authenticate, so I couldn't authenticate user roles and sync them. This means when I enable external login, the time I logged out, and login the next time, I am of subscriber role, that I have specified if no roles matches. So i loosed my adminship too. Kindly help and understand.
|
wordpress
|
{
"language": "en",
"length": 477,
"provenance": "stackexchange_00019.jsonl.gz:420223",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53082"
}
|
[
0.06463623046875,
0.03021240234375,
-0.027374267578125,
-0.01012420654296875,
0.050567626953125,
-0.0604248046875,
0.06475830078125,
-0.0244903564453125,
-0.00922393798828125,
0.01849365234375,
-0.0443115234375,
0.0202789306640625,
-0.05364990234375,
0.00467681884765625,
-0.006084442138671875,
-0.058563232421875,
0.0222930908203125,
0.01568603515625,
0.051055908203125,
-0.005825042724609375,
0.0127105712890625,
0.01485443115234375,
0.0189361572265625,
0.0017452239990234375,
0.01041412353515625,
0.007343292236328125,
0.103271484375,
-0.0186767578125,
0.0653076171875,
0.0297088623046875,
0.0307464599609375,
-0.1182861328125,
-0.01094818115234375,
0.04827880859375,
-0.032073974609375,
-0.07000732421875,
-0.0022869110107421875,
0.0296173095703125,
0.0192413330078125,
0.007049560546875,
0.047332763671875,
-0.021575927734375,
0.01236724853515625,
0.05462646484375,
-0.0213775634765625,
-0.044189453125,
0.0533447265625,
-0.043975830078125,
0.0008664131164550781,
0.027801513671875,
0.0289306640625,
0.029510498046875,
0.03985595703125,
0.0022869110107421875,
-0.0052642822265625,
0.0131378173828125,
-0.015899658203125,
-0.0196685791015625,
0.0267333984375,
0.0243988037109375,
-0.01174163818359375,
-0.02490234375,
0.009552001953125,
-0.026336669921875,
0.0129241943359375,
0.024017333984375,
0.0280609130859375,
0.0303192138671875,
-0.011505126953125,
-0.01494598388671875,
-0.0198516845703125,
-0.029449462890625,
-0.007183074951171875,
0.0057373046875,
-0.047943115234375,
0.0117340087890625,
0.020477294921875,
0.00444793701171875,
0.0011148452758789062,
-0.01139068603515625,
-0.0389404296875,
0.0007805824279785156,
-0.05657958984375,
-0.062255859375,
0.0248870849609375,
-0.006397247314453125,
-0.01446533203125,
0.008270263671875,
0.0112152099609375,
-0.0017881393432617188,
-0.0031185150146484375,
0.00638580322265625,
0.01424407958984375,
0.03607177734375,
-0.01715087890625,
-0.01493072509765625,
0.01378631591796875,
0.0171356201171875,
-0.0181884765625,
0.01552581787109375,
0.0093536376953125,
-0.037994384765625,
0.0225982666015625,
-0.03900146484375,
-0.0023212432861328125,
0.054962158203125,
0.02215576171875,
-0.052398681640625,
-0.0275726318359375,
-0.00405120849609375,
-0.01220703125,
-0.0307464599609375,
0.00440216064453125,
-0.052581787109375,
0.007305145263671875,
0.0557861328125,
0.0013132095336914062,
0.00797271728515625,
0.01465606689453125,
0.0078582763671875,
-0.0316162109375,
-0.0117340087890625,
-0.043212890625,
-0.0027408599853515625,
-0.00737762451171875,
-0.0443115234375,
0.007190704345703125,
0.03955078125,
-0.046234130859375,
0.041015625,
-0.033355712890625,
0.019775390625,
0.0701904296875,
0.028564453125,
-0.0231475830078125,
-0.0172882080078125,
0.057464599609375,
0.04107666015625,
0.0180511474609375,
0.005733489990234375,
0.0216522216796875,
-0.043914794921875,
-0.034637451171875,
0.0260772705078125,
-0.0010738372802734375,
0.0256500244140625,
0.013153076171875,
-0.0014905929565429688,
-0.00325775146484375,
-0.019866943359375,
-0.0006051063537597656,
-0.0100860595703125,
-0.0294189453125,
0.01483917236328125,
0.057708740234375,
0.0131988525390625,
0.011749267578125,
-0.004833221435546875,
0.0204315185546875,
0.0305328369140625,
-0.00484466552734375,
-0.017242431640625,
0.0121307373046875,
-0.0103302001953125,
-0.03192138671875,
0.00403594970703125,
-0.023529052734375,
-0.004192352294921875,
0.0367431640625,
0.045257568359375,
0.00504302978515625,
-0.038726806640625,
0.032012939453125,
0.047332763671875,
0.00670623779296875,
0.034393310546875,
-0.015899658203125,
0.05181884765625,
0.0242156982421875,
0.042388916015625,
0.029022216796875,
-0.029327392578125,
0.07421875,
-0.01430511474609375,
-0.01505279541015625,
0.0027141571044921875,
0.02325439453125,
0.053253173828125,
0.00794219970703125,
0.041534423828125,
-0.01959228515625,
-0.0065460205078125,
-0.05194091796875,
0.050811767578125,
-0.0252227783203125,
-0.01824951171875,
-0.00653839111328125,
0.0126800537109375,
-0.0203399658203125,
-0.01236724853515625,
0.049774169921875,
0.03814697265625,
-0.00812530517578125,
-0.007442474365234375,
-0.044342041015625,
0.0161285400390625,
0.003173828125,
0.01189422607421875,
0.04107666015625,
0.01154327392578125,
-0.0025482177734375,
0.02178955078125,
-0.004001617431640625,
-0.040374755859375,
-0.03875732421875,
0.0267181396484375,
-0.0301971435546875,
0.048065185546875,
-0.005649566650390625,
0.04864501953125,
-0.024810791015625,
-0.027801513671875,
-0.01873779296875,
-0.048675537109375,
0.0170745849609375,
-0.040374755859375,
-0.0010442733764648438,
-0.024017333984375,
0.021209716796875,
-0.016754150390625,
0.03302001953125,
0.0299530029296875,
0.0206298828125,
0.02984619140625,
-0.0294952392578125,
-0.0228118896484375,
-0.003978729248046875,
-0.038665771484375,
0.01094818115234375,
0.04400634765625,
0.040496826171875,
0.01229095458984375,
-0.015472412109375,
-0.0115509033203125,
-0.00873565673828125,
-0.06591796875,
0.01788330078125,
-0.020477294921875,
0.020599365234375,
0.036529541015625,
-0.0458984375,
-0.011077880859375,
0.0439453125,
-0.0428466796875,
-0.02691650390625,
0.054168701171875,
0.01123809814453125,
-0.0009794235229492188,
0.007770538330078125,
-0.0035686492919921875,
0.0014982223510742188,
-0.033843994140625,
-0.034271240234375,
-0.020294189453125,
-0.0136871337890625,
-0.020721435546875,
0.0146942138671875,
-0.0032024383544921875,
0.0162353515625,
-0.03485107421875,
0.01129913330078125,
-0.00746917724609375,
0.0035228729248046875,
0.004764556884765625,
0.0018358230590820312,
0.00922393798828125,
-0.031890869140625,
0.007732391357421875,
0.00818634033203125,
0.001354217529296875,
-0.0195770263671875,
0.0135498046875,
-0.01235198974609375,
-0.0024471282958984375,
-0.0142974853515625,
-0.0272064208984375,
0.01279449462890625,
0.0252685546875,
-0.0285491943359375,
-0.03228759765625,
0.0213775634765625,
0.0005583763122558594,
-0.045928955078125,
0.0279083251953125,
-0.05078125,
-0.025909423828125,
-0.034576416015625,
-0.0279693603515625,
0.040130615234375,
-0.052337646484375,
0.00421905517578125,
0.05963134765625,
-0.01471710205078125,
0.005779266357421875,
-0.01329803466796875,
-0.00476837158203125,
0.00264739990234375,
-0.0022525787353515625,
-0.0095977783203125,
-0.05474853515625,
-0.015106201171875,
0.0010023117065429688,
0.023712158203125,
-0.0197601318359375,
0.019378662109375,
-0.027923583984375,
-0.004222869873046875,
0.011199951171875,
-0.0654296875,
-0.0616455078125,
-0.045440673828125,
-0.045379638671875,
-0.007396697998046875,
-0.035125732421875,
-0.0160064697265625,
0.029144287109375,
-0.0252532958984375,
0.004291534423828125,
0.02545166015625,
-0.054107666015625,
-0.035552978515625,
-0.06396484375,
-0.06707763671875,
-0.04345703125,
0.00669097900390625,
-0.019744873046875,
0.00487518310546875,
0.005191802978515625,
-0.003238677978515625,
-0.010772705078125,
0.0036220550537109375,
0.00304412841796875,
-0.01099395751953125,
-0.043182373046875,
-0.0158538818359375,
-0.02349853515625,
-0.0255889892578125,
-0.00609588623046875,
0.008331298828125,
-0.0168609619140625,
0.00904083251953125,
0.00018107891082763672,
0.0188751220703125,
0.0006995201110839844,
0.0165863037109375,
-0.01474761962890625,
-0.020355224609375,
0.0097808837890625,
-0.02459716796875,
-0.036407470703125,
0.0294036865234375,
-0.017364501953125,
-0.022491455078125,
-0.006526947021484375,
0.00513458251953125,
-0.0245819091796875,
0.0081939697265625,
-0.041748046875,
0.033233642578125,
0.01120758056640625,
-0.037506103515625,
0.0098724365234375,
0.0249786376953125,
0.0066375732421875,
0.0287628173828125,
0.003993988037109375,
0.0144500732421875,
-0.0279083251953125,
0.0016021728515625,
-0.0032749176025390625,
-0.02081298828125,
-0.00858306884765625,
0.002666473388671875,
-0.01509857177734375,
-0.049652099609375,
0.072509765625,
0.0175628662109375,
0.0197601318359375,
-0.041595458984375,
-0.04693603515625,
0.0003256797790527344,
0.1180419921875,
0.0163726806640625,
-0.007843017578125,
0.0489501953125,
0.0131683349609375,
-0.06494140625,
0.00004458427429199219,
-0.08221435546875,
-0.0030670166015625,
0.0190582275390625,
-0.040740966796875,
-0.04541015625,
-0.005336761474609375,
0.0216064453125,
-0.0166168212890625,
0.03155517578125,
-0.033782958984375,
0.01091766357421875,
0.025390625,
0.009033203125,
0.0108795166015625,
0.01360321044921875,
-0.013702392578125,
0.01727294921875,
-0.01364898681640625,
-0.0721435546875,
-0.002506256103515625,
-0.0654296875,
0.053680419921875,
0.045318603515625,
-0.032806396484375,
-0.01258087158203125,
0.0159454345703125,
0.01287841796875,
0.00426483154296875,
0.01488494873046875,
0.00705718994140625,
-0.00550079345703125,
-0.0251007080078125,
-0.006275177001953125,
-0.0301666259765625,
-0.0004673004150390625,
-0.04815673828125,
-0.0298309326171875,
-0.0419921875,
-0.05975341796875,
-0.01163482666015625,
-0.031951904296875,
-0.0036220550537109375,
-0.005962371826171875,
-0.00701141357421875,
-0.003536224365234375,
0.0178680419921875,
-0.0214691162109375,
0.0106048583984375,
-0.017242431640625,
-0.015533447265625,
0.075439453125,
0.035064697265625,
-0.0004949569702148438,
-0.021697998046875,
0.07867431640625,
0.0159912109375,
-0.052825927734375,
-0.037445068359375,
-0.0235137939453125,
0.033203125,
-0.011138916015625,
0.05682373046875,
0.006946563720703125,
-0.03424072265625,
0.07879638671875,
0.024169921875,
0.003658294677734375,
-0.007843017578125,
0.07958984375,
-0.00885772705078125,
-0.0235748291015625,
0.03094482421875,
-0.00875091552734375,
-0.035675048828125,
0.007579803466796875,
0.0134429931640625,
-0.01522064208984375,
0.028106689453125,
0.00992584228515625,
0.00615692138671875,
-0.016082763671875,
-0.005390167236328125,
-0.0258941650390625,
0.01165008544921875,
-0.046630859375,
-0.0006585121154785156,
0.0079345703125,
0.0014047622680664062,
-0.01488494873046875,
-0.01268768310546875,
-0.0294036865234375,
0.01444244384765625,
-0.0106353759765625,
-0.007213592529296875,
0.00827789306640625,
0.00490570068359375,
-0.0328369140625,
0.01259613037109375,
-0.027374267578125,
0.10760498046875,
-0.0127716064453125,
-0.08447265625,
0.03778076171875,
-0.0266265869140625,
0.010986328125,
0.06317138671875,
-0.0223388671875,
0.011932373046875,
-0.039031982421875,
-0.0357666015625,
0.0019054412841796875,
-0.022552490234375,
-0.0604248046875,
-0.032440185546875,
-0.0236968994140625,
-0.01526641845703125,
-0.0015420913696289062,
0.0157318115234375,
0.05963134765625,
-0.032989501953125,
0.06378173828125,
-0.004604339599609375,
0.01320648193359375,
0.0206451416015625,
0.0382080078125,
0.022613525390625,
-0.0288848876953125,
0.0260009765625,
-0.0260467529296875,
0.0140838623046875,
-0.051849365234375,
-0.02783203125,
0.0191192626953125,
0.0457763671875,
-0.01131439208984375,
-0.0107574462890625,
0.022857666015625,
0.014984130859375,
-0.002964019775390625,
0.061126708984375,
-0.001750946044921875,
-0.05230712890625,
-0.022705078125,
0.004795074462890625,
0.059814453125,
-0.0281219482421875,
0.026763916015625,
0.003871917724609375,
-0.016082763671875,
-0.0026416778564453125,
0.045318603515625,
0.0126800537109375,
-0.053009033203125,
-0.0545654296875,
-0.0191650390625,
-0.03857421875,
-0.0283203125,
0.02508544921875,
0.01369476318359375,
-0.005435943603515625,
-0.0175323486328125,
0.001796722412109375,
-0.0300750732421875,
0.0287628173828125,
-0.0179443359375,
-0.0032634735107421875,
-0.009002685546875,
0.0018548965454101562,
0.0545654296875,
0.014434814453125,
-0.025360107421875,
-0.0153350830078125,
-0.019378662109375,
-0.01007843017578125,
0.006481170654296875,
-0.0273590087890625,
-0.0166015625,
-0.0015954971313476562,
-0.0081329345703125,
0.0206298828125,
-0.00727081298828125,
-0.0047454833984375,
-0.04705810546875,
0.0107269287109375,
0.001445770263671875,
0.00788116455078125,
-0.0197906494140625,
0.0789794921875,
0.018463134765625,
0.030303955078125,
0.033966064453125,
0.06396484375,
-0.035064697265625,
-0.00492095947265625,
0.0186920166015625,
-0.048004150390625,
0.00038361549377441406,
-0.042144775390625,
0.02886962890625,
-0.0038013458251953125,
-0.003124237060546875,
-0.0017747879028320312,
0.005268096923828125,
-0.0413818359375,
-0.01629638671875,
-0.00966644287109375,
0.1025390625,
-0.00907135009765625,
-0.0098876953125,
0.035552978515625,
-0.02978515625,
-0.0012531280517578125,
-0.0214385986328125,
-0.008087158203125,
0.008880615234375,
-0.00653839111328125,
-0.021575927734375,
0.040802001953125,
-0.054290771484375,
0.051300048828125,
0.05792236328125,
0.01238250732421875,
0.035064697265625,
0.00867462158203125,
0.0030670166015625,
-0.009246826171875,
0.0050506591796875,
-0.037567138671875,
-0.001708984375,
0.02056884765625,
-0.009246826171875,
-0.043914794921875,
-0.0199127197265625,
-0.0264129638671875,
0.0289306640625,
0.034881591796875,
0.0748291015625,
-0.07366943359375,
0.0170135498046875,
0.018707275390625,
-0.0173492431640625,
0.0297698974609375,
-0.005023956298828125,
-0.02899169921875,
-0.01171875,
0.038360595703125,
0.001110076904296875,
-0.026519775390625,
0.0177459716796875,
0.022491455078125,
0.011199951171875,
0.0157623291015625,
0.045440673828125,
0.007190704345703125,
0.018310546875,
-0.0266876220703125,
-0.01474761962890625,
0.03558349609375,
-0.01143646240234375,
-0.00997161865234375,
0.0161895751953125,
-0.026214599609375,
-0.061065673828125,
0.00524139404296875,
-0.050811767578125,
-0.004474639892578125,
0.0202789306640625,
0.0024814605712890625,
0.0836181640625,
0.03118896484375,
0.0174102783203125,
-0.00829315185546875,
-0.0292205810546875,
0.061737060546875,
0.051513671875,
-0.020416259765625,
0.01007843017578125,
0.012298583984375,
-0.08966064453125,
0.0000028014183044433594,
-0.03326416015625,
0.0194244384765625,
-0.025543212890625,
-0.03289794921875,
0.05999755859375,
-0.015350341796875,
-0.0030670166015625,
0.0439453125,
0.042724609375,
-0.0166778564453125,
-0.004566192626953125,
0.036376953125,
-0.07598876953125,
-0.043731689453125,
0.03857421875,
-0.0261383056640625,
-0.0242767333984375,
0.00994110107421875,
-0.054656982421875,
0.1119384765625,
-0.02294921875,
0.0212554931640625,
0.005817413330078125,
0.03759765625,
-0.005893707275390625,
0.033203125,
-0.0400390625,
0.046142578125,
0.00803375244140625,
0.0288238525390625,
-0.0282440185546875,
0.00788116455078125,
0.00577545166015625,
0.0030517578125,
0.01513671875,
0.00554656982421875,
-0.0270538330078125,
0.0013599395751953125,
0.01091766357421875,
0.02301025390625,
0.00759124755859375,
0.02099609375,
0.01065826416015625,
0.01209259033203125,
0.04144287109375,
-0.035064697265625,
0.0182342529296875,
-0.005138397216796875,
0.0181732177734375,
0.031036376953125,
-0.0032978057861328125,
-0.0201263427734375,
0.0091094970703125,
0.036468505859375,
-0.0341796875,
0.01004791259765625,
0.0216522216796875,
-0.01070404052734375,
0.0068206787109375,
0.0140228271484375,
0.00733184814453125,
-0.020599365234375,
-0.0007586479187011719,
-0.0263824462890625,
0.033935546875,
-0.007518768310546875,
-0.012481689453125,
0.029327392578125,
0.0233306884765625,
0.0276947021484375,
-0.033538818359375,
-0.0248260498046875,
-0.00536346435546875,
-0.00675201416015625,
0.06494140625,
0.03216552734375,
0.022674560546875,
-0.04339599609375,
0.01068878173828125,
0.0198974609375,
0.0843505859375,
-0.058258056640625,
-0.025726318359375,
0.00372314453125,
0.0002727508544921875,
0.0236358642578125,
0.0150299072265625,
0.06707763671875,
0.03131103515625,
0.01332855224609375,
0.00592803955078125,
0.00439453125,
0.017486572265625,
-0.01476287841796875,
0.005401611328125,
0.0175933837890625,
-0.00966644287109375,
0.03582763671875,
0.0034770965576171875,
0.00946044921875,
0.01230621337890625,
-0.0224761962890625,
-0.0201873779296875,
0.016632080078125,
0.0212554931640625,
0.028778076171875,
-0.01416015625,
0.0303802490234375,
-0.006504058837890625,
0.02642822265625,
-0.0665283203125,
-0.042205810546875,
0.00820159912109375,
0.061798095703125,
-0.006809234619140625,
-0.00762176513671875,
0.05206298828125,
0.0467529296875,
-0.0227813720703125,
-0.0298309326171875,
0.0235595703125,
-0.0157470703125,
-0.0155792236328125,
-0.031097412109375,
0.004695892333984375,
0.023712158203125,
0.01192474365234375,
0.01415252685546875,
0.04052734375,
0.0233154296875,
-0.0154266357421875,
0.03167724609375,
-0.006439208984375,
-0.031768798828125,
0.0255584716796875,
-0.021209716796875,
0.0537109375,
-0.004009246826171875,
-0.067626953125,
-0.044158935546875,
0.0014324188232421875,
-0.00033092498779296875,
-0.0010728836059570312,
0.03411865234375,
-0.002376556396484375,
0.0040130615234375,
0.03643798828125,
-0.0200653076171875,
0.01898193359375,
0.0246429443359375,
-0.01094818115234375,
-0.0335693359375,
0.03314208984375,
-0.0217742919921875,
-0.04510498046875,
-0.020782470703125,
-0.0013456344604492188,
0.035003662109375,
0.007068634033203125,
0.061065673828125,
-0.00981903076171875,
0.0182037353515625,
0.003818511962890625,
-0.00861358642578125,
-0.0072479248046875,
0.007061004638671875,
-0.057464599609375,
-0.0172576904296875,
0.018768310546875,
0.0208740234375,
-0.01180267333984375,
0.07159423828125,
-0.01358795166015625,
0.03680419921875,
0.02313232421875,
-0.0394287109375,
0.01348114013671875,
0.030426025390625,
0.00986480712890625,
-0.0235748291015625,
-0.01336669921875,
0.007274627685546875,
0.0161285400390625,
0.013397216796875,
0.00634002685546875,
-0.0014934539794921875,
0.040496826171875,
-0.0504150390625,
-0.02117919921875,
-0.00885772705078125,
-0.053070068359375,
-0.0260162353515625,
0.016815185546875,
-0.0126800537109375,
-0.035003662109375,
-0.0050048828125,
-0.024383544921875,
0.00942230224609375,
-0.00481414794921875,
0.0160675048828125,
0.0152587890625,
-0.05474853515625,
0.0333251953125,
0.0810546875,
0.08331298828125,
0.0275421142578125,
0.03741455078125,
0.01702880859375,
-0.0256500244140625,
0.028411865234375,
-0.032562255859375,
-0.05303955078125,
-0.057891845703125,
0.009246826171875,
0.020294189453125,
-0.0277862548828125,
-0.049835205078125,
-0.0963134765625,
0.0160369873046875,
0.034454345703125,
0.0015239715576171875,
-0.0450439453125,
0.0018205642700195312,
-0.03155517578125,
0.052825927734375,
0.01482391357421875,
-0.01108551025390625,
0.0255584716796875,
0.051300048828125,
-0.0253143310546875,
-0.01218414306640625,
-0.0135955810546875,
0.00432586669921875,
-0.0107421875,
0.025054931640625,
0.04010009765625,
-0.022247314453125,
0.003326416015625,
0.01006317138671875,
0.00035381317138671875,
0.05499267578125,
-0.03564453125,
0.00336456298828125,
0.038787841796875,
-0.02801513671875,
-0.0242462158203125,
-0.047088623046875,
0.005329132080078125,
-0.072509765625,
-0.01678466796875,
-0.025054931640625,
0.00113677978515625,
0.003688812255859375,
-0.047332763671875,
-0.0750732421875,
0.05291748046875,
-0.01213836669921875,
-0.0232696533203125,
-0.059844970703125,
0.0281829833984375,
0.006378173828125,
-0.028289794921875,
-0.0304718017578125,
-0.0266876220703125,
-0.018402099609375,
0.033111572265625,
0.044342041015625,
-0.049224853515625,
0.03509521484375,
0.03631591796875,
-0.07818603515625,
0.045379638671875,
0.0262298583984375,
0.022796630859375,
0.0118255615234375,
0.006595611572265625,
0.023406982421875,
0.0309600830078125,
-0.034423828125,
0.01323699951171875,
-0.01218414306640625,
0.01409912109375,
-0.027496337890625,
-0.034210205078125,
0.0316162109375,
0.01442718505859375,
0.03338623046875,
0.01396942138671875,
-0.01131439208984375,
-0.039703369140625,
-0.03192138671875,
-0.047943115234375,
0.01837158203125,
-0.0244140625,
-0.00168609619140625,
-0.06494140625,
-0.004718780517578125,
0.00623321533203125,
0.006984710693359375,
-0.0234222412109375,
0.0323486328125,
-0.0025882720947265625,
-0.011016845703125,
0.03662109375,
-0.0288543701171875,
0.04119873046875,
0.005405426025390625,
0.06622314453125,
-0.053680419921875,
-0.045166015625,
0.01898193359375,
-0.005035400390625,
0.002391815185546875,
-0.024444580078125,
-0.019805908203125,
0.0240020751953125,
-0.0106201171875,
0.0195159912109375,
-0.0023937225341796875,
0.062255859375,
-0.025726318359375,
0.0064239501953125,
0.0027790069580078125,
0.01332855224609375,
-0.020355224609375,
0.016845703125,
0.01708984375,
0.04949951171875,
0.006992340087890625,
0.045989990234375,
-0.008087158203125,
-0.049530029296875,
-0.037933349609375,
0.03369140625,
-0.01593017578125,
-0.0180206298828125,
-0.003513336181640625,
-0.018829345703125,
0.005390167236328125,
0.0026226043701171875,
0.005828857421875,
-0.032745361328125,
0.0228729248046875,
0.0035915374755859375,
0.006320953369140625,
0.020751953125
] |
3c59589a7b62a3ae6e344ec4bafb230b02f4228f
|
Wordpress Stackexchange
Q: How to Change the Categories Order in the Admin Dashboard? The order of categories on dashboard is alphabetical. Can I change it to custom order?
A: Found an answer in this answer.
add_filter( 'get_terms_args', 'wpse_53094_sort_get_terms_args', 10, 2 );
function wpse_53094_sort_get_terms_args( $args, $taxonomies )
{
global $pagenow;
if( !is_admin() || ('post.php' != $pagenow && 'post-new.php' != $pagenow) )
return $args;
$args['orderby'] = 'slug';
$args['order'] = 'DESC';
return $args;
}
The order may be ASC or DESC, and the orderby can be:
*
*count
*description (it should, but didn't work so well for me, futher tests necessary)
*name
*slug
Plugins of interest
(may we call those Plinterests?)
The first two are very short and and can be easily incorporated into your code.
*
*Category Checklist Expander : expands the height of the category list, so no scrolling is needed
*Category Checklist Tree : this one rebuilds the Category Meta Box, so you can modify its code for further styling/adapting the box - and here's a screenshot of what it does
*Gecka Terms Ordering : creates an auxiliary table in the database (wp_termmeta) to deal with the ordering. Has drag and drop capabilities.
|
Q: How to Change the Categories Order in the Admin Dashboard? The order of categories on dashboard is alphabetical. Can I change it to custom order?
A: Found an answer in this answer.
add_filter( 'get_terms_args', 'wpse_53094_sort_get_terms_args', 10, 2 );
function wpse_53094_sort_get_terms_args( $args, $taxonomies )
{
global $pagenow;
if( !is_admin() || ('post.php' != $pagenow && 'post-new.php' != $pagenow) )
return $args;
$args['orderby'] = 'slug';
$args['order'] = 'DESC';
return $args;
}
The order may be ASC or DESC, and the orderby can be:
*
*count
*description (it should, but didn't work so well for me, futher tests necessary)
*name
*slug
Plugins of interest
(may we call those Plinterests?)
The first two are very short and and can be easily incorporated into your code.
*
*Category Checklist Expander : expands the height of the category list, so no scrolling is needed
*Category Checklist Tree : this one rebuilds the Category Meta Box, so you can modify its code for further styling/adapting the box - and here's a screenshot of what it does
*Gecka Terms Ordering : creates an auxiliary table in the database (wp_termmeta) to deal with the ordering. Has drag and drop capabilities.
A: Use the plugin Advanced Custom Fields (This plugin is handy in many different ways). Then create an custom order field (category_order) with the rule 'Taxanomy_Term' is equal to 'Categories'.
Then in your theme functions.php (or somewhere relevant) use:
$categories = get_categories( $args );
usort($categories, function($a, $b) {
return get_field("category_order", "category_".$a->term_id) - get_field("category_order", "category_".$b->term_id);
});
foreach ($categories as $category){
...
Where category_order is the field name you created with ACF.
This post inspired by this one here.
A: There's no default option for it, but there's two other ways.
*
*Change it in the theme files http://codex.wordpress.org/Template_Tags/wp_list_categories
*Use a plugin. Eg http://wordpress.org/extend/plugins/my-category-order/
|
wordpress
|
{
"language": "en",
"length": 293,
"provenance": "stackexchange_00019.jsonl.gz:420227",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53094"
}
|
[
0.060791015625,
0.006561279296875,
-0.029022216796875,
-0.057373046875,
0.0411376953125,
-0.043487548828125,
0.020599365234375,
0.00800323486328125,
-0.004657745361328125,
0.027984619140625,
-0.0210723876953125,
-0.043792724609375,
0.021026611328125,
-0.02520751953125,
-0.033935546875,
-0.057464599609375,
0.029876708984375,
0.0144805908203125,
0.03692626953125,
-0.00971221923828125,
0.0089263916015625,
0.016265869140625,
0.03314208984375,
0.036376953125,
0.0146026611328125,
-0.019439697265625,
0.048492431640625,
-0.04412841796875,
0.0157318115234375,
-0.036834716796875,
0.0189971923828125,
0.00865936279296875,
-0.018280029296875,
0.004207611083984375,
0.046661376953125,
-0.00054931640625,
0.037567138671875,
0.00591278076171875,
0.01323699951171875,
0.04296875,
0.043243408203125,
-0.029205322265625,
0.01568603515625,
0.029296875,
0.0019931793212890625,
-0.029876708984375,
0.038818359375,
-0.05377197265625,
0.0157623291015625,
-0.0489501953125,
0.00461578369140625,
0.003570556640625,
0.02911376953125,
-0.09503173828125,
-0.0156707763671875,
-0.01285552978515625,
-0.01279449462890625,
-0.00048089027404785156,
0.0182952880859375,
0.002185821533203125,
0.01168060302734375,
0.00870513916015625,
0.0080413818359375,
-0.0011997222900390625,
-0.0155181884765625,
-0.01323699951171875,
0.01381683349609375,
0.0107879638671875,
-0.026153564453125,
-0.01036834716796875,
0.0279388427734375,
-0.004940032958984375,
0.0161285400390625,
-0.02655029296875,
0.021240234375,
-0.00881195068359375,
0.005077362060546875,
-0.0145416259765625,
0.00923919677734375,
0.0162811279296875,
0.06439208984375,
0.02789306640625,
0.0299530029296875,
-0.00891876220703125,
-0.0115966796875,
-0.0277557373046875,
-0.005428314208984375,
-0.02227783203125,
-0.0238037109375,
-0.033935546875,
-0.00989532470703125,
-0.010589599609375,
-0.050048828125,
0.01007080078125,
-0.00618743896484375,
-0.0183563232421875,
0.00337982177734375,
0.048431396484375,
-0.019775390625,
-0.0134429931640625,
-0.0284881591796875,
0.00762939453125,
-0.01971435546875,
-0.0264129638671875,
-0.0070953369140625,
-0.0506591796875,
-0.0284881591796875,
0.006755828857421875,
0.047027587890625,
0.049560546875,
-0.03216552734375,
0.02496337890625,
-0.0192718505859375,
-0.0229339599609375,
-0.0010404586791992188,
0.0174407958984375,
-0.051422119140625,
0.034027099609375,
-0.005893707275390625,
0.0357666015625,
-0.0029296875,
0.02508544921875,
0.01509857177734375,
-0.0237884521484375,
-0.001117706298828125,
0.0025043487548828125,
-0.028961181640625,
-0.0266571044921875,
-0.047760009765625,
0.00862884521484375,
-0.032562255859375,
0.024444580078125,
0.0665283203125,
0.056793212890625,
0.00998687744140625,
-0.00910186767578125,
0.0374755859375,
-0.006351470947265625,
-0.0014314651489257812,
0.007312774658203125,
0.0196990966796875,
0.004459381103515625,
0.002384185791015625,
-0.01523590087890625,
0.0218658447265625,
0.00795745849609375,
-0.01065826416015625,
0.00759124755859375,
0.019378662109375,
-0.01543426513671875,
0.0193939208984375,
-0.06707763671875,
0.050689697265625,
0.01311492919921875,
-0.04034423828125,
0.020904541015625,
0.0214691162109375,
-0.005031585693359375,
-0.09356689453125,
-0.0401611328125,
-0.04241943359375,
-0.00904083251953125,
0.03814697265625,
-0.044830322265625,
-0.0335693359375,
0.0260009765625,
-0.039093017578125,
-0.0116119384765625,
0.0208740234375,
-0.0024700164794921875,
0.0321044921875,
-0.003082275390625,
0.005458831787109375,
0.0186309814453125,
0.018463134765625,
0.0178680419921875,
-0.021728515625,
-0.049835205078125,
0.0272064208984375,
0.005031585693359375,
-0.0293731689453125,
-0.025634765625,
-0.0211181640625,
0.00140380859375,
-0.06634521484375,
0.044769287109375,
0.0005464553833007812,
0.0648193359375,
0.0245361328125,
0.01058197021484375,
0.027862548828125,
0.0096588134765625,
-0.0633544921875,
0.0540771484375,
0.00551605224609375,
0.02392578125,
-0.0650634765625,
0.020721435546875,
-0.01387786865234375,
-0.043731689453125,
0.005878448486328125,
0.0343017578125,
-0.018707275390625,
0.00811004638671875,
-0.0280914306640625,
0.0077056884765625,
0.0037689208984375,
0.0367431640625,
0.046417236328125,
0.0165557861328125,
-0.007274627685546875,
-0.0257568359375,
-0.0161590576171875,
0.016143798828125,
-0.055084228515625,
-0.0184173583984375,
0.00878143310546875,
0.0022525787353515625,
-0.0284576416015625,
-0.019073486328125,
-0.010833740234375,
-0.05950927734375,
-0.0223541259765625,
0.07403564453125,
0.0374755859375,
0.01119232177734375,
-0.02703857421875,
-0.011077880859375,
0.0290679931640625,
0.02197265625,
-0.038787841796875,
0.032135009765625,
0.040924072265625,
0.07049560546875,
0.01386260986328125,
-0.005950927734375,
0.06781005859375,
-0.06396484375,
0.0244598388671875,
0.0185699462890625,
0.035675048828125,
-0.0292510986328125,
-0.0207672119140625,
0.007762908935546875,
0.035980224609375,
-0.036834716796875,
-0.003047943115234375,
0.00914764404296875,
-0.01161956787109375,
0.0648193359375,
0.0361328125,
0.055328369140625,
-0.00580596923828125,
0.0457763671875,
0.008819580078125,
0.022674560546875,
-0.004241943359375,
0.0021724700927734375,
-0.01526641845703125,
0.00753021240234375,
0.0005459785461425781,
-0.046905517578125,
-0.0423583984375,
-0.01427459716796875,
0.022308349609375,
-0.0019159317016601562,
0.028717041015625,
0.020965576171875,
-0.028594970703125,
-0.009918212890625,
0.01983642578125,
0.023956298828125,
0.0024509429931640625,
0.03424072265625,
0.0008950233459472656,
-0.0242767333984375,
-0.0186309814453125,
0.0009655952453613281,
-0.0187530517578125,
0.006244659423828125,
0.005420684814453125,
0.049652099609375,
-0.007518768310546875,
-0.007732391357421875,
-0.031585693359375,
-0.06768798828125,
0.00960540771484375,
0.036895751953125,
-0.07781982421875,
-0.0030307769775390625,
0.032318115234375,
0.002498626708984375,
-0.03887939453125,
-0.01556396484375,
-0.0186614990234375,
0.005062103271484375,
0.00565338134765625,
-0.01045989990234375,
0.0026645660400390625,
-0.004791259765625,
0.038726806640625,
0.06512451171875,
0.01898193359375,
0.0134735107421875,
-0.010009765625,
-0.00997161865234375,
-0.023345947265625,
0.0011014938354492188,
-0.0223541259765625,
-0.022705078125,
-0.0141448974609375,
0.049530029296875,
0.04150390625,
0.00453948974609375,
0.036590576171875,
-0.0200042724609375,
0.01482391357421875,
0.021026611328125,
-0.049224853515625,
-0.07708740234375,
-0.0214385986328125,
-0.020538330078125,
0.009979248046875,
0.0232696533203125,
-0.007251739501953125,
-0.01345062255859375,
0.0089569091796875,
0.00540924072265625,
0.01580810546875,
-0.0230560302734375,
-0.02008056640625,
-0.0240631103515625,
-0.041961669921875,
0.00824737548828125,
0.005615234375,
0.0009741783142089844,
0.01001739501953125,
0.05780029296875,
0.00269317626953125,
-0.0743408203125,
-0.0123138427734375,
0.0006690025329589844,
-0.0085906982421875,
0.02130126953125,
0.0341796875,
-0.062164306640625,
0.026092529296875,
0.00041413307189941406,
0.044281005859375,
0.035614013671875,
-0.0259857177734375,
0.0011577606201171875,
-0.0210723876953125,
0.0263671875,
0.015899658203125,
-0.032989501953125,
0.024444580078125,
0.0311431884765625,
-0.006282806396484375,
-0.01959228515625,
-0.01702880859375,
0.0214385986328125,
-0.0050506591796875,
-0.0267333984375,
-0.036651611328125,
-0.0084075927734375,
-0.004825592041015625,
0.0158233642578125,
0.01105499267578125,
0.0036830902099609375,
0.001495361328125,
-0.007106781005859375,
-0.0208587646484375,
-0.0111083984375,
0.00835418701171875,
0.0017461776733398438,
0.0017709732055664062,
-0.03302001953125,
-0.0209808349609375,
-0.01357269287109375,
0.01264190673828125,
-0.007965087890625,
0.021575927734375,
-0.005260467529296875,
-0.06024169921875,
0.0203857421875,
-0.076171875,
-0.001522064208984375,
-0.0284271240234375,
-0.004604339599609375,
0.025360107421875,
0.0838623046875,
-0.036865234375,
-0.01953125,
0.0236358642578125,
0.022064208984375,
-0.040863037109375,
-0.0084228515625,
-0.050628662109375,
-0.0262451171875,
-0.1063232421875,
-0.00568389892578125,
-0.00569915771484375,
-0.054931640625,
-0.0012464523315429688,
0.016326904296875,
-0.0723876953125,
-0.0291595458984375,
0.0416259765625,
-0.037445068359375,
-0.00023746490478515625,
0.00995635986328125,
-0.01043701171875,
-0.01129150390625,
-0.0279083251953125,
-0.0014581680297851562,
-0.04974365234375,
-0.0138397216796875,
-0.0328369140625,
0.050262451171875,
0.0177764892578125,
-0.007602691650390625,
-0.0167694091796875,
0.05615234375,
0.01274871826171875,
-0.0131072998046875,
0.01288604736328125,
0.0154876708984375,
-0.0168609619140625,
-0.0247039794921875,
-0.00927734375,
-0.045623779296875,
-0.03741455078125,
-0.022125244140625,
0.021148681640625,
0.03594970703125,
-0.01187896728515625,
0.00705718994140625,
-0.01221466064453125,
0.00803375244140625,
-0.0845947265625,
-0.0557861328125,
-0.053741455078125,
-0.0222625732421875,
-0.03363037109375,
-0.00844573974609375,
-0.031524658203125,
-0.09674072265625,
0.027099609375,
-0.005695343017578125,
-0.01149749755859375,
0.020294189453125,
0.03839111328125,
0.004924774169921875,
-0.01464080810546875,
-0.056396484375,
0.01045989990234375,
0.0230255126953125,
0.00881195068359375,
0.01067352294921875,
-0.0205078125,
-0.0240631103515625,
0.076171875,
-0.0267333984375,
-0.025421142578125,
-0.0038604736328125,
0.0439453125,
0.006011962890625,
-0.03570556640625,
0.017333984375,
-0.01361083984375,
0.0268707275390625,
0.006000518798828125,
-0.0007119178771972656,
-0.033233642578125,
-0.0201873779296875,
0.04400634765625,
0.0160369873046875,
0.0030117034912109375,
-0.05078125,
-0.0213470458984375,
0.01036834716796875,
-0.0177154541015625,
0.0242156982421875,
0.0170135498046875,
-0.00156402587890625,
0.0136871337890625,
0.0264434814453125,
0.0245513916015625,
0.004329681396484375,
-0.003688812255859375,
-0.035736083984375,
0.0221099853515625,
0.0263214111328125,
0.0028018951416015625,
0.024139404296875,
-0.00742340087890625,
0.055328369140625,
0.0144500732421875,
-0.0283966064453125,
-0.023834228515625,
-0.0201416015625,
0.035797119140625,
0.00850677490234375,
-0.01026153564453125,
0.0295562744140625,
-0.00717926025390625,
0.0207061767578125,
0.0059661865234375,
-0.1043701171875,
0.03759765625,
-0.0282745361328125,
0.019805908203125,
0.0269775390625,
-0.02789306640625,
-0.006622314453125,
0.0157623291015625,
0.005962371826171875,
-0.01194000244140625,
-0.001537322998046875,
-0.007480621337890625,
0.0462646484375,
-0.01084136962890625,
0.023040771484375,
-0.0025787353515625,
-0.007106781005859375,
-0.040985107421875,
0.058624267578125,
-0.024627685546875,
-0.028106689453125,
-0.0298004150390625,
0.003871917724609375,
-0.0292510986328125,
0.007442474365234375,
0.051361083984375,
0.025543212890625,
-0.02056884765625,
0.0213165283203125,
0.00982666015625,
-0.0206298828125,
-0.042449951171875,
-0.03424072265625,
-0.0013637542724609375,
0.0050811767578125,
-0.007335662841796875,
0.0199127197265625,
-0.0255584716796875,
0.041534423828125,
0.00702667236328125,
0.023590087890625,
-0.0019216537475585938,
-0.0194244384765625,
-0.05303955078125,
0.00014543533325195312,
0.00986480712890625,
-0.01568603515625,
-0.053955078125,
0.023895263671875,
-0.0260162353515625,
0.015655517578125,
-0.004650115966796875,
0.0677490234375,
-0.04058837890625,
-0.018951416015625,
-0.022003173828125,
0.01224517822265625,
0.0283203125,
0.005207061767578125,
-0.046112060546875,
-0.0149993896484375,
-0.051422119140625,
-0.0243682861328125,
-0.0357666015625,
-0.00946044921875,
-0.0421142578125,
0.01654052734375,
0.01715087890625,
0.0286865234375,
0.0008859634399414062,
-0.015380859375,
-0.02191162109375,
-0.00307464599609375,
0.02142333984375,
0.015167236328125,
-0.0038051605224609375,
0.04510498046875,
-0.012786865234375,
0.04046630859375,
-0.000568389892578125,
0.00469207763671875,
-0.00038242340087890625,
-0.0172882080078125,
-0.0162506103515625,
-0.07098388671875,
-0.027252197265625,
0.0138092041015625,
-0.04010009765625,
0.033905029296875,
0.007755279541015625,
0.00507354736328125,
0.032135009765625,
0.011932373046875,
0.0094757080078125,
0.0009822845458984375,
-0.054534912109375,
0.012847900390625,
0.01050567626953125,
0.0294189453125,
-0.01995849609375,
0.032562255859375,
0.0022106170654296875,
-0.041839599609375,
0.05096435546875,
-0.00438690185546875,
0.043853759765625,
0.010986328125,
-0.0562744140625,
0.04144287109375,
0.0278778076171875,
0.05169677734375,
0.032440185546875,
-0.0093994140625,
0.0452880859375,
-0.036346435546875,
0.0021915435791015625,
0.060211181640625,
-0.00525665283203125,
0.046112060546875,
-0.0148773193359375,
-0.01195526123046875,
0.0178375244140625,
-0.044677734375,
-0.005077362060546875,
0.0054931640625,
0.03216552734375,
-0.061431884765625,
0.028472900390625,
0.027252197265625,
0.043792724609375,
0.03900146484375,
0.0103607177734375,
-0.032012939453125,
-0.008941650390625,
0.0252685546875,
-0.0750732421875,
-0.044830322265625,
0.002513885498046875,
-0.0173187255859375,
-0.017425537109375,
0.01027679443359375,
0.013580322265625,
0.016448974609375,
-0.01065826416015625,
-0.01226806640625,
-0.00007170438766479492,
0.0122833251953125,
-0.0294342041015625,
0.027618408203125,
0.02447509765625,
0.0163726806640625,
-0.051849365234375,
0.0538330078125,
-0.003589630126953125,
-0.0131378173828125,
0.010101318359375,
-0.01824951171875,
0.0214691162109375,
0.007183074951171875,
0.0005764961242675781,
-0.01427459716796875,
-0.0252838134765625,
-0.01200103759765625,
0.034027099609375,
0.01461029052734375,
-0.0113067626953125,
-0.00905609130859375,
0.00872802734375,
-0.00722503662109375,
-0.0174560546875,
0.001934051513671875,
-0.03204345703125,
-0.05523681640625,
0.051727294921875,
-0.027252197265625,
0.0014934539794921875,
0.015716552734375,
0.061126708984375,
-0.00778961181640625,
-0.00439453125,
0.0300140380859375,
-0.05975341796875,
-0.038177490234375,
0.022186279296875,
-0.0543212890625,
-0.0309295654296875,
-0.003536224365234375,
-0.06976318359375,
0.051666259765625,
0.0063323974609375,
0.00937652587890625,
-0.03424072265625,
0.0226287841796875,
-0.006031036376953125,
0.01226806640625,
-0.0276336669921875,
0.060516357421875,
0.022247314453125,
0.02734375,
-0.0712890625,
-0.020751953125,
-0.0027923583984375,
0.046112060546875,
0.0180816650390625,
-0.0029430389404296875,
-0.045562744140625,
0.01074981689453125,
0.0606689453125,
0.050750732421875,
0.028076171875,
0.0284576416015625,
0.0019588470458984375,
0.053131103515625,
0.00525665283203125,
-0.0116729736328125,
0.03558349609375,
0.0089263916015625,
-0.07330322265625,
0.04766845703125,
0.0260162353515625,
0.045745849609375,
-0.03399658203125,
0.007251739501953125,
-0.0185394287109375,
-0.02099609375,
0.0255126953125,
-0.009063720703125,
0.01806640625,
0.048309326171875,
0.00791168212890625,
-0.063232421875,
-0.05419921875,
-0.030426025390625,
0.03515625,
-0.034454345703125,
0.048919677734375,
0.0280914306640625,
0.0241546630859375,
0.0201263427734375,
-0.0016241073608398438,
0.03558349609375,
0.0269012451171875,
-0.046844482421875,
0.042449951171875,
0.0005083084106445312,
0.013702392578125,
-0.046173095703125,
0.02374267578125,
0.041046142578125,
0.062255859375,
-0.046478271484375,
-0.0654296875,
0.00873565673828125,
-0.004772186279296875,
0.01690673828125,
-0.0025997161865234375,
-0.0228271484375,
-0.02130126953125,
0.04376220703125,
-0.060272216796875,
-0.0020351409912109375,
0.03790283203125,
0.042144775390625,
-0.005443572998046875,
-0.0181732177734375,
-0.04193115234375,
-0.046051025390625,
-0.036376953125,
0.0316162109375,
0.012969970703125,
0.035064697265625,
0.0006184577941894531,
0.05364990234375,
-0.0300140380859375,
-0.0157012939453125,
-0.0328369140625,
0.0159454345703125,
-0.007801055908203125,
0.0277099609375,
-0.048919677734375,
-0.02294921875,
-0.0070953369140625,
0.03692626953125,
-0.01079559326171875,
-0.026153564453125,
0.0022869110107421875,
0.058502197265625,
0.03924560546875,
-0.0249481201171875,
0.0296478271484375,
0.0082244873046875,
-0.0159759521484375,
-0.0362548828125,
0.0518798828125,
0.0423583984375,
0.03253173828125,
-0.00365447998046875,
0.04644775390625,
0.0545654296875,
-0.0157623291015625,
0.040771484375,
-0.0007147789001464844,
-0.0075531005859375,
0.010284423828125,
-0.0271759033203125,
0.056396484375,
0.0286712646484375,
-0.0673828125,
-0.0166778564453125,
-0.026580810546875,
-0.039520263671875,
0.0191192626953125,
0.0450439453125,
0.0025539398193359375,
-0.0024204254150390625,
-0.038970947265625,
-0.05010986328125,
-0.0172271728515625,
0.019622802734375,
0.027587890625,
-0.0081787109375,
-0.0283355712890625,
-0.0239715576171875,
-0.037322998046875,
-0.01342010498046875,
0.01161956787109375,
0.0156402587890625,
-0.0122528076171875,
0.02374267578125,
0.0086822509765625,
0.0144805908203125,
-0.053924560546875,
-0.01885986328125,
-0.042816162109375,
-0.054931640625,
0.07061767578125,
-0.0278167724609375,
-0.04620361328125,
0.0093536376953125,
-0.018463134765625,
-0.018890380859375,
0.0626220703125,
-0.05340576171875,
0.0004589557647705078,
-0.03533935546875,
0.0232086181640625,
-0.05780029296875,
0.0153656005859375,
-0.0189056396484375,
-0.031341552734375,
-0.016815185546875,
-0.0180816650390625,
0.006977081298828125,
0.047454833984375,
0.040679931640625,
-0.01059722900390625,
0.0005540847778320312,
-0.0193328857421875,
0.0084228515625,
0.021209716796875,
0.0257568359375,
0.05181884765625,
-0.033416748046875,
0.00762939453125,
0.0191192626953125,
-0.02154541015625,
0.03265380859375,
0.007648468017578125,
0.0007634162902832031,
0.025390625,
-0.048370361328125,
-0.006221771240234375,
0.030670166015625,
0.021881103515625,
-0.0318603515625,
0.005588531494140625,
0.033172607421875,
-0.0272674560546875,
-0.0294189453125,
-0.014373779296875,
-0.0516357421875,
-0.01143646240234375,
0.0247802734375,
0.017364501953125,
0.04144287109375,
-0.026947021484375,
-0.03240966796875,
0.0301513671875,
0.06292724609375,
-0.0002994537353515625,
-0.0259246826171875,
0.0214996337890625,
-0.042266845703125,
0.0200347900390625,
0.035247802734375,
-0.041839599609375,
0.01097869873046875,
0.00022017955780029297,
-0.036834716796875,
0.01076507568359375,
-0.0401611328125,
-0.03314208984375,
-0.03045654296875,
-0.005435943603515625,
-0.0126495361328125,
-0.004199981689453125,
0.0056610107421875,
0.00374603271484375,
-0.00009530782699584961,
0.0411376953125,
0.05029296875,
0.0030994415283203125,
0.019927978515625,
0.035308837890625,
-0.055145263671875,
-0.08038330078125,
0.00572967529296875,
-0.0158538818359375,
0.01849365234375,
0.0150146484375,
0.00760650634765625,
0.038604736328125,
-0.031890869140625,
-0.1044921875,
0.0279998779296875,
-0.0141754150390625,
-0.047393798828125,
-0.037628173828125,
-0.005565643310546875,
-0.0169525146484375,
0.015594482421875,
0.0028743743896484375,
-0.03302001953125,
-0.024505615234375,
0.0321044921875,
0.0235137939453125,
0.052642822265625,
0.0160369873046875,
0.041748046875,
-0.051849365234375,
0.00411224365234375,
-0.038665771484375,
0.0196075439453125,
-0.035980224609375,
-0.0008287429809570312,
0.01224517822265625,
0.0194244384765625,
-0.02197265625,
-0.037017822265625,
0.0301055908203125,
0.0242462158203125,
-0.001728057861328125,
-0.08343505859375,
-0.0311126708984375,
-0.04107666015625,
0.037384033203125,
0.0191192626953125,
-0.0010213851928710938,
-0.0161895751953125,
-0.04412841796875,
-0.0284271240234375,
0.041168212890625,
-0.04254150390625,
0.00746917724609375,
-0.1041259765625,
-0.036041259765625,
0.0240936279296875,
0.0002334117889404297,
0.01229095458984375,
-0.0016345977783203125,
-0.0167694091796875,
-0.004932403564453125,
0.01540374755859375,
0.003757476806640625,
-0.06781005859375,
-0.002376556396484375,
-0.0032711029052734375,
-0.04071044921875,
-0.0673828125,
-0.01617431640625,
0.01531982421875,
-0.06298828125,
-0.047698974609375,
-0.059906005859375,
-0.019989013671875,
0.0015697479248046875,
0.041748046875,
-0.023529052734375,
0.0130157470703125,
-0.0276031494140625,
0.0296173095703125,
-0.0118255615234375,
0.003131866455078125,
0.0088653564453125,
-0.022064208984375,
-0.0408935546875,
0.044158935546875,
0.026702880859375,
0.056854248046875,
-0.0056304931640625,
0.0083770751953125,
-0.0022220611572265625,
0.0214080810546875,
0.0131988525390625,
-0.024627685546875,
0.0528564453125,
-0.041473388671875,
0.0164947509765625,
-0.004573822021484375,
0.01485443115234375,
0.02960205078125,
-0.0206146240234375,
-0.0361328125,
-0.026580810546875,
0.005252838134765625
] |
946f4f3fa4c7947341473a3400edacf40562bb17
|
Wordpress Stackexchange
Q: What is the "with_front" rewrite key? I have the following line in a register_post_type function:
'rewrite' => array('slug' => 'Newsletters', 'with_front' => false),
I understand what the line does in general (adds "newsletters" to the slug) but I don't specifically understand what the 'with_front' part does. I have to admit, I don't really have a problem that needs solving, but I'm suddenly curious....
A: From the Codex ...
Should the permastruct be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true
|
Q: What is the "with_front" rewrite key? I have the following line in a register_post_type function:
'rewrite' => array('slug' => 'Newsletters', 'with_front' => false),
I understand what the line does in general (adds "newsletters" to the slug) but I don't specifically understand what the 'with_front' part does. I have to admit, I don't really have a problem that needs solving, but I'm suddenly curious....
A: From the Codex ...
Should the permastruct be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true
|
wordpress
|
{
"language": "en",
"length": 95,
"provenance": "stackexchange_00019.jsonl.gz:420254",
"question_score": "38",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53190"
}
|
[
-0.00353240966796875,
-0.0261077880859375,
0.00601959228515625,
-0.04180908203125,
-0.0308990478515625,
0.010162353515625,
-0.0081329345703125,
-0.001758575439453125,
0.00817108154296875,
0.00734710693359375,
-0.003482818603515625,
-0.00400543212890625,
-0.00760650634765625,
-0.035125732421875,
0.0030498504638671875,
-0.00734710693359375,
0.0272216796875,
-0.06134033203125,
0.0017108917236328125,
0.0053558349609375,
0.0128326416015625,
0.006622314453125,
0.037445068359375,
-0.0162811279296875,
0.01097869873046875,
-0.002063751220703125,
0.061065673828125,
-0.050872802734375,
0.01297760009765625,
-0.02838134765625,
0.020172119140625,
0.0163421630859375,
0.0233917236328125,
0.01055908203125,
-0.01232147216796875,
0.005077362060546875,
-0.00917816162109375,
0.00800323486328125,
0.0140380859375,
0.0103759765625,
0.01340484619140625,
-0.0088958740234375,
0.0268707275390625,
0.0225677490234375,
0.0113677978515625,
-0.030303955078125,
0.018402099609375,
-0.076904296875,
-0.0199127197265625,
0.0304107666015625,
-0.00910186767578125,
0.0200653076171875,
-0.0013751983642578125,
0.017242431640625,
0.029632568359375,
-0.0027103424072265625,
-0.0249481201171875,
-0.019134521484375,
0.01255035400390625,
0.0489501953125,
0.00988006591796875,
0.0211181640625,
-0.0123138427734375,
-0.032562255859375,
-0.0178985595703125,
0.00617218017578125,
-0.02716064453125,
0.025054931640625,
-0.036590576171875,
-0.02667236328125,
0.007747650146484375,
-0.039337158203125,
0.012451171875,
-0.043212890625,
-0.018798828125,
0.03302001953125,
-0.016357421875,
-0.0037631988525390625,
0.02337646484375,
-0.01485443115234375,
-0.01203155517578125,
0.00887298583984375,
-0.034088134765625,
-0.033721923828125,
0.0196075439453125,
-0.0194854736328125,
-0.019683837890625,
0.00405120849609375,
-0.0297393798828125,
-0.0277862548828125,
-0.0165863037109375,
-0.041259765625,
-0.026702880859375,
0.0101165771484375,
-0.016876220703125,
-0.0198516845703125,
0.051055908203125,
0.0312347412109375,
0.0318603515625,
-0.01128387451171875,
0.0189361572265625,
-0.0673828125,
0.0098724365234375,
-0.0233154296875,
0.0152130126953125,
0.0115814208984375,
-0.004383087158203125,
0.01090240478515625,
0.03375244140625,
-0.0016345977783203125,
-0.039764404296875,
0.03741455078125,
-0.0282745361328125,
-0.01849365234375,
-0.02935791015625,
0.011016845703125,
-0.07281494140625,
0.030364990234375,
0.0033473968505859375,
0.04827880859375,
0.00033664703369140625,
0.04193115234375,
-0.00020360946655273438,
-0.0235748291015625,
-0.00310516357421875,
-0.002079010009765625,
0.0135498046875,
-0.06842041015625,
-0.0023021697998046875,
0.0982666015625,
-0.0194091796875,
-0.00461578369140625,
0.0550537109375,
-0.005718231201171875,
-0.0258636474609375,
-0.043365478515625,
-0.01473236083984375,
-0.024749755859375,
-0.032867431640625,
0.0196380615234375,
-0.0234375,
-0.0657958984375,
-0.004024505615234375,
-0.0037746429443359375,
0.0126495361328125,
0.006153106689453125,
0.004070281982421875,
0.0272369384765625,
-0.0147857666015625,
0.01067352294921875,
0.001972198486328125,
-0.01491546630859375,
0.04266357421875,
0.021026611328125,
-0.01116180419921875,
0.0233612060546875,
0.0284881591796875,
-0.00919342041015625,
-0.0572509765625,
-0.0293121337890625,
0.016571044921875,
-0.032196044921875,
-0.0168914794921875,
-0.0914306640625,
-0.1058349609375,
0.051025390625,
-0.09368896484375,
-0.016448974609375,
0.0197601318359375,
0.004634857177734375,
0.05902099609375,
-0.0159149169921875,
-0.0012483596801757812,
0.006984710693359375,
-0.01137542724609375,
-0.00362396240234375,
0.01261138916015625,
0.0229949951171875,
0.0097198486328125,
0.08489990234375,
0.0279388427734375,
-0.0210418701171875,
0.0423583984375,
-0.0283660888671875,
-0.06536865234375,
0.05767822265625,
0.0174102783203125,
0.07354736328125,
-0.0048828125,
0.01421356201171875,
0.0220794677734375,
0.0369873046875,
-0.005146026611328125,
-0.014739990234375,
-0.017486572265625,
-0.04241943359375,
0.03948974609375,
-0.0006976127624511719,
-0.0128326416015625,
0.022125244140625,
0.0228424072265625,
0.0180511474609375,
0.030517578125,
-0.0303802490234375,
-0.048858642578125,
0.0229949951171875,
-0.0264892578125,
0.0396728515625,
-0.0246429443359375,
0.0238494873046875,
0.0347900390625,
0.0113372802734375,
-0.042236328125,
-0.01474761962890625,
-0.0089874267578125,
0.004436492919921875,
-0.015777587890625,
0.0013666152954101562,
-0.00754547119140625,
0.037322998046875,
0.00666046142578125,
-0.0272369384765625,
-0.00563812255859375,
-0.0123443603515625,
0.050140380859375,
-0.0260467529296875,
-0.0109405517578125,
-0.03961181640625,
-0.007770538330078125,
-0.0174560546875,
-0.0660400390625,
0.056671142578125,
0.024688720703125,
0.005096435546875,
-0.03363037109375,
0.0283966064453125,
0.01508331298828125,
-0.0171661376953125,
-0.0296783447265625,
0.0284576416015625,
0.021148681640625,
0.060943603515625,
-0.01641845703125,
0.00757598876953125,
0.053955078125,
-0.0173797607421875,
0.0085296630859375,
0.0015134811401367188,
0.017608642578125,
0.068115234375,
0.0026950836181640625,
0.0160369873046875,
0.00415802001953125,
-0.037384033203125,
-0.005176544189453125,
0.0283050537109375,
0.0117340087890625,
-0.01276397705078125,
0.01279449462890625,
0.01207733154296875,
0.018768310546875,
0.0265350341796875,
-0.033111572265625,
0.0197906494140625,
-0.022125244140625,
-0.006072998046875,
-0.0002810955047607422,
-0.000888824462890625,
0.0086822509765625,
-0.021148681640625,
0.0177001953125,
0.0204315185546875,
-0.0002009868621826172,
0.039764404296875,
0.049835205078125,
-0.0198516845703125,
-0.0164031982421875,
0.0012693405151367188,
-0.002559661865234375,
0.0099029541015625,
-0.039215087890625,
-0.022735595703125,
-0.0024280548095703125,
-0.006153106689453125,
-0.0119171142578125,
-0.0479736328125,
0.033294677734375,
-0.016082763671875,
0.036163330078125,
0.02099609375,
0.0159759521484375,
0.05303955078125,
-0.00206756591796875,
0.03753662109375,
0.031494140625,
-0.003429412841796875,
-0.048309326171875,
-0.0233154296875,
0.03643798828125,
-0.044342041015625,
0.0174560546875,
0.0567626953125,
-0.0025043487548828125,
0.00118255615234375,
0.017974853515625,
-0.00991058349609375,
0.023162841796875,
0.01071929931640625,
-0.0081024169921875,
-0.017669677734375,
-0.060302734375,
-0.018951416015625,
0.03399658203125,
0.06903076171875,
0.0011339187622070312,
-0.0333251953125,
0.00878143310546875,
0.0662841796875,
-0.01556396484375,
-0.0163726806640625,
0.0003516674041748047,
-0.033782958984375,
-0.020263671875,
0.017303466796875,
-0.01373291015625,
-0.0014743804931640625,
0.04571533203125,
-0.0018186569213867188,
-0.004253387451171875,
-0.01192474365234375,
-0.0655517578125,
-0.049835205078125,
-0.06939697265625,
0.0230712890625,
-0.0094757080078125,
0.0265045166015625,
0.01169586181640625,
0.019134521484375,
0.0172119140625,
0.00795745849609375,
0.06402587890625,
0.0435791015625,
-0.0167388916015625,
-0.004119873046875,
0.007152557373046875,
-0.0231475830078125,
-0.0200042724609375,
0.0005755424499511719,
0.0000762939453125,
0.0159454345703125,
-0.004566192626953125,
-0.0051422119140625,
-0.003688812255859375,
-0.072509765625,
-0.0015392303466796875,
0.063232421875,
0.01166534423828125,
-0.0254058837890625,
0.04132080078125,
-0.052154541015625,
-0.036346435546875,
-0.0030345916748046875,
-0.043365478515625,
-0.06207275390625,
0.03753662109375,
0.006683349609375,
-0.046783447265625,
-0.0005207061767578125,
0.034515380859375,
0.0033588409423828125,
0.03912353515625,
-0.0239105224609375,
0.0291748046875,
0.009033203125,
0.040069580078125,
-0.07891845703125,
0.040496826171875,
0.00922393798828125,
0.007106781005859375,
0.022430419921875,
0.037200927734375,
-0.006534576416015625,
0.0081024169921875,
-0.051177978515625,
-0.06689453125,
0.033721923828125,
-0.052001953125,
-0.0022411346435546875,
-0.052581787109375,
-0.015960693359375,
-0.01824951171875,
0.054656982421875,
0.032623291015625,
-0.0133209228515625,
-0.0179290771484375,
-0.0175323486328125,
-0.0025653839111328125,
-0.00952911376953125,
-0.006427764892578125,
0.0001246929168701172,
-0.02337646484375,
-0.0132904052734375,
-0.0276336669921875,
-0.0018444061279296875,
-0.01019287109375,
-0.041473388671875,
0.0035247802734375,
-0.034881591796875,
0.040283203125,
-0.00641632080078125,
-0.02447509765625,
0.05621337890625,
-0.01149749755859375,
0.0098114013671875,
-0.053375244140625,
0.0078887939453125,
-0.035064697265625,
-0.010223388671875,
0.0169830322265625,
0.030120849609375,
-0.00341796875,
-0.0343017578125,
0.006084442138671875,
0.059326171875,
0.0234527587890625,
-0.056427001953125,
0.0222015380859375,
-0.016265869140625,
-0.01393890380859375,
0.02117919921875,
-0.00403594970703125,
-0.01009368896484375,
0.0221710205078125,
0.0283966064453125,
-0.043975830078125,
0.0029468536376953125,
-0.021453857421875,
0.00591278076171875,
0.055450439453125,
-0.06500244140625,
-0.0106048583984375,
0.006351470947265625,
-0.0017337799072265625,
0.021820068359375,
0.011016845703125,
-0.01264190673828125,
-0.005229949951171875,
-0.011260986328125,
-0.0065155029296875,
-0.0108489990234375,
-0.03399658203125,
0.024169921875,
0.0697021484375,
0.03204345703125,
0.001712799072265625,
0.008697509765625,
-0.01751708984375,
0.054595947265625,
0.01273345947265625,
0.01410675048828125,
0.046234130859375,
-0.02032470703125,
-0.0033168792724609375,
0.03564453125,
-0.0189056396484375,
-0.0259857177734375,
0.06719970703125,
0.017059326171875,
0.0017404556274414062,
0.009521484375,
-0.039642333984375,
0.054168701171875,
-0.0146636962890625,
-0.004306793212890625,
0.004444122314453125,
-0.01447296142578125,
0.016326904296875,
0.0245208740234375,
0.0237579345703125,
-0.01499176025390625,
0.0006947517395019531,
0.0014581680297851562,
0.0271759033203125,
0.0220947265625,
0.0377197265625,
-0.006275177001953125,
-0.022430419921875,
-0.021759033203125,
0.009307861328125,
-0.00887298583984375,
-0.02239990234375,
-0.0160675048828125,
0.0113677978515625,
-0.004703521728515625,
-0.0014181137084960938,
-0.016448974609375,
0.003284454345703125,
0.07293701171875,
-0.042572021484375,
-0.04412841796875,
-0.044464111328125,
-0.04144287109375,
-0.0098114013671875,
0.058197021484375,
-0.0020885467529296875,
0.043212890625,
-0.0016813278198242188,
-0.0330810546875,
0.0139923095703125,
0.0015621185302734375,
-0.027099609375,
-0.03955078125,
0.049957275390625,
0.0090484619140625,
-0.002201080322265625,
-0.003368377685546875,
0.0246124267578125,
0.01532745361328125,
-0.008056640625,
0.00293731689453125,
-0.0008912086486816406,
0.0175628662109375,
0.00507354736328125,
0.0362548828125,
0.012176513671875,
0.000453948974609375,
-0.01201629638671875,
0.0312042236328125,
-0.04412841796875,
0.03564453125,
0.051025390625,
0.0267486572265625,
0.0012617111206054688,
-0.036895751953125,
-0.00942230224609375,
-0.0244903564453125,
-0.033935546875,
0.040679931640625,
0.00034117698669433594,
-0.041290283203125,
-0.0225830078125,
-0.02069091796875,
0.010528564453125,
-0.0187835693359375,
0.0187835693359375,
0.0298309326171875,
0.003509521484375,
0.006549835205078125,
0.05059814453125,
-0.01418304443359375,
-0.036376953125,
-0.0170745849609375,
0.0204620361328125,
-0.0033359527587890625,
0.0092315673828125,
-0.0132598876953125,
-0.006938934326171875,
-0.02716064453125,
-0.013031005859375,
0.048828125,
0.0005340576171875,
0.020050048828125,
-0.0169830322265625,
0.00542449951171875,
0.0038700103759765625,
0.0008149147033691406,
0.041778564453125,
-0.004535675048828125,
-0.0511474609375,
-0.005931854248046875,
-0.049224853515625,
0.00887298583984375,
0.01241302490234375,
-0.019622802734375,
-0.0192108154296875,
-0.0010242462158203125,
-0.0245361328125,
0.034942626953125,
-0.0124359130859375,
0.01010894775390625,
-0.0299835205078125,
-0.0013332366943359375,
-0.00972747802734375,
0.041961669921875,
0.004337310791015625,
0.0108184814453125,
-0.046600341796875,
0.0174407958984375,
-0.046722412109375,
-0.039825439453125,
-0.036773681640625,
0.0164794921875,
-0.029876708984375,
-0.060272216796875,
-0.00098419189453125,
0.038543701171875,
-0.037017822265625,
0.03656005859375,
0.046173095703125,
0.01049041748046875,
0.02008056640625,
0.0007443428039550781,
0.0001862049102783203,
-0.01457977294921875,
0.015777587890625,
-0.007167816162109375,
0.0287628173828125,
0.01410675048828125,
0.01110076904296875,
0.056121826171875,
-0.0243072509765625,
0.0026607513427734375,
-0.031646728515625,
-0.0196380615234375,
0.0065460205078125,
0.01397705078125,
-0.0183258056640625,
0.0272674560546875,
0.087646484375,
0.0214385986328125,
0.07208251953125,
0.051116943359375,
0.022674560546875,
0.0340576171875,
-0.00725555419921875,
-0.032012939453125,
0.035400390625,
0.032562255859375,
0.010162353515625,
0.04010009765625,
0.03533935546875,
0.015045166015625,
0.01244354248046875,
0.06878662109375,
0.08837890625,
-0.07757568359375,
-0.00445556640625,
0.0266265869140625,
0.0176544189453125,
0.031524658203125,
0.0309600830078125,
0.011199951171875,
0.030059814453125,
-0.0086822509765625,
-0.0108642578125,
0.00841522216796875,
0.025299072265625,
0.029510498046875,
-0.0243682861328125,
-0.00902557373046875,
0.0229949951171875,
0.006175994873046875,
0.020721435546875,
-0.0203704833984375,
-0.0106964111328125,
-0.0106964111328125,
-0.03106689453125,
0.005573272705078125,
0.01116180419921875,
-0.0513916015625,
-0.025848388671875,
0.023468017578125,
0.0270233154296875,
0.0101165771484375,
0.01474761962890625,
-0.02850341796875,
-0.0305938720703125,
-0.0034008026123046875,
-0.0426025390625,
0.01068878173828125,
-0.02410888671875,
-0.0274505615234375,
-0.005596160888671875,
-0.0207672119140625,
0.0179443359375,
-0.00939178466796875,
-0.0034503936767578125,
0.0210723876953125,
-0.01374053955078125,
-0.04693603515625,
-0.024810791015625,
-0.059234619140625,
0.07012939453125,
-0.0596923828125,
0.0019779205322265625,
-0.0196075439453125,
0.0279541015625,
0.03204345703125,
-0.0281219482421875,
0.0161590576171875,
-0.03594970703125,
-0.0028629302978515625,
-0.0239410400390625,
-0.025421142578125,
-0.01213836669921875,
-0.054107666015625,
-0.0745849609375,
0.12091064453125,
-0.0239105224609375,
0.0335693359375,
-0.004901885986328125,
0.046173095703125,
-0.00197601318359375,
0.0181121826171875,
-0.0006146430969238281,
0.0355224609375,
-0.01544952392578125,
0.0263519287109375,
-0.037078857421875,
-0.004726409912109375,
0.006900787353515625,
0.04632568359375,
0.11212158203125,
0.0238494873046875,
-0.0313720703125,
-0.00341796875,
0.06939697265625,
0.045867919921875,
-0.01140594482421875,
0.02911376953125,
-0.026885986328125,
0.0139312744140625,
0.01267242431640625,
-0.041351318359375,
0.00743865966796875,
0.005771636962890625,
-0.046356201171875,
0.0084991455078125,
0.0056915283203125,
0.022003173828125,
0.00919342041015625,
0.049713134765625,
0.0028533935546875,
-0.01971435546875,
0.035736083984375,
-0.06414794921875,
0.01352691650390625,
0.0018520355224609375,
-0.0029506683349609375,
-0.02886962890625,
0.019256591796875,
-0.03448486328125,
0.030364990234375,
-0.030792236328125,
0.017730712890625,
0.0255889892578125,
0.023223876953125,
0.05169677734375,
0.005619049072265625,
0.010986328125,
0.03204345703125,
-0.004032135009765625,
0.037109375,
0.027252197265625,
0.0234375,
-0.0423583984375,
-0.04693603515625,
0.045623779296875,
0.06939697265625,
-0.02423095703125,
-0.01476287841796875,
0.01001739501953125,
0.003025054931640625,
-0.00848388671875,
-0.0279693603515625,
-0.0214691162109375,
-0.03338623046875,
-0.00199127197265625,
-0.07733154296875,
0.005462646484375,
0.033721923828125,
0.0501708984375,
-0.032806396484375,
-0.048065185546875,
-0.02349853515625,
-0.0261688232421875,
-0.08465576171875,
0.050323486328125,
0.0021820068359375,
0.061309814453125,
0.01419830322265625,
0.0156402587890625,
0.010711669921875,
-0.0238800048828125,
-0.0131378173828125,
0.02069091796875,
0.0012922286987304688,
0.00455474853515625,
-0.0218353271484375,
-0.003749847412109375,
-0.0161590576171875,
0.01776123046875,
0.05145263671875,
0.014678955078125,
0.0016851425170898438,
-0.0283660888671875,
0.007015228271484375,
0.0302581787109375,
0.014404296875,
-0.0174407958984375,
0.0240325927734375,
-0.039276123046875,
0.049652099609375,
0.0160675048828125,
0.000370025634765625,
-0.022857666015625,
0.01140594482421875,
0.052947998046875,
-0.003040313720703125,
0.0462646484375,
-0.008758544921875,
0.006412506103515625,
0.039337158203125,
0.019927978515625,
0.0477294921875,
0.035186767578125,
-0.03570556640625,
0.009674072265625,
-0.042205810546875,
-0.10760498046875,
0.0285186767578125,
0.060272216796875,
-0.0196533203125,
-0.00827789306640625,
-0.0180511474609375,
0.01171875,
0.032684326171875,
-0.046356201171875,
-0.0014028549194335938,
0.0163421630859375,
0.0023975372314453125,
0.0023040771484375,
-0.04656982421875,
0.0010585784912109375,
0.0168304443359375,
-0.02587890625,
-0.023956298828125,
0.1124267578125,
0.01491546630859375,
-0.031036376953125,
0.025909423828125,
0.01308441162109375,
0.0178070068359375,
-0.00399017333984375,
0.01134490966796875,
0.0108642578125,
0.0285186767578125,
-0.0180511474609375,
-0.034576416015625,
-0.004566192626953125,
0.06317138671875,
-0.048919677734375,
0.0075225830078125,
-0.0208282470703125,
0.0203094482421875,
-0.051361083984375,
-0.008514404296875,
-0.03338623046875,
-0.06256103515625,
-0.04248046875,
0.01934814453125,
-0.0011739730834960938,
-0.018768310546875,
-0.048248291015625,
0.03448486328125,
0.0211029052734375,
-0.0467529296875,
0.0099029541015625,
-0.06732177734375,
0.030975341796875,
0.0299072265625,
0.026641845703125,
-0.0066375732421875,
0.0151824951171875,
-0.0181121826171875,
0.0157470703125,
0.0114593505859375,
0.0228271484375,
0.03363037109375,
-0.015777587890625,
0.015625,
0.0185546875,
0.027069091796875,
-0.007160186767578125,
0.006244659423828125,
-0.0005626678466796875,
-0.0208892822265625,
0.027252197265625,
0.01349639892578125,
0.00605010986328125,
-0.0290374755859375,
-0.05645751953125,
-0.005126953125,
-0.0548095703125,
-0.047515869140625,
-0.006587982177734375,
0.03466796875,
0.017242431640625,
-0.041778564453125,
-0.0240936279296875,
-0.0009360313415527344,
-0.06671142578125,
0.08721923828125,
-0.058929443359375,
0.01177978515625,
-0.004276275634765625,
0.00909423828125,
-0.0362548828125,
-0.00909423828125,
-0.052947998046875,
0.014373779296875,
-0.0164794921875,
0.0131683349609375,
0.0278778076171875,
-0.00884246826171875,
0.00498199462890625,
-0.01611328125,
-0.01125335693359375,
0.0428466796875,
-0.043975830078125,
-0.01849365234375,
0.02984619140625,
-0.00905609130859375,
-0.0096588134765625,
-0.0526123046875,
-0.006633758544921875,
-0.067626953125,
-0.01265716552734375,
0.0178985595703125,
-0.05279541015625,
-0.045501708984375,
-0.0618896484375,
-0.035675048828125,
0.05810546875,
0.0157928466796875,
-0.0247344970703125,
-0.04376220703125,
-0.0577392578125,
0.002986907958984375,
0.04095458984375,
-0.01157379150390625,
-0.0213775634765625,
-0.07672119140625,
0.0198974609375,
0.003017425537109375,
0.049896240234375,
0.005340576171875,
0.01715087890625,
-0.011749267578125,
0.0204315185546875,
0.006389617919921875,
-0.01404571533203125,
-0.0011072158813476562,
0.006824493408203125,
0.038543701171875,
0.07305908203125,
-0.0018587112426757812,
0.05633544921875,
0.006656646728515625,
-0.04449462890625,
-0.01177978515625,
-0.030242919921875,
0.01082611083984375,
-0.003753662109375,
0.0743408203125,
-0.031402587890625,
0.01432037353515625,
-0.025299072265625,
-0.038909912109375,
-0.043426513671875,
-0.004364013671875,
0.00942230224609375,
0.01605224609375,
-0.043304443359375,
0.0186004638671875,
0.0023746490478515625,
-0.0128936767578125,
-0.0292510986328125,
-0.038543701171875,
-0.03948974609375,
-0.00772857666015625,
-0.01727294921875,
0.0185546875,
0.02862548828125,
0.005336761474609375,
0.06561279296875,
-0.038116455078125,
-0.0008482933044433594,
-0.0020503997802734375,
0.01358795166015625,
0.01042938232421875,
-0.0299224853515625,
0.01515960693359375,
0.041107177734375,
0.00537872314453125,
-0.0106201171875,
0.046905517578125,
-0.0030384063720703125,
0.0141143798828125,
0.0013837814331054688,
0.0130767822265625,
0.0130462646484375,
-0.02685546875,
-0.00453948974609375,
0.0231170654296875,
0.051666259765625,
-0.02581787109375,
0.092041015625,
-0.01519775390625,
-0.0165863037109375,
-0.0192413330078125,
0.0282745361328125,
-0.04449462890625,
0.03497314453125,
0.010284423828125,
-0.031219482421875,
0.0188751220703125,
0.011962890625,
-0.01393890380859375,
-0.020721435546875,
-0.004955291748046875,
-0.061676025390625,
-0.0015010833740234375,
0.01149749755859375
] |
aa628729f91b9e93c8a36d32b490755e75ca0d25
|
Wordpress Stackexchange
Q: Woocommerce - Add a product to cart programmatically via JS or PHP I am using the Woocommerce plugin to facilitate a small e-commerce part of a site and need to add products to its cart via some call or function rather than using its own 'add-to-cart' buttons.
By this I basically mean send Woocommerce a SKU and quantity for example and have the cart update.
sendToCart('123456', 55);
etc
I've looked through the documentation and can't seem to find a reference to this sort of thing. Can anyone suggest how I might achieve this?
A: OK so here's how I solved it in the end. A quick and dirty example, uses JQuery.
<a id="buy" href="#">Buy this!</a>
<script>
$('#buy').click(function(e) {
e.preventDefault();
addToCart(19);
return false;
});
function addToCart(p_id) {
$.get('/wp/?post_type=product&add-to-cart=' + p_id, function() {
// call back
});
}
</script>
This just makes an AJAX GET request to the cart url
/wp/?post_type=product&add-to-cart=[PRODUCT_ID]
|
Q: Woocommerce - Add a product to cart programmatically via JS or PHP I am using the Woocommerce plugin to facilitate a small e-commerce part of a site and need to add products to its cart via some call or function rather than using its own 'add-to-cart' buttons.
By this I basically mean send Woocommerce a SKU and quantity for example and have the cart update.
sendToCart('123456', 55);
etc
I've looked through the documentation and can't seem to find a reference to this sort of thing. Can anyone suggest how I might achieve this?
A: OK so here's how I solved it in the end. A quick and dirty example, uses JQuery.
<a id="buy" href="#">Buy this!</a>
<script>
$('#buy').click(function(e) {
e.preventDefault();
addToCart(19);
return false;
});
function addToCart(p_id) {
$.get('/wp/?post_type=product&add-to-cart=' + p_id, function() {
// call back
});
}
</script>
This just makes an AJAX GET request to the cart url
/wp/?post_type=product&add-to-cart=[PRODUCT_ID]
A: In PHP I managed to do it this way:
global $woocommerce;
$woocommerce->cart->add_to_cart($product_id);
The method is in woocommerce/classes/class-wc-cart.php:
/**
* Add a product to the cart.
*
* @param string $product_id contains the id of the product to add to the cart
* @param string $quantity contains the quantity of the item to add
* @param int $variation_id
* @param array $variation attribute values
* @param array $cart_item_data extra cart item data we want to pass into the item
* @return bool
*/
public function add_to_cart( $product_id, $quantity = 1, $variation_id = '', $variation = '', $cart_item_data = array() ) {
|
wordpress
|
{
"language": "en",
"length": 251,
"provenance": "stackexchange_00019.jsonl.gz:420276",
"question_score": "38",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53280"
}
|
[
0.041351318359375,
0.006641387939453125,
-0.0279388427734375,
-0.04144287109375,
0.034088134765625,
-0.034393310546875,
0.0467529296875,
-0.0015459060668945312,
0.005115509033203125,
-0.019378662109375,
-0.04779052734375,
-0.0126495361328125,
-0.0290985107421875,
-0.0269317626953125,
0.0206451416015625,
-0.0550537109375,
0.04412841796875,
-0.0295867919921875,
0.017730712890625,
-0.0150604248046875,
-0.0178375244140625,
0.0270538330078125,
0.041046142578125,
0.0640869140625,
-0.002880096435546875,
0.046783447265625,
0.06781005859375,
-0.01898193359375,
0.0229339599609375,
-0.00699615478515625,
0.0264892578125,
-0.044219970703125,
0.0165863037109375,
0.004520416259765625,
-0.0007524490356445312,
-0.006473541259765625,
0.0347900390625,
-0.001979827880859375,
0.0144500732421875,
0.0251922607421875,
0.032073974609375,
-0.0156097412109375,
-0.00257110595703125,
0.0173797607421875,
-0.01264190673828125,
-0.036376953125,
0.0200347900390625,
-0.0288848876953125,
-0.003631591796875,
-0.0169219970703125,
0.0010023117065429688,
0.03729248046875,
0.0158843994140625,
-0.03607177734375,
-0.001132965087890625,
0.0161285400390625,
-0.0391845703125,
0.0241241455078125,
0.0311737060546875,
0.01081085205078125,
-0.020263671875,
-0.0141754150390625,
0.01010894775390625,
-0.02325439453125,
0.007778167724609375,
0.01340484619140625,
-0.0204925537109375,
0.003940582275390625,
-0.04632568359375,
0.0166168212890625,
0.036285400390625,
-0.04656982421875,
0.0006241798400878906,
0.01120758056640625,
-0.0287322998046875,
-0.0567626953125,
0.0278167724609375,
-0.030609130859375,
0.015594482421875,
0.0146636962890625,
0.01288604736328125,
-0.0019664764404296875,
0.00336456298828125,
-0.03533935546875,
0.023712158203125,
-0.01447296142578125,
-0.017059326171875,
-0.0032367706298828125,
-0.024993896484375,
-0.06939697265625,
-0.0217132568359375,
-0.03857421875,
-0.025238037109375,
-0.012237548828125,
-0.043121337890625,
-0.01384735107421875,
-0.0199127197265625,
0.006336212158203125,
0.044342041015625,
0.050018310546875,
0.026092529296875,
-0.07220458984375,
0.09222412109375,
-0.0562744140625,
-0.0012140274047851562,
0.033050537109375,
0.003559112548828125,
-0.005710601806640625,
0.01372528076171875,
0.00347137451171875,
-0.0014820098876953125,
0.01525115966796875,
0.01202392578125,
-0.02606201171875,
0.0034503936767578125,
0.01158905029296875,
-0.0270538330078125,
0.032073974609375,
0.01132965087890625,
0.005107879638671875,
-0.0179901123046875,
-0.006744384765625,
0.0083770751953125,
0.048919677734375,
0.006622314453125,
0.0155792236328125,
0.0008254051208496094,
-0.027191162109375,
-0.0229644775390625,
-0.0194091796875,
-0.0667724609375,
0.04730224609375,
0.1248779296875,
0.049774169921875,
0.0275115966796875,
-0.0034236907958984375,
0.03936767578125,
0.0036106109619140625,
0.0120391845703125,
-0.005359649658203125,
0.0552978515625,
-0.0092620849609375,
-0.0240325927734375,
0.0313720703125,
0.0166778564453125,
-0.00904083251953125,
-0.0052642822265625,
0.0413818359375,
0.042999267578125,
0.003509521484375,
0.01403045654296875,
-0.02838134765625,
-0.00214385986328125,
0.0280303955078125,
0.0276336669921875,
0.048583984375,
0.044708251953125,
-0.01861572265625,
-0.0017528533935546875,
0.008819580078125,
0.00007927417755126953,
-0.006099700927734375,
0.0169219970703125,
-0.03704833984375,
-0.054840087890625,
0.00933837890625,
-0.0390625,
-0.01197052001953125,
0.0227203369140625,
0.0748291015625,
-0.01194000244140625,
-0.0187835693359375,
0.027740478515625,
0.0098419189453125,
-0.026947021484375,
-0.00885009765625,
0.0032253265380859375,
0.03179931640625,
0.04656982421875,
-0.00940704345703125,
-0.024139404296875,
-0.0236053466796875,
0.1033935546875,
-0.034088134765625,
-0.05078125,
0.047760009765625,
0.0322265625,
0.0670166015625,
-0.031646728515625,
0.008819580078125,
0.056060791015625,
0.050201416015625,
-0.02203369140625,
0.00203704833984375,
-0.00022280216217041016,
-0.034210205078125,
-0.016693115234375,
-0.02667236328125,
-0.0232086181640625,
0.032867431640625,
0.0267181396484375,
-0.0008306503295898438,
0.0208740234375,
-0.0001227855682373047,
-0.024688720703125,
0.0013284683227539062,
-0.001209259033203125,
0.0209503173828125,
-0.018524169921875,
0.0128936767578125,
0.0287933349609375,
0.0173492431640625,
-0.015838623046875,
-0.067138671875,
-0.0138092041015625,
0.0176544189453125,
-0.0249481201171875,
0.07318115234375,
-0.0193634033203125,
0.0643310546875,
-0.00724029541015625,
-0.061065673828125,
0.0123291015625,
0.0084991455078125,
0.0260162353515625,
0.0313720703125,
-0.027130126953125,
0.00445556640625,
0.034576416015625,
0.0310211181640625,
-0.026123046875,
-0.020660400390625,
0.0333251953125,
0.00461578369140625,
-0.0183868408203125,
0.0010404586791992188,
0.0022125244140625,
-0.10040283203125,
0.0038776397705078125,
0.062347412109375,
0.031280517578125,
0.005420684814453125,
0.0164031982421875,
0.04888916015625,
0.05438232421875,
0.0194854736328125,
0.0163421630859375,
0.002986907958984375,
-0.0185546875,
0.03839111328125,
-0.00536346435546875,
0.0308990478515625,
0.0011053085327148438,
-0.0325927734375,
0.005344390869140625,
0.05120849609375,
-0.02081298828125,
0.01297760009765625,
-0.01788330078125,
-0.0009102821350097656,
-0.01654052734375,
-0.032928466796875,
0.01311492919921875,
-0.03070068359375,
0.041534423828125,
0.004161834716796875,
0.046051025390625,
0.02508544921875,
-0.0192108154296875,
0.00162506103515625,
0.0029754638671875,
-0.026611328125,
-0.001972198486328125,
0.0255889892578125,
0.0170135498046875,
-0.0322265625,
-0.040679931640625,
0.0035991668701171875,
0.04473876953125,
-0.006023406982421875,
0.0204010009765625,
0.0227203369140625,
0.0159759521484375,
-0.0006136894226074219,
0.033843994140625,
-0.025543212890625,
-0.0145416259765625,
0.0223388671875,
-0.034637451171875,
-0.023406982421875,
0.027435302734375,
0.0074005126953125,
-0.0386962890625,
0.0090789794921875,
-0.0272979736328125,
-0.02459716796875,
0.0703125,
0.0017976760864257812,
0.0251617431640625,
-0.01319122314453125,
0.0233001708984375,
0.02899169921875,
-0.0273284912109375,
0.01168060302734375,
0.0186767578125,
-0.009002685546875,
0.028350830078125,
-0.00589752197265625,
-0.0093231201171875,
0.0384521484375,
-0.09185791015625,
0.01727294921875,
0.024932861328125,
0.039031982421875,
0.002483367919921875,
-0.05035400390625,
0.0099945068359375,
0.0206298828125,
-0.08880615234375,
-0.0955810546875,
-0.017120361328125,
-0.07525634765625,
0.0105133056640625,
-0.0227813720703125,
-0.040863037109375,
0.0035953521728515625,
0.014556884765625,
0.016448974609375,
-0.04296875,
-0.01123046875,
0.006862640380859375,
-0.0491943359375,
-0.0189208984375,
0.0012273788452148438,
-0.005184173583984375,
-0.01538848876953125,
-0.00185394287109375,
0.004062652587890625,
-0.019622802734375,
-0.0177001953125,
0.013519287109375,
0.04730224609375,
0.0121307373046875,
-0.0115966796875,
0.020111083984375,
-0.060089111328125,
0.0247802734375,
-0.01406097412109375,
-0.0094757080078125,
0.027191162109375,
0.0045928955078125,
-0.01499176025390625,
-0.030426025390625,
-0.010589599609375,
0.01947021484375,
-0.0254058837890625,
0.01861572265625,
0.01666259765625,
0.0205230712890625,
-0.04229736328125,
0.005924224853515625,
-0.00632476806640625,
-0.016845703125,
-0.0135955810546875,
-0.005584716796875,
-0.003589630126953125,
-0.00415802001953125,
-0.0005640983581542969,
0.032470703125,
0.01140594482421875,
-0.0137176513671875,
0.0020904541015625,
-0.001613616943359375,
-0.00589752197265625,
0.013641357421875,
-0.0238037109375,
0.060699462890625,
-0.0014619827270507812,
0.001781463623046875,
0.033050537109375,
0.04217529296875,
0.0142669677734375,
-0.0065765380859375,
-0.03765869140625,
-0.051422119140625,
0.0433349609375,
-0.00420379638671875,
0.022796630859375,
-0.0198211669921875,
-0.038909912109375,
0.0088348388671875,
0.09637451171875,
0.03143310546875,
-0.03192138671875,
-0.0200042724609375,
0.015960693359375,
-0.042022705078125,
-0.04974365234375,
0.0058135986328125,
-0.00147247314453125,
-0.004253387451171875,
0.006107330322265625,
-0.0200958251953125,
0.012969970703125,
-0.00891876220703125,
-0.003482818603515625,
0.006175994873046875,
-0.0272979736328125,
0.04058837890625,
-0.07183837890625,
0.0166778564453125,
0.04730224609375,
0.006214141845703125,
0.01435089111328125,
-0.028106689453125,
-0.03277587890625,
-0.0241851806640625,
-0.011322021484375,
0.0258331298828125,
0.0306549072265625,
-0.0035552978515625,
-0.01306915283203125,
-0.023193359375,
0.02740478515625,
-0.0032100677490234375,
0.038299560546875,
-0.0196685791015625,
0.0286407470703125,
-0.04559326171875,
-0.042022705078125,
-0.0086212158203125,
-0.048004150390625,
-0.0198974609375,
-0.02532958984375,
0.003116607666015625,
0.00562286376953125,
-0.01383209228515625,
-0.0033359527587890625,
0.0059051513671875,
-0.01256561279296875,
-0.087646484375,
-0.042205810546875,
-0.028778076171875,
0.0026092529296875,
-0.0149993896484375,
-0.0158233642578125,
-0.0362548828125,
-0.07586669921875,
0.03228759765625,
-0.0179443359375,
-0.0093841552734375,
-0.00579071044921875,
0.060699462890625,
0.02520751953125,
-0.0175018310546875,
0.021240234375,
0.01030731201171875,
0.0287322998046875,
0.01001739501953125,
0.0031585693359375,
-0.024566650390625,
-0.01538848876953125,
0.03021240234375,
-0.008453369140625,
0.02239990234375,
-0.03460693359375,
0.05694580078125,
0.0022220611572265625,
0.00676727294921875,
0.00595855712890625,
0.0017986297607421875,
-0.01062774658203125,
-0.0233917236328125,
-0.0623779296875,
0.02789306640625,
-0.01537322998046875,
0.02301025390625,
-0.0252838134765625,
0.059295654296875,
-0.014373779296875,
-0.02471923828125,
0.00811004638671875,
-0.0155029296875,
0.0073089599609375,
0.0028209686279296875,
0.006969451904296875,
-0.013458251953125,
-0.0246124267578125,
-0.005672454833984375,
-0.0038356781005859375,
-0.01258087158203125,
0.01812744140625,
0.01461029052734375,
0.006397247314453125,
0.0101165771484375,
-0.009246826171875,
-0.010986328125,
0.006488800048828125,
0.017059326171875,
-0.0038127899169921875,
-0.03265380859375,
-0.0125885009765625,
-0.00045180320739746094,
-0.014801025390625,
-0.029266357421875,
0.03277587890625,
0.0128326416015625,
0.0011777877807617188,
-0.0027256011962890625,
-0.066162109375,
0.0014553070068359375,
-0.044952392578125,
0.03753662109375,
0.02886962890625,
-0.0107269287109375,
0.01263427734375,
0.051849365234375,
0.010589599609375,
0.028564453125,
-0.007778167724609375,
0.0604248046875,
0.047515869140625,
0.051971435546875,
0.0202789306640625,
-0.02197265625,
-0.0131683349609375,
0.0210723876953125,
-0.05194091796875,
-0.004322052001953125,
-0.028106689453125,
0.00792694091796875,
0.005130767822265625,
-0.039703369140625,
-0.003753662109375,
0.0233917236328125,
-0.001232147216796875,
-0.0323486328125,
-0.052703857421875,
-0.00937652587890625,
0.04083251953125,
-0.0144195556640625,
-0.037139892578125,
-0.0010080337524414062,
0.056427001953125,
0.0228424072265625,
0.006175994873046875,
-0.00399017333984375,
-0.00670623779296875,
0.0173492431640625,
0.0101776123046875,
-0.042205810546875,
-0.026123046875,
-0.0026493072509765625,
-0.03826904296875,
-0.0178680419921875,
-0.0169677734375,
0.03546142578125,
-0.043182373046875,
-0.02117919921875,
0.0419921875,
-0.0005373954772949219,
0.051544189453125,
-0.0311431884765625,
-0.031646728515625,
-0.0012712478637695312,
-0.01129913330078125,
0.044158935546875,
0.0141143798828125,
-0.004512786865234375,
-0.0272216796875,
-0.0246734619140625,
-0.0477294921875,
-0.01200103759765625,
0.01251220703125,
-0.042816162109375,
0.0207977294921875,
-0.013519287109375,
0.030242919921875,
-0.033660888671875,
-0.03143310546875,
0.02593994140625,
-0.01348114013671875,
-0.023284912109375,
-0.002727508544921875,
0.0145111083984375,
0.0333251953125,
-0.02728271484375,
0.0328369140625,
0.00586700439453125,
-0.0013875961303710938,
-0.034393310546875,
-0.0225677490234375,
-0.0023441314697265625,
-0.020965576171875,
0.00846099853515625,
-0.00835418701171875,
-0.01071929931640625,
-0.01412200927734375,
0.044342041015625,
-0.00487518310546875,
-0.007045745849609375,
-0.0202178955078125,
-0.004703521728515625,
-0.035308837890625,
0.03900146484375,
0.0207977294921875,
-0.0085296630859375,
0.01413726806640625,
-0.05865478515625,
-0.01209259033203125,
0.044464111328125,
0.049285888671875,
-0.0098419189453125,
-0.03729248046875,
0.007022857666015625,
0.007747650146484375,
-0.034942626953125,
0.0308074951171875,
0.068603515625,
0.0296630859375,
0.058807373046875,
-0.0160980224609375,
0.031494140625,
0.043914794921875,
0.027099609375,
0.007747650146484375,
-0.0187225341796875,
0.0487060546875,
-0.00128936767578125,
-0.0305328369140625,
0.02911376953125,
-0.04412841796875,
0.03289794921875,
0.043304443359375,
0.052734375,
-0.0802001953125,
0.017364501953125,
-0.0011720657348632812,
-0.0316162109375,
0.027557373046875,
-0.0233154296875,
0.0133209228515625,
-0.01248931884765625,
0.048187255859375,
0.004150390625,
-0.01438140869140625,
0.017669677734375,
-0.00977325439453125,
0.028045654296875,
0.038604736328125,
-0.005260467529296875,
-0.00884246826171875,
-0.07293701171875,
-0.03460693359375,
0.048919677734375,
-0.0234222412109375,
-0.0189208984375,
-0.038787841796875,
0.05078125,
-0.029144287109375,
-0.020660400390625,
0.07208251953125,
-0.045928955078125,
0.04052734375,
0.021270751953125,
0.0192718505859375,
0.0232391357421875,
0.04656982421875,
0.0247039794921875,
-0.023681640625,
0.02813720703125,
-0.005832672119140625,
0.01403045654296875,
0.00868988037109375,
0.002048492431640625,
0.0095367431640625,
-0.08026123046875,
-0.009796142578125,
-0.0718994140625,
0.0623779296875,
0.00811004638671875,
0.062103271484375,
0.04486083984375,
-0.03802490234375,
-0.025299072265625,
0.05718994140625,
0.021392822265625,
-0.0186767578125,
-0.0043487548828125,
-0.018524169921875,
-0.0201873779296875,
0.032867431640625,
-0.00827789306640625,
0.00437164306640625,
0.003864288330078125,
-0.01100921630859375,
-0.059173583984375,
0.0513916015625,
-0.047393798828125,
0.0024662017822265625,
-0.0011548995971679688,
0.0221405029296875,
0.0007190704345703125,
-0.01351165771484375,
-0.0482177734375,
0.046844482421875,
0.01519775390625,
0.019866943359375,
-0.044097900390625,
-0.01263427734375,
-0.006988525390625,
0.0236663818359375,
0.04486083984375,
0.00963592529296875,
-0.0560302734375,
-0.00330352783203125,
0.06591796875,
0.037689208984375,
0.022430419921875,
0.040557861328125,
0.003681182861328125,
-0.0224761962890625,
0.07220458984375,
-0.00974273681640625,
0.024688720703125,
0.0094451904296875,
0.017242431640625,
0.019744873046875,
-0.00185394287109375,
-0.01094818115234375,
0.00017499923706054688,
0.027252197265625,
-0.02484130859375,
0.0029277801513671875,
0.01003265380859375,
-0.0176544189453125,
0.0181121826171875,
0.03692626953125,
0.01406097412109375,
0.04364013671875,
-0.0025615692138671875,
-0.01123809814453125,
0.0308685302734375,
0.006488800048828125,
0.022125244140625,
0.0251617431640625,
0.0164947509765625,
0.06805419921875,
-0.002719879150390625,
0.006450653076171875,
0.0099945068359375,
-0.00466156005859375,
0.066162109375,
0.01442718505859375,
0.00943756103515625,
-0.043701171875,
0.005748748779296875,
0.047271728515625,
0.0648193359375,
-0.05322265625,
-0.00865936279296875,
0.0012598037719726562,
-0.007167816162109375,
0.03094482421875,
-0.046600341796875,
0.039825439453125,
-0.055633544921875,
-0.05511474609375,
-0.058929443359375,
0.0115966796875,
0.0286102294921875,
0.034454345703125,
0.0171051025390625,
0.022674560546875,
-0.08746337890625,
-0.034881591796875,
-0.052978515625,
0.0252532958984375,
0.01299285888671875,
0.06817626953125,
0.007801055908203125,
0.10028076171875,
-0.0200042724609375,
-0.0465087890625,
0.004673004150390625,
0.0182647705078125,
0.02618408203125,
-0.0130767822265625,
0.005558013916015625,
-0.0142822265625,
0.0310211181640625,
0.013671875,
0.0200042724609375,
0.07427978515625,
0.056304931640625,
0.0247955322265625,
0.00867462158203125,
0.01210784912109375,
0.059783935546875,
-0.019561767578125,
-0.01387786865234375,
-0.01229095458984375,
0.033416748046875,
0.0146026611328125,
0.01273345947265625,
-0.00484466552734375,
0.042572021484375,
0.018096923828125,
-0.047027587890625,
0.06243896484375,
-0.0231170654296875,
-0.03082275390625,
0.07623291015625,
-0.0226287841796875,
0.09881591796875,
-0.03289794921875,
-0.07818603515625,
0.000058650970458984375,
-0.02215576171875,
-0.01314544677734375,
-0.01146697998046875,
0.0029315948486328125,
-0.038177490234375,
0.06903076171875,
0.01030731201171875,
0.0011548995971679688,
0.034576416015625,
-0.01213836669921875,
-0.00769805908203125,
-0.01514434814453125,
0.0269775390625,
-0.018798828125,
-0.04254150390625,
-0.0082855224609375,
-0.03216552734375,
0.0132904052734375,
0.0308685302734375,
-0.00670623779296875,
0.026123046875,
0.0289459228515625,
0.01342010498046875,
-0.00441741943359375,
0.0150299072265625,
-0.00943756103515625,
0.0711669921875,
-0.0026493072509765625,
-0.0251007080078125,
-0.01441192626953125,
-0.0085601806640625,
0.003765106201171875,
0.034942626953125,
-0.00043773651123046875,
-0.0055389404296875,
-0.03497314453125,
0.0306854248046875,
0.012542724609375,
0.039398193359375,
-0.0249786376953125,
-0.05706787109375,
-0.04327392578125,
0.001949310302734375,
0.002117156982421875,
0.03466796875,
0.004795074462890625,
0.01255035400390625,
-0.007701873779296875,
-0.022674560546875,
0.02740478515625,
-0.034820556640625,
0.043426513671875,
0.036376953125,
-0.001148223876953125,
-0.0128021240234375,
-0.006191253662109375,
-0.01715087890625,
0.00782012939453125,
-0.01214599609375,
0.02899169921875,
-0.0004305839538574219,
-0.0419921875,
-0.01522064208984375,
0.05487060546875,
0.0255279541015625,
-0.01702880859375,
0.01476287841796875,
0.041717529296875,
-0.039520263671875,
0.007022857666015625,
-0.011749267578125,
-0.02801513671875,
-0.020965576171875,
0.0250701904296875,
0.01396942138671875,
0.028839111328125,
0.00249481201171875,
-0.0256805419921875,
-0.0197906494140625,
0.01140594482421875,
-0.002513885498046875,
-0.057708740234375,
0.0059051513671875,
0.0080413818359375,
0.051361083984375,
-0.04541015625,
0.00547027587890625,
0.01276397705078125,
0.035980224609375,
-0.0270843505859375,
-0.0101165771484375,
-0.03912353515625,
-0.0025920867919921875,
-0.03961181640625,
0.0144195556640625,
0.0350341796875,
-0.0276641845703125,
-0.039642333984375,
-0.006771087646484375,
0.006664276123046875,
0.041046142578125,
0.039703369140625,
-0.0355224609375,
0.0382080078125,
-0.01155853271484375,
-0.012420654296875,
-0.07861328125,
-0.00769805908203125,
-0.0697021484375,
0.01119232177734375,
-0.01430511474609375,
0.032745361328125,
0.057891845703125,
-0.0130157470703125,
-0.0426025390625,
0.044219970703125,
-0.011322021484375,
-0.023162841796875,
-0.057403564453125,
0.01303863525390625,
-0.027099609375,
0.0200958251953125,
-0.0274658203125,
-0.023681640625,
0.0013856887817382812,
0.053192138671875,
-0.02093505859375,
-0.008697509765625,
0.0521240234375,
-0.04571533203125,
-0.004154205322265625,
0.0007023811340332031,
0.025726318359375,
-0.020172119140625,
0.0221405029296875,
-0.04620361328125,
0.05828857421875,
0.019256591796875,
-0.040496826171875,
0.03594970703125,
0.02734375,
0.035186767578125,
-0.01287078857421875,
-0.057830810546875,
0.008941650390625,
-0.02801513671875,
0.02191162109375,
-0.0035533905029296875,
0.0011568069458007812,
-0.0114898681640625,
0.005886077880859375,
-0.01078033447265625,
-0.038970947265625,
0.011627197265625,
0.005153656005859375,
-0.00799560546875,
0.027587890625,
-0.02880859375,
-0.0118408203125,
-0.0051422119140625,
0.038238525390625,
-0.04791259765625,
0.0026912689208984375,
0.017730712890625,
-0.0026836395263671875,
-0.062469482421875,
0.0243377685546875,
0.03216552734375,
-0.032958984375,
-0.01226806640625,
0.0111541748046875,
-0.01067352294921875,
0.0003287792205810547,
-0.007205963134765625,
-0.0015687942504882812,
0.0171661376953125,
-0.0157928466796875,
0.0163421630859375,
0.0035400390625,
0.0159912109375,
-0.01039886474609375,
0.0087738037109375,
-0.0206451416015625,
0.0362548828125,
-0.0107574462890625,
0.039520263671875,
0.0120391845703125,
0.03515625,
0.0169677734375,
0.07977294921875,
-0.0158538818359375,
-0.04071044921875,
-0.0276336669921875,
0.028900146484375,
0.0250701904296875,
0.004116058349609375,
0.05328369140625,
-0.0284423828125,
-0.015899658203125,
0.0021514892578125,
-0.051177978515625,
-0.07745361328125,
0.02142333984375,
0.0157318115234375,
-0.0054779052734375,
0.0251922607421875
] |
f08d80079d95e22041ab3f485b49ef9597885f67
|
Wordpress Stackexchange
Q: Custom Post Type URL Rewriting? I setup a custom post type for my portfolio projects. The main URL for this is located at /projects/
Now I've also setup my blog posts permalink to /articles/*/ for the permalink structure. This means when I go to view a portfolio project the URL changes to /articles/projects/project-name/
I know there must be a way to rewrite permalinks only for my projects custom post type. But I'm unfamiliar with the syntax in declaring the URL slug - would appreciate any help I can get!
A: When you register the custom post type, you have to specify that the rewrite rule shouldn't be prepended with the existing URL structure.
In short, this means that this line in your register_post_type call:
'rewrite' => array('slug' => 'projects'),
should turn into this:
'rewrite' => array('slug' => 'projects','with_front' => false),
For more info, check out the rewrite argument from the codex entry on register_post_type
edit: just make sure that, after updating the code, you flush the rewrite rules by visiting Settings > Permalinks. Otherwise you'll still see the old links.
|
Q: Custom Post Type URL Rewriting? I setup a custom post type for my portfolio projects. The main URL for this is located at /projects/
Now I've also setup my blog posts permalink to /articles/*/ for the permalink structure. This means when I go to view a portfolio project the URL changes to /articles/projects/project-name/
I know there must be a way to rewrite permalinks only for my projects custom post type. But I'm unfamiliar with the syntax in declaring the URL slug - would appreciate any help I can get!
A: When you register the custom post type, you have to specify that the rewrite rule shouldn't be prepended with the existing URL structure.
In short, this means that this line in your register_post_type call:
'rewrite' => array('slug' => 'projects'),
should turn into this:
'rewrite' => array('slug' => 'projects','with_front' => false),
For more info, check out the rewrite argument from the codex entry on register_post_type
edit: just make sure that, after updating the code, you flush the rewrite rules by visiting Settings > Permalinks. Otherwise you'll still see the old links.
A: I had this problem literally 3 days ago, then I stumbled across a series over at wp.tutsplus.com. I swapped my own code out to accommodate your question better, but this is what I ended up with after following the series. Also, keep in mind that this is untested.
// sets custom post type
function my_custom_post_type() {
register_post_type('Projects', array(
'label' => 'Projects','description' => '',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'hierarchical' => false,
'publicly_queryable' => true,
'rewrite' => false,
'query_var' => true,
'has_archive' => true,
'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes'),
'taxonomies' => array('category','post_tag'),
// there are a lot more available arguments, but the above is plenty for now
));
}
add_action('init', 'my_custom_post_type');
// rewrites custom post type name
global $wp_rewrite;
$projects_structure = '/projects/%year%/%monthnum%/%day%/%projects%/';
$wp_rewrite->add_rewrite_tag("%projects%", '([^/]+)', "project=");
$wp_rewrite->add_permastruct('projects', $projects_structure, false);
Theoretically, you could swap out whatever you want in the URL stored in the $projects_structure variable, what is there is just what I ended up using.
Good luck, and as always - make sure to come back and let us know how it worked out! :)
|
wordpress
|
{
"language": "en",
"length": 360,
"provenance": "stackexchange_00019.jsonl.gz:420282",
"question_score": "40",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53298"
}
|
[
0.031097412109375,
-0.0070648193359375,
0.0083770751953125,
-0.007274627685546875,
-0.00727081298828125,
0.004535675048828125,
0.01512908935546875,
-0.036773681640625,
-0.051849365234375,
0.01477813720703125,
0.018951416015625,
0.0135955810546875,
-0.03814697265625,
-0.05096435546875,
0.045440673828125,
-0.01317596435546875,
0.020416259765625,
-0.0169677734375,
0.015655517578125,
-0.0265350341796875,
0.03240966796875,
-0.012359619140625,
0.026824951171875,
0.033538818359375,
0.01500701904296875,
-0.030517578125,
0.038238525390625,
-0.0103759765625,
-0.011077880859375,
-0.033111572265625,
0.0160064697265625,
0.00664520263671875,
0.00909423828125,
0.0227813720703125,
0.01103973388671875,
0.0247344970703125,
0.035308837890625,
0.0015897750854492188,
0.025115966796875,
0.02789306640625,
0.04345703125,
-0.02667236328125,
-0.003894805908203125,
0.00504302978515625,
0.0139617919921875,
-0.0361328125,
0.040924072265625,
-0.057281494140625,
0.00933074951171875,
-0.0228424072265625,
0.0014867782592773438,
0.04608154296875,
0.0229949951171875,
-0.0010585784912109375,
-0.010284423828125,
0.006435394287109375,
0.00768280029296875,
-0.006618499755859375,
0.0269622802734375,
0.00009906291961669922,
-0.00962066650390625,
-0.0002294778823852539,
0.024505615234375,
0.0021514892578125,
-0.01131439208984375,
-0.002986907958984375,
0.0212860107421875,
0.0167694091796875,
-0.055877685546875,
-0.0137786865234375,
0.0413818359375,
-0.018280029296875,
0.01335906982421875,
-0.019927978515625,
-0.01059722900390625,
-0.0265960693359375,
0.0012531280517578125,
-0.038421630859375,
0.009246826171875,
0.0088653564453125,
-0.0152587890625,
-0.0172576904296875,
0.01329803466796875,
-0.0252838134765625,
0.00432586669921875,
-0.00640106201171875,
-0.02069091796875,
-0.005474090576171875,
-0.0401611328125,
-0.003437042236328125,
-0.03363037109375,
0.007175445556640625,
-0.0309295654296875,
0.0123138427734375,
-0.0175018310546875,
0.00591278076171875,
0.00905609130859375,
0.00031828880310058594,
0.00858306884765625,
0.0203857421875,
0.036468505859375,
-0.061279296875,
0.0714111328125,
-0.0325927734375,
0.0153961181640625,
0.0161285400390625,
-0.0033130645751953125,
0.0189971923828125,
0.07000732421875,
0.01593017578125,
0.0086212158203125,
0.068603515625,
-0.02783203125,
0.020904541015625,
-0.039703369140625,
0.00637054443359375,
-0.057373046875,
-0.034149169921875,
-0.0242919921875,
0.009613037109375,
0.001682281494140625,
0.043121337890625,
0.0219268798828125,
-0.0255889892578125,
0.0036716461181640625,
0.006053924560546875,
0.00024962425231933594,
-0.07049560546875,
0.0280609130859375,
0.0477294921875,
-0.037139892578125,
0.0005278587341308594,
0.048828125,
0.0213165283203125,
0.01081085205078125,
-0.035888671875,
0.035552978515625,
-0.019683837890625,
-0.0279998779296875,
0.034942626953125,
-0.017913818359375,
-0.0214996337890625,
0.002994537353515625,
-0.0246734619140625,
0.0170745849609375,
0.035125732421875,
0.00989532470703125,
0.00809478759765625,
-0.0032501220703125,
-0.047393798828125,
-0.0093231201171875,
-0.031707763671875,
0.04132080078125,
0.019378662109375,
-0.015655517578125,
-0.0228424072265625,
0.041961669921875,
-0.037506103515625,
-0.006221771240234375,
-0.03985595703125,
0.0261077880859375,
-0.006099700927734375,
-0.001972198486328125,
-0.01702880859375,
-0.0261383056640625,
-0.00377655029296875,
-0.041259765625,
0.0038242340087890625,
0.0093994140625,
0.0077667236328125,
0.0168914794921875,
0.00007814168930053711,
-0.032806396484375,
-0.01458740234375,
0.0009860992431640625,
-0.01947021484375,
-0.005458831787109375,
0.0005807876586914062,
-0.004344940185546875,
0.1085205078125,
0.037109375,
-0.025482177734375,
0.0162506103515625,
-0.004215240478515625,
-0.05316162109375,
0.02984619140625,
0.00882720947265625,
0.035919189453125,
-0.0061798095703125,
-0.00009000301361083984,
0.043701171875,
0.0423583984375,
-0.03570556640625,
0.0187225341796875,
-0.0242767333984375,
-0.02313232421875,
0.0098419189453125,
0.0004138946533203125,
-0.02825927734375,
0.00830841064453125,
-0.05767822265625,
0.03759765625,
-0.017791748046875,
0.042999267578125,
-0.0016183853149414062,
0.0362548828125,
-0.01222991943359375,
0.044525146484375,
0.0246734619140625,
0.04791259765625,
0.01519775390625,
0.03350830078125,
-0.050445556640625,
-0.023529052734375,
-0.0307159423828125,
-0.005603790283203125,
0.01025390625,
-0.0018033981323242188,
-0.015411376953125,
-0.00007069110870361328,
0.007160186767578125,
0.007740020751953125,
-0.0198822021484375,
0.03125,
0.053741455078125,
-0.002437591552734375,
-0.0202484130859375,
-0.0217132568359375,
-0.00963592529296875,
0.0240020751953125,
-0.106201171875,
0.0300140380859375,
-0.0034770965576171875,
0.0043487548828125,
-0.0288848876953125,
0.005859375,
0.003963470458984375,
0.00827789306640625,
0.0082550048828125,
0.0263671875,
0.00739288330078125,
0.032470703125,
-0.022857666015625,
-0.00894927978515625,
0.02911376953125,
-0.0193328857421875,
0.00463104248046875,
-0.0007476806640625,
-0.007648468017578125,
0.036102294921875,
0.0207672119140625,
0.0222320556640625,
0.0038433074951171875,
-0.039520263671875,
-0.0014333724975585938,
0.051788330078125,
-0.0113525390625,
-0.01410675048828125,
0.008941650390625,
-0.0226898193359375,
0.01385498046875,
0.01141357421875,
-0.021026611328125,
0.0029048919677734375,
0.032989501953125,
0.033721923828125,
0.04486083984375,
0.043243408203125,
-0.0164642333984375,
0.00980377197265625,
-0.007083892822265625,
0.0109100341796875,
-0.00862884521484375,
0.05615234375,
0.07330322265625,
-0.052642822265625,
-0.0207977294921875,
-0.017974853515625,
0.01800537109375,
0.01995849609375,
-0.02886962890625,
0.0124969482421875,
-0.05157470703125,
-0.0018482208251953125,
-0.031219482421875,
-0.056915283203125,
0.01058197021484375,
0.02783203125,
0.0404052734375,
0.0011959075927734375,
0.039947509765625,
-0.03369140625,
-0.0230865478515625,
0.0161285400390625,
0.038604736328125,
-0.05780029296875,
0.0211181640625,
-0.07708740234375,
0.07598876953125,
-0.06317138671875,
0.03289794921875,
0.061492919921875,
-0.034759521484375,
0.0279541015625,
0.006317138671875,
0.02587890625,
-0.0272369384765625,
0.032501220703125,
0.0008869171142578125,
-0.03485107421875,
-0.043548583984375,
-0.01287078857421875,
0.02850341796875,
0.0130462646484375,
0.02630615234375,
-0.0117340087890625,
0.00951385498046875,
0.0469970703125,
-0.0194244384765625,
-0.017578125,
0.0009622573852539062,
-0.054962158203125,
-0.004482269287109375,
-0.0015239715576171875,
-0.0191192626953125,
-0.005908966064453125,
0.01702880859375,
0.0006551742553710938,
0.0343017578125,
-0.01374053955078125,
-0.09063720703125,
-0.06072998046875,
-0.1046142578125,
-0.021484375,
-0.0114593505859375,
0.0219268798828125,
0.0185699462890625,
0.0171356201171875,
0.0107421875,
-0.0440673828125,
0.047607421875,
0.0199737548828125,
-0.015777587890625,
0.031341552734375,
-0.0085906982421875,
-0.031829833984375,
0.0179443359375,
-0.01031494140625,
0.08428955078125,
0.035736083984375,
-0.0179901123046875,
0.018585205078125,
0.00812530517578125,
-0.0109100341796875,
0.0144500732421875,
0.0218658447265625,
0.00811767578125,
-0.0201873779296875,
0.01361846923828125,
-0.07080078125,
-0.055633544921875,
-0.023834228515625,
-0.052764892578125,
-0.00684356689453125,
0.03253173828125,
0.0164947509765625,
-0.032470703125,
0.039215087890625,
-0.00815582275390625,
0.0182952880859375,
0.03582763671875,
-0.0496826171875,
0.0823974609375,
-0.015625,
-0.005229949951171875,
-0.0538330078125,
0.0438232421875,
-0.0196075439453125,
0.0176544189453125,
0.025238037109375,
-0.0009350776672363281,
0.0006051063537597656,
-0.020477294921875,
-0.03753662109375,
-0.07061767578125,
0.035888671875,
-0.0791015625,
-0.00937652587890625,
-0.04583740234375,
0.0007224082946777344,
-0.0018396377563476562,
0.07952880859375,
-0.047760009765625,
-0.01467132568359375,
-0.0017061233520507812,
-0.005413055419921875,
0.0186614990234375,
-0.0172882080078125,
-0.0287017822265625,
-0.019927978515625,
-0.0556640625,
-0.0251007080078125,
-0.0203857421875,
-0.032073974609375,
0.0099639892578125,
-0.01546478271484375,
-0.01910400390625,
-0.040985107421875,
0.0426025390625,
-0.035675048828125,
0.0174102783203125,
0.0243682861328125,
0.006885528564453125,
-0.0069732666015625,
-0.050537109375,
-0.00727081298828125,
-0.07061767578125,
-0.0204620361328125,
0.018157958984375,
0.044708251953125,
0.0034198760986328125,
-0.0482177734375,
-0.0023670196533203125,
0.0623779296875,
0.0250396728515625,
-0.010040283203125,
0.0222625732421875,
-0.0153045654296875,
-0.0112457275390625,
0.021148681640625,
0.00560760498046875,
-0.006862640380859375,
0.0260009765625,
0.0207672119140625,
-0.0570068359375,
0.00458526611328125,
-0.01849365234375,
-0.0018939971923828125,
0.035614013671875,
-0.05914306640625,
-0.024749755859375,
-0.0012331008911132812,
-0.007106781005859375,
0.01488494873046875,
0.0053558349609375,
-0.038238525390625,
0.00832366943359375,
-0.02435302734375,
0.007602691650390625,
-0.04290771484375,
0.0084381103515625,
0.018829345703125,
0.07275390625,
0.00945281982421875,
0.0084381103515625,
0.01224517822265625,
0.0433349609375,
0.04620361328125,
0.021942138671875,
0.017852783203125,
0.00847625732421875,
-0.0016736984252929688,
0.0007462501525878906,
0.004268646240234375,
-0.01279449462890625,
0.0174560546875,
-0.01074981689453125,
0.0014886856079101562,
-0.00707244873046875,
-0.01531219482421875,
-0.0287017822265625,
0.046875,
0.044891357421875,
-0.00980377197265625,
-0.00014984607696533203,
-0.01123809814453125,
0.026702880859375,
-0.0220947265625,
0.0014810562133789062,
-0.037384033203125,
-0.022247314453125,
0.01544189453125,
0.0311431884765625,
0.049652099609375,
0.0018167495727539062,
0.001094818115234375,
0.0208892822265625,
-0.0015459060668945312,
0.0004925727844238281,
-0.0189208984375,
-0.00318145751953125,
0.0015802383422851562,
0.0298919677734375,
-0.0283050537109375,
0.00307464599609375,
-0.025390625,
0.005840301513671875,
0.0277099609375,
0.017059326171875,
-0.0029697418212890625,
-0.0026397705078125,
-0.01094818115234375,
-0.007354736328125,
-0.008941650390625,
-0.0011510848999023438,
0.04150390625,
0.023284912109375,
0.00420379638671875,
0.00897979736328125,
-0.0222930908203125,
0.00894927978515625,
-0.035797119140625,
0.0193328857421875,
0.00772857666015625,
-0.011993408203125,
-0.02685546875,
0.0626220703125,
0.051055908203125,
-0.01175689697265625,
-0.021331787109375,
0.0469970703125,
0.07061767578125,
0.00641632080078125,
-0.00626373291015625,
0.031097412109375,
-0.0198516845703125,
0.004451751708984375,
-0.0024318695068359375,
-0.032440185546875,
0.0228729248046875,
0.00893402099609375,
0.060882568359375,
-0.0008420944213867188,
-0.041046142578125,
0.017852783203125,
-0.061370849609375,
-0.0263824462890625,
-0.0081329345703125,
-0.023193359375,
-0.043670654296875,
-0.01352691650390625,
0.017303466796875,
0.007114410400390625,
0.003322601318359375,
-0.03497314453125,
0.0303802490234375,
-0.0206451416015625,
0.0399169921875,
0.0301513671875,
-0.00970458984375,
0.0249176025390625,
0.0173187255859375,
0.01035308837890625,
-0.0247955322265625,
0.037628173828125,
-0.032073974609375,
0.0071563720703125,
-0.029266357421875,
-0.01267242431640625,
0.0303802490234375,
-0.02423095703125,
0.0340576171875,
0.004940032958984375,
-0.03192138671875,
0.051025390625,
0.006198883056640625,
0.044281005859375,
0.00736236572265625,
-0.01715087890625,
-0.000858306884765625,
-0.028350830078125,
0.00955963134765625,
0.0197601318359375,
-0.0311126708984375,
0.002368927001953125,
-0.021392822265625,
0.02008056640625,
0.043243408203125,
-0.01763916015625,
-0.016021728515625,
-0.0023708343505859375,
0.0197906494140625,
0.011444091796875,
0.07232666015625,
-0.0302886962890625,
0.06195068359375,
0.0005617141723632812,
0.049713134765625,
-0.0007257461547851562,
0.0143890380859375,
-0.01242828369140625,
-0.0222015380859375,
-0.011016845703125,
-0.07147216796875,
-0.032928466796875,
0.0217742919921875,
-0.032440185546875,
0.054412841796875,
0.0439453125,
0.00476837158203125,
0.01201629638671875,
-0.019927978515625,
-0.006412506103515625,
-0.0211639404296875,
0.0266876220703125,
-0.044708251953125,
0.033538818359375,
-0.0036411285400390625,
0.04193115234375,
0.0848388671875,
0.001285552978515625,
-0.0247039794921875,
-0.0148468017578125,
0.01349639892578125,
0.02142333984375,
-0.01261138916015625,
-0.0303955078125,
-0.007659912109375,
0.0572509765625,
0.01496124267578125,
0.054779052734375,
-0.0018415451049804688,
0.03253173828125,
0.06829833984375,
-0.006130218505859375,
-0.0011491775512695312,
0.032867431640625,
0.05718994140625,
0.0031452178955078125,
0.00439453125,
0.034027099609375,
-0.01070404052734375,
-0.0026035308837890625,
0.079833984375,
0.0533447265625,
-0.08465576171875,
-0.018798828125,
-0.00493621826171875,
0.00238800048828125,
0.04730224609375,
0.0136871337890625,
0.006412506103515625,
0.0286865234375,
-0.00846099853515625,
-0.0265350341796875,
-0.03118896484375,
-0.0180511474609375,
0.0053558349609375,
0.00608062744140625,
0.0147247314453125,
0.057525634765625,
-0.0149078369140625,
-0.0279541015625,
-0.054412841796875,
0.002147674560546875,
-0.030181884765625,
-0.0171051025390625,
-0.0190582275390625,
0.018798828125,
-0.01708984375,
-0.00417327880859375,
0.0677490234375,
-0.049774169921875,
0.045806884765625,
0.0413818359375,
-0.0039005279541015625,
-0.003795623779296875,
0.0095062255859375,
-0.00615692138671875,
0.0017528533935546875,
-0.0217437744140625,
-0.036590576171875,
0.02618408203125,
-0.0182647705078125,
0.00015795230865478516,
-0.0019817352294921875,
-0.016021728515625,
0.006290435791015625,
-0.0211181640625,
-0.0192413330078125,
-0.01593017578125,
-0.02838134765625,
0.10882568359375,
-0.0269012451171875,
-0.0250396728515625,
0.01380157470703125,
0.0238800048828125,
-0.01540374755859375,
-0.0035305023193359375,
-0.0198822021484375,
-0.027557373046875,
-0.01245880126953125,
-0.0297698974609375,
-0.0443115234375,
0.01442718505859375,
-0.0279388427734375,
-0.0445556640625,
0.1304931640625,
-0.0015201568603515625,
0.04156494140625,
0.047698974609375,
0.053863525390625,
-0.0188140869140625,
0.035888671875,
-0.0254974365234375,
0.0231170654296875,
-0.01512908935546875,
0.043975830078125,
-0.041748046875,
-0.006824493408203125,
0.0119476318359375,
0.044036865234375,
0.0791015625,
0.0216522216796875,
-0.0538330078125,
-0.0032939910888671875,
0.060699462890625,
0.0386962890625,
0.0006041526794433594,
0.039581298828125,
-0.0269012451171875,
0.039031982421875,
0.0154266357421875,
-0.042938232421875,
0.0279541015625,
-0.010498046875,
-0.0526123046875,
0.0018587112426757812,
0.00667572021484375,
0.0124969482421875,
-0.01096343994140625,
-0.0128326416015625,
-0.03515625,
-0.01103973388671875,
0.03619384765625,
0.00656890869140625,
0.019287109375,
-0.005645751953125,
0.05023193359375,
-0.0443115234375,
-0.00592041015625,
0.0010614395141601562,
0.052459716796875,
0.0147857666015625,
0.01751708984375,
0.025482177734375,
0.023345947265625,
0.0157012939453125,
-0.02593994140625,
0.0020046234130859375,
0.02276611328125,
-0.0257415771484375,
0.036712646484375,
0.059417724609375,
0.0302886962890625,
0.01727294921875,
0.041778564453125,
0.0634765625,
0.0545654296875,
-0.0516357421875,
-0.0282135009765625,
0.000347137451171875,
0.01026153564453125,
0.01477813720703125,
-0.024566650390625,
0.01279449462890625,
-0.0205230712890625,
0.0018568038940429688,
-0.052947998046875,
-0.01470184326171875,
0.0166473388671875,
0.0283966064453125,
-0.035308837890625,
-0.084716796875,
0.01103973388671875,
0.006145477294921875,
-0.06707763671875,
0.028350830078125,
-0.0031528472900390625,
0.07513427734375,
0.03619384765625,
0.0504150390625,
-0.01311492919921875,
-0.042999267578125,
0.007434844970703125,
0.0011053085327148438,
-0.024688720703125,
0.01065826416015625,
-0.08013916015625,
-0.08160400390625,
0.051849365234375,
0.07769775390625,
0.063232421875,
0.01120758056640625,
0.043914794921875,
0.00824737548828125,
-0.0032138824462890625,
0.0099334716796875,
0.018218994140625,
-0.005916595458984375,
0.02764892578125,
-0.05145263671875,
0.0193023681640625,
-0.0194854736328125,
-0.006561279296875,
-0.015655517578125,
-0.0024242401123046875,
0.002010345458984375,
-0.0102081298828125,
0.04461669921875,
0.002216339111328125,
0.0009975433349609375,
0.05059814453125,
-0.023162841796875,
0.049224853515625,
0.005809783935546875,
-0.02862548828125,
0.0090484619140625,
-0.0296630859375,
-0.08502197265625,
0.0237884521484375,
0.052734375,
-0.0030612945556640625,
-0.017730712890625,
0.00429534912109375,
0.0009794235229492188,
0.00524139404296875,
-0.0091552734375,
0.0010766983032226562,
0.031219482421875,
0.0222625732421875,
0.025665283203125,
-0.03253173828125,
-0.04010009765625,
0.01113128662109375,
0.034881591796875,
-0.0081329345703125,
0.1348876953125,
-0.0450439453125,
-0.004608154296875,
-0.0194854736328125,
0.0289764404296875,
-0.0292816162109375,
-0.013427734375,
-0.02508544921875,
0.0130157470703125,
0.041412353515625,
0.00701141357421875,
-0.0029449462890625,
-0.002956390380859375,
0.050750732421875,
-0.06475830078125,
0.0166778564453125,
-0.037750244140625,
0.0210723876953125,
-0.05255126953125,
-0.01556396484375,
-0.047088623046875,
-0.06365966796875,
-0.045562744140625,
-0.002338409423828125,
-0.006893157958984375,
-0.021636962890625,
-0.0372314453125,
0.045623779296875,
-0.00001609325408935547,
-0.01311492919921875,
0.00884246826171875,
-0.05218505859375,
0.027313232421875,
0.041259765625,
-0.00228118896484375,
-0.0523681640625,
0.0208282470703125,
-0.001373291015625,
-0.0183563232421875,
0.03009033203125,
0.022918701171875,
0.0135955810546875,
-0.0278472900390625,
-0.0308074951171875,
-0.0269622802734375,
0.00754547119140625,
0.0038776397705078125,
0.0151519775390625,
-0.047210693359375,
-0.0029773712158203125,
-0.0092010498046875,
-0.0016469955444335938,
-0.01064300537109375,
-0.021697998046875,
0.0026111602783203125,
0.017852783203125,
0.00762939453125,
-0.0040283203125,
-0.0033092498779296875,
-0.0122833251953125,
0.03704833984375,
-0.00647735595703125,
-0.0318603515625,
-0.00812530517578125,
-0.014373779296875,
0.038238525390625,
-0.0163726806640625,
-0.050018310546875,
0.015045166015625,
0.033966064453125,
-0.032135009765625,
-0.00397491455078125,
-0.0223388671875,
-0.0280609130859375,
-0.04644775390625,
0.034149169921875,
0.0797119140625,
-0.03509521484375,
-0.0286865234375,
-0.0202178955078125,
0.00540924072265625,
0.046173095703125,
-0.03680419921875,
-0.013824462890625,
0.021575927734375,
0.00063323974609375,
-0.0200958251953125,
-0.056304931640625,
-0.0027217864990234375,
-0.03704833984375,
-0.00449371337890625,
0.005634307861328125,
-0.01035308837890625,
0.0205535888671875,
-0.0251617431640625,
-0.041229248046875,
0.07830810546875,
0.00196075439453125,
-0.016082763671875,
-0.046112060546875,
0.0029296875,
-0.0095367431640625,
0.02294921875,
-0.00701904296875,
-0.03594970703125,
-0.043853759765625,
0.01158905029296875,
0.001110076904296875,
0.073486328125,
-0.0217437744140625,
0.0352783203125,
0.017120361328125,
0.03497314453125,
0.0161285400390625,
-0.0178375244140625,
0.038330078125,
-0.017303466796875,
0.05035400390625,
0.048736572265625,
-0.0192718505859375,
0.03857421875,
-0.00908660888671875,
-0.043548583984375,
-0.0011854171752929688,
-0.032470703125,
-0.03082275390625,
-0.0266571044921875,
0.06414794921875,
0.02154541015625,
0.01520538330078125,
-0.014739990234375,
-0.002834320068359375,
-0.026580810546875,
-0.054718017578125,
-0.00792694091796875,
0.04022216796875,
-0.041900634765625,
0.009979248046875,
-0.01132965087890625,
0.0206451416015625,
-0.0250091552734375,
-0.015899658203125,
0.0006122589111328125,
-0.0162506103515625,
0.0279388427734375,
0.0005512237548828125,
0.002002716064453125,
0.02142333984375,
0.0157012939453125,
-0.00885009765625,
-0.0021762847900390625,
-0.01274871826171875,
0.0018148422241210938,
0.003917694091796875,
-0.0179443359375,
-0.0144500732421875,
0.01885986328125,
-0.005161285400390625,
0.00905609130859375,
0.0135650634765625,
0.01739501953125,
-0.003986358642578125,
0.01294708251953125,
0.0080108642578125,
0.0191650390625,
-0.00798797607421875,
0.01152801513671875,
-0.0186309814453125,
0.054107666015625,
-0.00591278076171875,
0.04925537109375,
0.017608642578125,
-0.00933074951171875,
0.0095672607421875,
0.042999267578125,
-0.047332763671875,
-0.0035037994384765625,
-0.049774169921875,
-0.04339599609375,
-0.001155853271484375,
-0.01458740234375,
-0.046722412109375,
-0.0162811279296875,
-0.01270294189453125,
-0.00995635986328125,
-0.02947998046875,
0.007350921630859375
] |
d1b4a5e702f61c41d810e3555c75e569fbf0bf16
|
Wordpress Stackexchange
Q: Uploading DB to server from local is not matching the post dates I just created a custom WP CMS and am having trouble with the custom post maintaining the correct order on the front-end. In the back end the date order is correct but is not being reflected on the front-end in the same order. When I download the DB to my local machine, the order is right but once on the server, it shows up differently?
A: WordPress uses the date_default_timezone_set() function to set the server timezone. This is based on the timezone offset setting under Settings->General.
Check your setting to make sure it matches your timezone at: http://yourdomain.com/wp-admin/options-general.php
If changing your timezone via the setting doesn't work, there's probably nothing you can do to change this without touching your server configuration. You need to speak to your host and have them set your server timezone to the correct offset.
If you have access to your php.ini file, search for the following setting and set your timezone:
date.timezone = “”
Hope this helps you out.
|
Q: Uploading DB to server from local is not matching the post dates I just created a custom WP CMS and am having trouble with the custom post maintaining the correct order on the front-end. In the back end the date order is correct but is not being reflected on the front-end in the same order. When I download the DB to my local machine, the order is right but once on the server, it shows up differently?
A: WordPress uses the date_default_timezone_set() function to set the server timezone. This is based on the timezone offset setting under Settings->General.
Check your setting to make sure it matches your timezone at: http://yourdomain.com/wp-admin/options-general.php
If changing your timezone via the setting doesn't work, there's probably nothing you can do to change this without touching your server configuration. You need to speak to your host and have them set your server timezone to the correct offset.
If you have access to your php.ini file, search for the following setting and set your timezone:
date.timezone = “”
Hope this helps you out.
|
wordpress
|
{
"language": "en",
"length": 177,
"provenance": "stackexchange_00019.jsonl.gz:420288",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53323"
}
|
[
0.0304107666015625,
0.01288604736328125,
-0.0304412841796875,
-0.01470947265625,
0.01739501953125,
-0.04705810546875,
0.041473388671875,
-0.0185089111328125,
0.0253143310546875,
0.001964569091796875,
0.00152587890625,
-0.03790283203125,
-0.0077056884765625,
-0.04193115234375,
-0.02398681640625,
-0.032318115234375,
0.0567626953125,
-0.026123046875,
0.006160736083984375,
-0.0021343231201171875,
-0.01215362548828125,
0.048858642578125,
-0.0172271728515625,
0.08990478515625,
0.057464599609375,
-0.0067291259765625,
0.057586669921875,
-0.01242828369140625,
0.05914306640625,
0.00983428955078125,
0.04736328125,
-0.0660400390625,
0.0180206298828125,
-0.00438690185546875,
0.009429931640625,
-0.036895751953125,
0.02947998046875,
-0.004791259765625,
-0.02197265625,
0.048614501953125,
0.0242156982421875,
-0.0192413330078125,
0.039947509765625,
-0.00244140625,
0.0225982666015625,
-0.039215087890625,
0.046356201171875,
-0.053436279296875,
0.01024627685546875,
-0.0033817291259765625,
-0.0243072509765625,
-0.04144287109375,
-0.00902557373046875,
-0.027374267578125,
-0.017669677734375,
-0.0380859375,
-0.029876708984375,
0.08050537109375,
0.027557373046875,
-0.01526641845703125,
-0.039886474609375,
-0.0023670196533203125,
0.0093994140625,
-0.004932403564453125,
-0.0157470703125,
0.00786590576171875,
0.0771484375,
-0.0047760009765625,
-0.058380126953125,
-0.0172882080078125,
0.052398681640625,
-0.01558685302734375,
0.00209808349609375,
-0.039093017578125,
-0.0018787384033203125,
0.004711151123046875,
-0.031707763671875,
-0.053955078125,
0.0267181396484375,
-0.00934600830078125,
-0.00836944580078125,
0.018035888671875,
-0.02008056640625,
-0.06793212890625,
0.0260162353515625,
-0.0189208984375,
-0.019195556640625,
-0.005916595458984375,
-0.04656982421875,
-0.01739501953125,
-0.0296783447265625,
-0.019866943359375,
-0.055877685546875,
-0.004352569580078125,
0.0008873939514160156,
-0.0153045654296875,
0.0164031982421875,
0.05609130859375,
-0.032318115234375,
-0.03192138671875,
-0.0200042724609375,
-0.003520965576171875,
-0.025360107421875,
-0.01357269287109375,
0.01412200927734375,
0.00936126708984375,
0.006984710693359375,
-0.0228118896484375,
0.03472900390625,
0.01326751708984375,
-0.0249176025390625,
0.0655517578125,
-0.003559112548828125,
-0.04840087890625,
-0.009246826171875,
0.006992340087890625,
-0.010955810546875,
0.012237548828125,
0.0200958251953125,
-0.0307464599609375,
0.005496978759765625,
0.03662109375,
-0.0574951171875,
-0.051177978515625,
0.0038318634033203125,
-0.0272064208984375,
-0.0229644775390625,
0.01264190673828125,
-0.06561279296875,
0.051544189453125,
-0.02587890625,
0.0227508544921875,
0.07421875,
0.00537872314453125,
-0.01197052001953125,
-0.0242156982421875,
0.0300750732421875,
-0.01413726806640625,
-0.0256805419921875,
0.063232421875,
-0.035888671875,
-0.049896240234375,
-0.01323699951171875,
-0.026641845703125,
-0.0084075927734375,
0.057891845703125,
0.024749755859375,
-0.01013946533203125,
-0.0200042724609375,
-0.062286376953125,
-0.01120758056640625,
-0.0120086669921875,
0.0235595703125,
0.012847900390625,
0.009246826171875,
-0.0408935546875,
0.0215911865234375,
-0.03863525390625,
0.00628662109375,
-0.0294647216796875,
-0.00925445556640625,
-0.0101165771484375,
0.006130218505859375,
-0.0439453125,
-0.056793212890625,
0.00904083251953125,
-0.0194549560546875,
-0.014434814453125,
0.03472900390625,
-0.01861572265625,
0.00724029541015625,
-0.0203094482421875,
0.0355224609375,
-0.00856781005859375,
-0.015289306640625,
0.031494140625,
0.027801513671875,
-0.03656005859375,
-0.01061248779296875,
0.059295654296875,
0.016754150390625,
-0.0111541748046875,
-0.0263671875,
0.02593994140625,
-0.031463623046875,
-0.0014047622680664062,
0.0244598388671875,
0.039947509765625,
-0.0085296630859375,
0.020599365234375,
0.034454345703125,
0.017578125,
-0.0589599609375,
0.0384521484375,
-0.005695343017578125,
0.00685882568359375,
-0.022735595703125,
0.02239990234375,
-0.00600433349609375,
-0.036956787109375,
-0.062225341796875,
0.033660888671875,
-0.006744384765625,
0.03167724609375,
-0.00000864267349243164,
0.032745361328125,
-0.020599365234375,
0.03875732421875,
0.03173828125,
-0.002197265625,
0.0014514923095703125,
0.014404296875,
-0.0225982666015625,
-0.048004150390625,
-0.04364013671875,
0.0513916015625,
-0.0023097991943359375,
0.037261962890625,
-0.0236053466796875,
0.0278778076171875,
-0.059356689453125,
-0.050872802734375,
-0.049896240234375,
0.007740020751953125,
0.0179443359375,
0.011932373046875,
-0.01087188720703125,
-0.0012807846069335938,
0.047637939453125,
0.02069091796875,
0.0141754150390625,
0.0021953582763671875,
0.0033721923828125,
0.015838623046875,
-0.05377197265625,
-0.0221405029296875,
-0.04107666015625,
-0.0240325927734375,
0.0035037994384765625,
0.051971435546875,
0.0144500732421875,
-0.01548004150390625,
0.0245513916015625,
0.06646728515625,
-0.002208709716796875,
-0.03594970703125,
0.0224151611328125,
0.0165557861328125,
0.0097808837890625,
0.0426025390625,
-0.0312347412109375,
-0.02252197265625,
0.01293182373046875,
-0.10693359375,
-0.00449371337890625,
0.04974365234375,
-0.031494140625,
-0.023101806640625,
0.00817108154296875,
0.006473541259765625,
0.00832366943359375,
-0.051483154296875,
-0.036529541015625,
-0.0256195068359375,
0.0171966552734375,
-0.0178680419921875,
0.03326416015625,
0.017608642578125,
-0.0256805419921875,
-0.006641387939453125,
0.0228729248046875,
0.0007066726684570312,
0.0146331787109375,
-0.031097412109375,
-0.0214996337890625,
0.0271148681640625,
-0.023162841796875,
0.0177459716796875,
0.0213775634765625,
-0.01456451416015625,
-0.0240325927734375,
0.00989532470703125,
-0.0115203857421875,
-0.005596160888671875,
-0.00894927978515625,
-0.058624267578125,
0.036529541015625,
0.047821044921875,
0.0139007568359375,
-0.011138916015625,
0.033966064453125,
-0.0206298828125,
-0.048126220703125,
0.03131103515625,
0.00240325927734375,
-0.057525634765625,
-0.01097869873046875,
-0.00994110107421875,
0.02191162109375,
-0.00806427001953125,
0.00801849365234375,
0.0518798828125,
0.0018863677978515625,
0.00748443603515625,
-0.0022830963134765625,
0.05145263671875,
0.0109710693359375,
0.0008492469787597656,
-0.0022907257080078125,
-0.00397491455078125,
-0.054351806640625,
-0.03692626953125,
0.024200439453125,
0.0099945068359375,
0.0093231201171875,
-0.0188446044921875,
-0.01305389404296875,
0.0164031982421875,
-0.0704345703125,
-0.06341552734375,
-0.0222930908203125,
-0.01096343994140625,
-0.0174407958984375,
-0.00107574462890625,
-0.004863739013671875,
-0.00009572505950927734,
-0.01244354248046875,
0.001556396484375,
0.0589599609375,
-0.04351806640625,
-0.00826263427734375,
-0.02923583984375,
-0.044036865234375,
-0.055755615234375,
0.03192138671875,
-0.006694793701171875,
-0.01629638671875,
0.10406494140625,
0.0186920166015625,
-0.048126220703125,
-0.03515625,
-0.0070037841796875,
-0.02642822265625,
-0.02569580078125,
0.0108184814453125,
-0.0261383056640625,
0.06182861328125,
-0.00753021240234375,
0.034515380859375,
0.037109375,
-0.026763916015625,
-0.02777099609375,
-0.004673004150390625,
-0.005222320556640625,
-0.004787445068359375,
0.0081024169921875,
0.018341064453125,
0.024444580078125,
0.0193634033203125,
-0.0302276611328125,
-0.0244903564453125,
-0.0162200927734375,
-0.04119873046875,
-0.004383087158203125,
0.01103973388671875,
0.00417327880859375,
-0.056976318359375,
0.056304931640625,
0.022979736328125,
0.0194549560546875,
0.02276611328125,
-0.005329132080078125,
0.0107879638671875,
0.0015926361083984375,
-0.0002987384796142578,
-0.01788330078125,
0.027862548828125,
-0.016815185546875,
-0.0015897750854492188,
0.0035076141357421875,
-0.0070037841796875,
-0.0277557373046875,
-0.02288818359375,
-0.090576171875,
-0.11151123046875,
0.0582275390625,
-0.037200927734375,
-0.01934814453125,
-0.04034423828125,
-0.03204345703125,
0.01224517822265625,
0.11322021484375,
-0.0589599609375,
-0.0088348388671875,
0.02825927734375,
0.023834228515625,
-0.0264434814453125,
-0.01229095458984375,
-0.044464111328125,
-0.0038356781005859375,
-0.03125,
-0.0036373138427734375,
-0.0116119384765625,
-0.00591278076171875,
-0.002292633056640625,
-0.010040283203125,
-0.005695343017578125,
-0.04144287109375,
0.051727294921875,
-0.0263519287109375,
0.0225830078125,
-0.0019092559814453125,
-0.0008416175842285156,
-0.024871826171875,
-0.0263671875,
-0.01110076904296875,
-0.08953857421875,
-0.0191192626953125,
-0.02716064453125,
0.05328369140625,
0.01424407958984375,
-0.009521484375,
-0.0191192626953125,
0.044189453125,
0.022369384765625,
0.01479339599609375,
0.018310546875,
-0.026763916015625,
0.044036865234375,
0.00045561790466308594,
0.0149078369140625,
-0.0253448486328125,
-0.00879669189453125,
-0.00873565673828125,
-0.04052734375,
0.00440216064453125,
-0.00653839111328125,
0.005832672119140625,
0.01552581787109375,
-0.0237274169921875,
-0.0263214111328125,
-0.0242767333984375,
-0.034027099609375,
0.0217437744140625,
-0.0207977294921875,
-0.00029397010803222656,
-0.0305023193359375,
-0.060302734375,
0.03887939453125,
-0.03472900390625,
-0.00038933753967285156,
0.0001914501190185547,
0.075439453125,
0.01495361328125,
-0.0112762451171875,
-0.033447265625,
-0.007755279541015625,
0.03509521484375,
0.0308990478515625,
0.033111572265625,
0.01174163818359375,
-0.014678955078125,
0.06072998046875,
0.0214691162109375,
-0.00833892822265625,
-0.00690460205078125,
0.061431884765625,
0.01306915283203125,
-0.00794219970703125,
0.01157379150390625,
-0.003253936767578125,
-0.0084991455078125,
-0.004856109619140625,
0.0052642822265625,
0.004673004150390625,
0.026885986328125,
0.00861358642578125,
0.00890350341796875,
-0.0224609375,
-0.0180511474609375,
-0.0540771484375,
0.04132080078125,
-0.0819091796875,
0.0101165771484375,
-0.01068878173828125,
0.00406646728515625,
-0.00637054443359375,
-0.01519775390625,
0.020782470703125,
-0.002857208251953125,
-0.00872039794921875,
0.0037517547607421875,
0.0168914794921875,
0.0190277099609375,
0.004192352294921875,
0.01050567626953125,
-0.0234832763671875,
0.099609375,
0.0440673828125,
-0.0149993896484375,
0.03033447265625,
-0.015411376953125,
-0.01561737060546875,
-0.01043701171875,
-0.0244903564453125,
0.005809783935546875,
-0.005153656005859375,
0.01849365234375,
-0.0030422210693359375,
-0.01279449462890625,
0.004467010498046875,
-0.02923583984375,
0.0174407958984375,
0.01248931884765625,
-0.008941650390625,
0.011138916015625,
0.0245513916015625,
0.034423828125,
-0.009124755859375,
-0.023345947265625,
0.01134490966796875,
-0.00457763671875,
0.045501708984375,
0.0246124267578125,
-0.0161590576171875,
-0.0084075927734375,
0.034515380859375,
-0.01560211181640625,
-0.0211181640625,
-0.004962921142578125,
-0.017120361328125,
-0.00820159912109375,
-0.005352020263671875,
0.00421905517578125,
0.05743408203125,
0.00981903076171875,
-0.017791748046875,
0.003265380859375,
-0.00487518310546875,
-0.00815582275390625,
-0.0255126953125,
-0.013946533203125,
0.024505615234375,
0.0210113525390625,
-0.00843048095703125,
-0.0164794921875,
-0.037322998046875,
0.0301361083984375,
-0.0196685791015625,
0.030975341796875,
-0.017547607421875,
-0.038543701171875,
0.00428009033203125,
-0.03704833984375,
-0.031585693359375,
0.02667236328125,
0.0216827392578125,
-0.020843505859375,
-0.0236663818359375,
0.03887939453125,
-0.0286712646484375,
0.01617431640625,
-0.0308074951171875,
0.01386260986328125,
-0.09393310546875,
0.02044677734375,
0.0288238525390625,
0.017669677734375,
-0.03253173828125,
-0.0215606689453125,
-0.08123779296875,
-0.0254364013671875,
-0.04241943359375,
-0.0186920166015625,
-0.02459716796875,
0.0257415771484375,
0.027679443359375,
0.04510498046875,
-0.0213470458984375,
-0.0723876953125,
-0.0182952880859375,
-0.01081085205078125,
0.03741455078125,
0.036407470703125,
-0.01404571533203125,
0.080810546875,
-0.01947021484375,
0.06280517578125,
0.0142669677734375,
0.017425537109375,
-0.038055419921875,
-0.01036834716796875,
0.0090484619140625,
-0.05914306640625,
-0.038970947265625,
0.00909423828125,
-0.0204620361328125,
0.03887939453125,
0.0078582763671875,
0.0026683807373046875,
0.00574493408203125,
-0.0124053955078125,
0.0209808349609375,
-0.029510498046875,
0.01540374755859375,
-0.03192138671875,
-0.0008425712585449219,
-0.021759033203125,
0.0091400146484375,
0.04681396484375,
0.0022716522216796875,
-0.0054168701171875,
-0.013580322265625,
-0.002490997314453125,
0.005756378173828125,
-0.0066070556640625,
0.0169830322265625,
0.0006604194641113281,
0.04083251953125,
0.02490234375,
0.07012939453125,
0.032867431640625,
0.045318603515625,
0.047882080078125,
0.01322174072265625,
-0.05352783203125,
-0.03643798828125,
-0.0214080810546875,
-0.0128173828125,
-0.031341552734375,
-0.036346435546875,
-0.00860595703125,
0.021026611328125,
0.0452880859375,
0.0550537109375,
-0.07415771484375,
0.0115203857421875,
0.00901031494140625,
-0.0250091552734375,
0.012451171875,
-0.005908966064453125,
0.007427215576171875,
0.021270751953125,
0.012481689453125,
-0.01512908935546875,
-0.0241851806640625,
0.0022430419921875,
0.0016431808471679688,
-0.0010280609130859375,
-0.0150146484375,
0.05047607421875,
0.003551483154296875,
-0.01361846923828125,
-0.01111602783203125,
0.002559661865234375,
0.004367828369140625,
0.0164642333984375,
-0.00263214111328125,
-0.006900787353515625,
-0.033966064453125,
-0.045745849609375,
-0.03125,
-0.0257568359375,
-0.0193939208984375,
0.041717529296875,
-0.022186279296875,
0.043914794921875,
0.021759033203125,
0.0013856887817382812,
0.0007700920104980469,
-0.016693115234375,
0.0172576904296875,
0.0270233154296875,
-0.00888824462890625,
0.0044097900390625,
-0.0017385482788085938,
-0.048583984375,
0.0131378173828125,
-0.0282745361328125,
-0.00949859619140625,
-0.005252838134765625,
-0.0572509765625,
0.01428985595703125,
-0.02923583984375,
0.007366180419921875,
0.0233154296875,
0.015625,
0.0094757080078125,
0.000545501708984375,
0.01666259765625,
-0.0416259765625,
-0.0005407333374023438,
0.01520538330078125,
-0.0135955810546875,
-0.018402099609375,
0.01148223876953125,
-0.034698486328125,
0.057952880859375,
-0.00827789306640625,
-0.00420379638671875,
0.0176544189453125,
0.03448486328125,
-0.01035308837890625,
0.0169830322265625,
-0.03424072265625,
0.040283203125,
0.0028076171875,
0.024139404296875,
-0.09844970703125,
-0.02301025390625,
-0.015106201171875,
0.053741455078125,
0.040802001953125,
0.00392913818359375,
-0.04095458984375,
0.006679534912109375,
0.0714111328125,
0.0513916015625,
0.01537322998046875,
0.038055419921875,
-0.0120391845703125,
0.0185394287109375,
-0.01477813720703125,
-0.00608062744140625,
0.021881103515625,
0.0081634521484375,
-0.0521240234375,
0.01519012451171875,
0.037261962890625,
0.048736572265625,
-0.00760650634765625,
0.0006022453308105469,
-0.01340484619140625,
-0.0175018310546875,
0.038543701171875,
-0.031585693359375,
-0.0125579833984375,
0.0250091552734375,
0.0316162109375,
-0.0972900390625,
-0.048828125,
-0.031524658203125,
0.0289306640625,
0.00887298583984375,
0.007598876953125,
0.011688232421875,
0.027984619140625,
-0.01432037353515625,
-0.0186004638671875,
-0.0098114013671875,
0.000060617923736572266,
-0.0311737060546875,
0.03167724609375,
0.04541015625,
0.035858154296875,
-0.028564453125,
-0.0584716796875,
0.0655517578125,
0.0601806640625,
-0.016876220703125,
0.0111541748046875,
0.02178955078125,
-0.0201416015625,
-0.0243988037109375,
-0.056610107421875,
-0.03253173828125,
-0.06494140625,
-0.049896240234375,
0.0015439987182617188,
-0.0233612060546875,
0.0162200927734375,
0.0372314453125,
0.0214691162109375,
0.052642822265625,
-0.02557373046875,
-0.0504150390625,
-0.037322998046875,
0.041473388671875,
0.024993896484375,
0.03753662109375,
-0.046417236328125,
0.074462890625,
-0.0288543701171875,
-0.00019943714141845703,
0.00902557373046875,
0.018585205078125,
0.0046234130859375,
-0.0210113525390625,
-0.02947998046875,
-0.04736328125,
0.007434844970703125,
0.038604736328125,
0.006977081298828125,
-0.0031585693359375,
0.045501708984375,
0.042755126953125,
-0.0225982666015625,
-0.0174560546875,
0.06781005859375,
-0.00736236572265625,
-0.053802490234375,
-0.048797607421875,
-0.0042266845703125,
0.019439697265625,
0.01535797119140625,
0.022705078125,
0.0235595703125,
0.011260986328125,
-0.0049591064453125,
0.0241851806640625,
0.0003848075866699219,
-0.021331787109375,
0.048797607421875,
-0.0091094970703125,
0.07421875,
0.01044464111328125,
0.044586181640625,
0.016357421875,
-0.0102996826171875,
-0.025390625,
0.01123046875,
0.038848876953125,
0.042083740234375,
-0.03387451171875,
0.01910400390625,
-0.0445556640625,
-0.0037708282470703125,
0.03350830078125,
0.0325927734375,
-0.01386260986328125,
-0.01364898681640625,
-0.01470947265625,
-0.058837890625,
-0.024810791015625,
-0.006641387939453125,
0.028656005859375,
-0.02252197265625,
0.0665283203125,
-0.00040602684020996094,
0.0189361572265625,
0.0153961181640625,
0.023712158203125,
-0.04486083984375,
-0.0010709762573242188,
0.0147857666015625,
-0.0293731689453125,
-0.0007104873657226562,
0.003173828125,
-0.00980377197265625,
-0.01111602783203125,
0.0298919677734375,
-0.0303497314453125,
-0.01073455810546875,
-0.04583740234375,
0.0245819091796875,
0.01462554931640625,
0.006053924560546875,
-0.025543212890625,
-0.0020084381103515625,
0.043426513671875,
0.004550933837890625,
0.00527191162109375,
0.013702392578125,
0.016143798828125,
0.038970947265625,
-0.0007581710815429688,
-0.0247955322265625,
0.058013916015625,
-0.07293701171875,
0.10113525390625,
0.044921875,
-0.032470703125,
-0.00817108154296875,
-0.027618408203125,
-0.01611328125,
-0.008148193359375,
0.01033782958984375,
0.0005960464477539062,
-0.0128021240234375,
-0.014373779296875,
0.0242462158203125,
0.034942626953125,
0.036895751953125,
-0.0040740966796875,
-0.00202178955078125,
0.054840087890625,
-0.0222625732421875,
-0.03643798828125,
-0.01837158203125,
-0.0116729736328125,
-0.031341552734375,
0.006359100341796875,
0.03668212890625,
-0.004459381103515625,
0.0219573974609375,
-0.04376220703125,
-0.02545166015625,
0.0112762451171875,
-0.0292510986328125,
0.025299072265625,
-0.042877197265625,
-0.035919189453125,
0.0036067962646484375,
-0.0225372314453125,
-0.01019287109375,
-0.0196990966796875,
0.0196990966796875,
0.01329803466796875,
-0.03363037109375,
-0.053619384765625,
0.030120849609375,
-0.0474853515625,
-0.0137481689453125,
0.00849151611328125,
0.02276611328125,
-0.0247344970703125,
-0.030792236328125,
-0.0271759033203125,
0.0208892822265625,
-0.034881591796875,
-0.031768798828125,
0.009246826171875,
-0.0020351409912109375,
-0.02655029296875,
-0.042938232421875,
0.0206756591796875,
-0.06915283203125,
0.003925323486328125,
-0.051849365234375,
0.0199127197265625,
0.01172637939453125,
-0.04205322265625,
-0.0662841796875,
0.00958251953125,
-0.0179595947265625,
-0.025848388671875,
-0.045806884765625,
-0.004413604736328125,
-0.00783538818359375,
0.031951904296875,
-0.002105712890625,
-0.03759765625,
-0.0263671875,
0.010009765625,
-0.00969696044921875,
0.04803466796875,
0.005603790283203125,
-0.0051727294921875,
-0.03973388671875,
-0.0208282470703125,
-0.02020263671875,
-0.0128173828125,
0.01824951171875,
-0.0082244873046875,
0.0323486328125,
0.05859375,
-0.0009551048278808594,
0.0195770263671875,
0.01532745361328125,
-0.04150390625,
-0.03997802734375,
-0.0230712890625,
-0.02587890625,
-0.01666259765625,
0.076904296875,
0.10101318359375,
0.0174102783203125,
-0.03228759765625,
-0.00540924072265625,
-0.03411865234375,
-0.01157379150390625,
-0.0168304443359375,
0.01387786865234375,
-0.07147216796875,
-0.0191192626953125,
0.02606201171875,
-0.022064208984375,
0.0274505615234375,
-0.0030364990234375,
-0.004940032958984375,
0.00626373291015625,
0.006175994873046875,
-0.033538818359375,
-0.043975830078125,
0.004077911376953125,
0.04058837890625,
-0.035980224609375,
-0.01617431640625,
0.0010938644409179688,
0.0006518363952636719,
-0.0002244710922241211,
0.00714111328125,
-0.00615692138671875,
0.018463134765625,
-0.0174407958984375,
-0.01212310791015625,
0.0253753662109375,
0.002712249755859375,
-0.0019388198852539062,
-0.00476837158203125,
0.00827789306640625,
-0.0258331298828125,
-0.0226898193359375,
-0.048858642578125,
0.038665771484375,
-0.041534423828125,
-0.047210693359375,
0.05133056640625,
-0.01308441162109375,
-0.004154205322265625,
-0.0149078369140625,
0.0192413330078125,
-0.034027099609375,
0.00482940673828125,
0.003589630126953125,
-0.01904296875,
0.006252288818359375,
-0.0250091552734375,
-0.006175994873046875,
-0.0203857421875,
-0.01241302490234375,
-0.05902099609375,
-0.0029163360595703125,
0.012847900390625
] |
3556b2c862eadbe9a53c0fcc5d605b41e1d46b00
|
Wordpress Stackexchange
Q: A Blog's changelog I'm looking for a plugin that would keep track of a all the structural "changes" journal. For instance, the date+time of each wordpress upgrade, or plugin install/update/activation/desactivation or desinstallation, along with the plugin version.
Do you know of anything related?
A: With the help of @toscho, i made this plugin http://wordpress.org/extend/plugins/wp-changes-tracker/
|
Q: A Blog's changelog I'm looking for a plugin that would keep track of a all the structural "changes" journal. For instance, the date+time of each wordpress upgrade, or plugin install/update/activation/desactivation or desinstallation, along with the plugin version.
Do you know of anything related?
A: With the help of @toscho, i made this plugin http://wordpress.org/extend/plugins/wp-changes-tracker/
|
wordpress
|
{
"language": "en",
"length": 55,
"provenance": "stackexchange_00019.jsonl.gz:420306",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53391"
}
|
[
-0.0169525146484375,
-0.02337646484375,
-0.0054168701171875,
-0.0280303955078125,
-0.0400390625,
0.0155181884765625,
-0.0261688232421875,
0.010955810546875,
0.0117950439453125,
0.005283355712890625,
-0.01154327392578125,
0.020172119140625,
-0.04327392578125,
-0.0284423828125,
0.0012483596801757812,
-0.01885986328125,
0.057586669921875,
-0.0361328125,
0.055694580078125,
0.00405120849609375,
-0.01263427734375,
0.042205810546875,
0.08447265625,
0.06903076171875,
0.0269927978515625,
0.032470703125,
0.06756591796875,
-0.00560760498046875,
0.039703369140625,
0.0020961761474609375,
0.027923583984375,
-0.06402587890625,
0.0023193359375,
0.033905029296875,
-0.016632080078125,
0.0272216796875,
0.053314208984375,
0.0111236572265625,
0.0367431640625,
0.005596160888671875,
0.02252197265625,
-0.0032558441162109375,
0.04205322265625,
-0.0143585205078125,
0.017547607421875,
-0.03106689453125,
0.031829833984375,
-0.051788330078125,
-0.00150299072265625,
-0.0239105224609375,
-0.004039764404296875,
0.034210205078125,
0.027496337890625,
-0.023895263671875,
-0.002834320068359375,
0.0008549690246582031,
-0.018280029296875,
0.057159423828125,
0.01947021484375,
0.0009026527404785156,
-0.0281829833984375,
0.016357421875,
0.005916595458984375,
-0.0059051513671875,
-0.019012451171875,
-0.0239410400390625,
-0.03167724609375,
0.0198974609375,
-0.046661376953125,
-0.006023406982421875,
0.06536865234375,
-0.034271240234375,
-0.0162353515625,
0.01453399658203125,
-0.0040740966796875,
-0.019500732421875,
0.01352691650390625,
-0.020263671875,
0.01552581787109375,
0.026947021484375,
0.0057373046875,
-0.00402069091796875,
0.0169830322265625,
-0.036102294921875,
0.0033245086669921875,
-0.00888824462890625,
-0.0035037994384765625,
-0.000362396240234375,
-0.052734375,
-0.004734039306640625,
-0.0362548828125,
0.0140533447265625,
-0.07049560546875,
-0.00023627281188964844,
-0.0032501220703125,
0.006954193115234375,
0.01244354248046875,
0.07177734375,
-0.045928955078125,
-0.02099609375,
-0.053863525390625,
0.00115203857421875,
-0.0626220703125,
-0.005359649658203125,
-0.01593017578125,
0.0236968994140625,
0.0181884765625,
0.045745849609375,
0.0299072265625,
0.028594970703125,
0.006061553955078125,
0.019500732421875,
-0.016754150390625,
-0.006847381591796875,
0.0118865966796875,
0.0172271728515625,
-0.04345703125,
0.053924560546875,
-0.01678466796875,
0.0260467529296875,
0.027801513671875,
0.048614501953125,
-0.051055908203125,
-0.0175018310546875,
-0.03533935546875,
-0.056121826171875,
-0.01629638671875,
-0.00540924072265625,
-0.0308990478515625,
-0.0202484130859375,
-0.034088134765625,
0.0345458984375,
0.040863037109375,
0.0285797119140625,
0.0125579833984375,
-0.0033855438232421875,
0.037811279296875,
-0.0087738037109375,
-0.0213165283203125,
0.0057525634765625,
-0.01454925537109375,
0.0037784576416015625,
0.00634765625,
-0.05450439453125,
-0.0012054443359375,
-0.01183319091796875,
0.0191650390625,
0.044281005859375,
-0.01654052734375,
-0.0299072265625,
0.035125732421875,
0.0098114013671875,
0.048248291015625,
-0.0261688232421875,
0.0111083984375,
-0.05615234375,
0.01222991943359375,
-0.03302001953125,
0.01430511474609375,
-0.03302001953125,
0.0081939697265625,
0.00037741661071777344,
0.0265960693359375,
-0.00794219970703125,
-0.0136566162109375,
-0.00597381591796875,
-0.039093017578125,
0.005657196044921875,
0.0285186767578125,
-0.004329681396484375,
0.01039886474609375,
0.01377105712890625,
0.0513916015625,
0.014739990234375,
0.0034008026123046875,
0.02227783203125,
-0.049285888671875,
-0.029571533203125,
0.03765869140625,
-0.0038700103759765625,
-0.0057220458984375,
-0.006740570068359375,
0.0013513565063476562,
0.03668212890625,
0.00555419921875,
0.0038318634033203125,
0.00476837158203125,
-0.0029735565185546875,
0.0089263916015625,
0.0131378173828125,
-0.005146026611328125,
0.01024627685546875,
-0.047607421875,
0.0292816162109375,
-0.0235748291015625,
0.02886962890625,
-0.0204925537109375,
0.054931640625,
-0.028228759765625,
-0.067138671875,
-0.031707763671875,
0.041656494140625,
-0.040924072265625,
0.03338623046875,
-0.035125732421875,
0.0025634765625,
-0.006633758544921875,
0.0239715576171875,
-0.0009441375732421875,
-0.0015354156494140625,
0.00893402099609375,
-0.00536346435546875,
-0.0033931732177734375,
-0.0195159912109375,
-0.015106201171875,
0.03363037109375,
-0.019256591796875,
-0.027679443359375,
-0.0024471282958984375,
-0.0014715194702148438,
-0.025360107421875,
0.036102294921875,
-0.0273590087890625,
0.001708984375,
0.03936767578125,
-0.0103759765625,
-0.01229095458984375,
-0.02032470703125,
-0.0153961181640625,
0.015869140625,
-0.06329345703125,
0.04693603515625,
-0.006465911865234375,
0.036590576171875,
0.006526947021484375,
-0.03741455078125,
-0.01006317138671875,
-0.115478515625,
0.04498291015625,
0.060150146484375,
0.0084228515625,
0.0291290283203125,
0.0016660690307617188,
0.057342529296875,
0.01505279541015625,
-0.0258941650390625,
0.0027179718017578125,
0.046783447265625,
-0.00665283203125,
0.06610107421875,
0.03155517578125,
0.049591064453125,
-0.003498077392578125,
0.01404571533203125,
0.01078033447265625,
0.03851318359375,
0.0096588134765625,
0.01320648193359375,
-0.04718017578125,
0.0401611328125,
-0.0133209228515625,
-0.00727081298828125,
-0.00839996337890625,
-0.0208587646484375,
0.01194000244140625,
0.01788330078125,
0.04266357421875,
0.05792236328125,
-0.031585693359375,
0.007480621337890625,
0.007434844970703125,
0.031402587890625,
0.01947021484375,
0.04803466796875,
-0.004955291748046875,
0.036956787109375,
-0.0086669921875,
-0.02947998046875,
0.02264404296875,
0.03509521484375,
-0.0455322265625,
-0.0023708343505859375,
0.00424957275390625,
-0.0157928466796875,
-0.007610321044921875,
-0.03582763671875,
0.02740478515625,
-0.0306243896484375,
-0.068359375,
-0.05633544921875,
-0.0008149147033691406,
0.0013875961303710938,
-0.044921875,
-0.0007486343383789062,
0.0105133056640625,
-0.034942626953125,
0.0207977294921875,
-0.035186767578125,
0.0215606689453125,
0.005168914794921875,
0.02618408203125,
0.06121826171875,
0.0362548828125,
-0.024658203125,
0.01099395751953125,
-0.01983642578125,
0.036834716796875,
-0.0176849365234375,
-0.01505279541015625,
0.040496826171875,
-0.10186767578125,
0.0036411285400390625,
0.0249786376953125,
0.02099609375,
0.0027294158935546875,
-0.038543701171875,
-0.031585693359375,
0.016845703125,
-0.07373046875,
-0.040618896484375,
-0.0821533203125,
-0.09783935546875,
0.0219268798828125,
-0.0135498046875,
-0.040496826171875,
0.021148681640625,
0.0290679931640625,
0.03131103515625,
-0.0261688232421875,
-0.01277923583984375,
-0.04296875,
-0.06982421875,
-0.07275390625,
-0.004688262939453125,
-0.0060272216796875,
0.0200347900390625,
-0.005245208740234375,
0.07012939453125,
-0.0096588134765625,
-0.09393310546875,
-0.042877197265625,
-0.0055084228515625,
-0.00832366943359375,
0.013641357421875,
-0.011871337890625,
0.0009627342224121094,
-0.024383544921875,
0.017120361328125,
0.00946807861328125,
0.02679443359375,
-0.017181396484375,
-0.0003578662872314453,
-0.032562255859375,
-0.026275634765625,
0.014129638671875,
-0.042816162109375,
0.01100921630859375,
0.031829833984375,
0.0237579345703125,
-0.0322265625,
0.01548004150390625,
0.009490966796875,
-0.020355224609375,
-0.005496978759765625,
-0.00887298583984375,
-0.01195526123046875,
0.0080413818359375,
-0.016326904296875,
0.0182952880859375,
0.0217742919921875,
0.01593017578125,
0.0008187294006347656,
-0.0001876354217529297,
-0.0207061767578125,
-0.0214385986328125,
-0.029144287109375,
-0.0103607177734375,
-0.035797119140625,
0.02105712890625,
-0.03497314453125,
-0.010894775390625,
-0.036712646484375,
0.0229644775390625,
-0.038604736328125,
-0.015533447265625,
0.01045989990234375,
-0.055755615234375,
0.0233917236328125,
-0.0560302734375,
-0.0090179443359375,
-0.033935546875,
0.06494140625,
-0.08612060546875,
0.01514434814453125,
0.010040283203125,
-0.00806427001953125,
0.02374267578125,
-0.006984710693359375,
-0.09051513671875,
-0.0139923095703125,
-0.04913330078125,
0.00366973876953125,
-0.0008559226989746094,
-0.0284576416015625,
-0.004215240478515625,
0.01983642578125,
-0.0262603759765625,
-0.032958984375,
0.037506103515625,
0.0116729736328125,
0.008514404296875,
-0.03717041015625,
0.004489898681640625,
-0.03900146484375,
0.00443267822265625,
-0.002254486083984375,
-0.038299560546875,
-0.007183074951171875,
-0.026580810546875,
0.043670654296875,
0.03759765625,
-0.050872802734375,
-0.004802703857421875,
0.021820068359375,
-0.0260467529296875,
0.005641937255859375,
0.004802703857421875,
0.0299072265625,
-0.009552001953125,
-0.007843017578125,
-0.0035457611083984375,
-0.036712646484375,
-0.0246124267578125,
-0.036346435546875,
-0.0170745849609375,
0.0167236328125,
-0.00769805908203125,
0.038665771484375,
0.00734710693359375,
0.00418853759765625,
0.01702880859375,
-0.0158233642578125,
0.0178680419921875,
0.040313720703125,
-0.00852203369140625,
0.02178955078125,
-0.0238189697265625,
0.0265960693359375,
0.035614013671875,
0.01300048828125,
-0.016265869140625,
0.006931304931640625,
0.051727294921875,
0.007717132568359375,
-0.0065765380859375,
-0.0789794921875,
-0.00616455078125,
0.04693603515625,
0.007404327392578125,
0.0430908203125,
0.025146484375,
-0.038360595703125,
0.065185546875,
0.00867462158203125,
-0.021942138671875,
-0.0157623291015625,
0.00127410888671875,
0.00839996337890625,
-0.029571533203125,
0.0133819580078125,
-0.007289886474609375,
0.048736572265625,
0.030364990234375,
-0.01053619384765625,
-0.018096923828125,
-0.0209197998046875,
0.0228424072265625,
-0.051788330078125,
0.0880126953125,
0.02239990234375,
-0.0423583984375,
0.02337646484375,
-0.005340576171875,
0.0072021484375,
0.01776123046875,
-0.019256591796875,
0.00533294677734375,
-0.0072479248046875,
-0.01381683349609375,
-0.0293731689453125,
-0.0335693359375,
-0.00865936279296875,
0.022613525390625,
-0.0303955078125,
-0.005001068115234375,
-0.01184844970703125,
-0.02276611328125,
0.055999755859375,
-0.01194000244140625,
-0.09765625,
0.0570068359375,
-0.0203704833984375,
-0.0219573974609375,
0.053558349609375,
-0.0254364013671875,
0.07379150390625,
0.040130615234375,
-0.02386474609375,
-0.028350830078125,
-0.050750732421875,
-0.00534820556640625,
-0.0601806640625,
-0.0236358642578125,
-0.0177459716796875,
-0.026519775390625,
0.042572021484375,
0.00904083251953125,
-0.03759765625,
0.0258941650390625,
-0.00754547119140625,
0.0290679931640625,
0.0178680419921875,
0.0007228851318359375,
0.03472900390625,
-0.017822265625,
-0.002490997314453125,
-0.040618896484375,
0.001514434814453125,
-0.0068206787109375,
0.013641357421875,
-0.0080413818359375,
0.0107574462890625,
0.00888824462890625,
-0.00774383544921875,
0.0274810791015625,
-0.0325927734375,
0.0017681121826171875,
0.0191192626953125,
0.034820556640625,
-0.01308441162109375,
0.0254364013671875,
0.0196075439453125,
0.011749267578125,
-0.01222991943359375,
0.0193939208984375,
-0.055511474609375,
-0.0237884521484375,
-0.041656494140625,
-0.03515625,
-0.062469482421875,
-0.01666259765625,
0.011474609375,
-0.058013916015625,
-0.011016845703125,
0.0308685302734375,
-0.0643310546875,
-0.055877685546875,
-0.00934600830078125,
-0.00438690185546875,
0.041839599609375,
-0.0142364501953125,
0.055206298828125,
-0.028778076171875,
-0.0304718017578125,
-0.0150909423828125,
0.004558563232421875,
0.0462646484375,
0.035064697265625,
-0.03472900390625,
-0.01200103759765625,
-0.035064697265625,
-0.037384033203125,
-0.05975341796875,
-0.0218658447265625,
-0.059051513671875,
0.00131988525390625,
0.007595062255859375,
0.004425048828125,
0.01151275634765625,
0.006412506103515625,
-0.004306793212890625,
0.005123138427734375,
-0.005878448486328125,
-0.0003619194030761719,
-0.001415252685546875,
0.05224609375,
0.01450347900390625,
0.06622314453125,
0.027252197265625,
0.0277252197265625,
-0.05548095703125,
-0.0286407470703125,
0.031280517578125,
0.0159912109375,
-0.05169677734375,
-0.0299224853515625,
-0.0263824462890625,
-0.0386962890625,
0.035614013671875,
-0.01448822021484375,
-0.020660400390625,
-0.006877899169921875,
0.005413055419921875,
-0.006862640380859375,
0.022186279296875,
0.032379150390625,
-0.0367431640625,
0.0684814453125,
-0.0057220458984375,
-0.01410675048828125,
-0.027496337890625,
0.0198516845703125,
-0.01222991943359375,
0.0084381103515625,
-0.0189971923828125,
-0.0228118896484375,
0.0190887451171875,
-0.02825927734375,
0.02056884765625,
0.0168609619140625,
0.039825439453125,
0.0288848876953125,
0.039794921875,
0.00911712646484375,
-0.03253173828125,
0.0618896484375,
0.00949859619140625,
0.042633056640625,
-0.0056610107421875,
0.00981903076171875,
0.050445556640625,
-0.034088134765625,
0.023468017578125,
-0.03265380859375,
0.0271759033203125,
-0.03668212890625,
0.069580078125,
0.007511138916015625,
0.0259552001953125,
0.09423828125,
-0.0009074211120605469,
0.0033626556396484375,
-0.0010700225830078125,
-0.0254058837890625,
0.0016450881958007812,
-0.0280609130859375,
-0.034515380859375,
0.0206298828125,
-0.00971221923828125,
-0.006641387939453125,
0.051605224609375,
0.033111572265625,
-0.033477783203125,
0.0229339599609375,
0.0233917236328125,
0.0189208984375,
-0.03387451171875,
0.01291656494140625,
0.01343536376953125,
0.0042877197265625,
-0.03778076171875,
0.06298828125,
-0.004077911376953125,
0.023651123046875,
-0.0037994384765625,
-0.00033783912658691406,
0.0168304443359375,
0.052215576171875,
-0.0186767578125,
-0.0170745849609375,
0.045379638671875,
-0.01202392578125,
-0.0275421142578125,
-0.038818359375,
0.0081024169921875,
0.021942138671875,
-0.0137481689453125,
0.027618408203125,
0.005657196044921875,
-0.03985595703125,
-0.0011730194091796875,
0.038299560546875,
0.0736083984375,
-0.0289306640625,
-0.028411865234375,
0.0142822265625,
-0.01474761962890625,
0.0010833740234375,
-0.00478363037109375,
0.002376556396484375,
-0.054443359375,
-0.0016002655029296875,
-0.0038299560546875,
0.00028634071350097656,
-0.002750396728515625,
-0.00142669677734375,
-0.0484619140625,
0.10809326171875,
0.0017042160034179688,
0.003093719482421875,
0.0261383056640625,
0.0355224609375,
-0.0614013671875,
-0.004467010498046875,
-0.03375244140625,
0.07427978515625,
-0.0174407958984375,
0.04437255859375,
-0.031646728515625,
0.00600433349609375,
0.021636962890625,
0.020477294921875,
0.049835205078125,
0.01953125,
-0.01457977294921875,
-0.01708984375,
-0.00180816650390625,
-0.004058837890625,
-0.027374267578125,
0.04949951171875,
-0.007114410400390625,
0.014892578125,
0.0186920166015625,
-0.01134490966796875,
0.048370361328125,
-0.038360595703125,
-0.033966064453125,
0.00591278076171875,
0.010162353515625,
0.0174560546875,
-0.02978515625,
0.0194244384765625,
0.0219573974609375,
-0.024505615234375,
-0.0118865966796875,
0.0028896331787109375,
0.049896240234375,
0.03765869140625,
0.04766845703125,
0.009124755859375,
0.0253753662109375,
-0.00522613525390625,
0.048797607421875,
-0.026275634765625,
-0.00472259521484375,
-0.00988006591796875,
0.01285552978515625,
-0.031280517578125,
-0.058502197265625,
-0.0257568359375,
0.02191162109375,
-0.043731689453125,
0.000995635986328125,
-0.014923095703125,
0.013397216796875,
-0.0499267578125,
-0.02398681640625,
0.0198211669921875,
0.0106964111328125,
-0.00858306884765625,
-0.04705810546875,
0.0010728836059570312,
-0.0123748779296875,
0.0121307373046875,
-0.0024929046630859375,
-0.00856781005859375,
-0.0396728515625,
0.02130126953125,
0.0149383544921875,
-0.0284423828125,
-0.0079498291015625,
0.01239776611328125,
0.022735595703125,
0.0258941650390625,
0.0030345916748046875,
-0.0147705078125,
-0.01148223876953125,
0.002689361572265625,
-0.011993408203125,
-0.0124664306640625,
0.00293731689453125,
0.032806396484375,
0.0147552490234375,
0.01383209228515625,
0.01580810546875,
0.01995849609375,
-0.0058135986328125,
-0.010406494140625,
-0.00592041015625,
-0.045074462890625,
0.01213836669921875,
0.02978515625,
0.041229248046875,
0.02215576171875,
0.0699462890625,
0.047393798828125,
-0.027191162109375,
0.01454925537109375,
0.021636962890625,
-0.017822265625,
-0.0007061958312988281,
-0.02032470703125,
0.0367431640625,
0.053466796875,
0.0168304443359375,
0.01111602783203125,
0.01548004150390625,
0.08184814453125,
0.00527191162109375,
0.0236053466796875,
0.017669677734375,
-0.00601959228515625,
0.0313720703125,
0.0244293212890625,
0.0180816650390625,
0.04388427734375,
-0.0321044921875,
-0.0142974853515625,
-0.00478363037109375,
-0.01806640625,
0.0021152496337890625,
0.0215301513671875,
-0.017974853515625,
0.0301971435546875,
0.005802154541015625,
0.012969970703125,
0.0259857177734375,
-0.038116455078125,
0.00016736984252929688,
0.0226898193359375,
0.024200439453125,
-0.003276824951171875,
-0.0631103515625,
-0.031463623046875,
-0.021759033203125,
0.0291748046875,
0.0159149169921875,
0.031036376953125,
0.0205535888671875,
0.01580810546875,
0.02679443359375,
0.00963592529296875,
-0.00669097900390625,
0.029083251953125,
-0.0012569427490234375,
-0.0127105712890625,
0.0004801750183105469,
-0.01230621337890625,
-0.05859375,
-0.0012664794921875,
0.042449951171875,
-0.0277862548828125,
0.026947021484375,
-0.00962066650390625,
0.004932403564453125,
-0.05889892578125,
-0.044158935546875,
-0.0382080078125,
-0.052215576171875,
0.00753021240234375,
0.022918701171875,
-0.0240325927734375,
-0.03125,
-0.0184326171875,
0.02667236328125,
-0.005229949951171875,
0.006633758544921875,
-0.016998291015625,
-0.0033931732177734375,
-0.050811767578125,
0.01374053955078125,
0.0219573974609375,
-0.0097808837890625,
-0.00010842084884643555,
-0.0137481689453125,
0.0083160400390625,
0.01611328125,
0.0271759033203125,
-0.009735107421875,
0.042388916015625,
-0.0034618377685546875,
0.0163116455078125,
0.045684814453125,
-0.01331329345703125,
0.0187835693359375,
-0.0167236328125,
0.01026153564453125,
0.0013246536254882812,
-0.00868988037109375,
-0.0145263671875,
-0.054046630859375,
-0.0037708282470703125,
0.0028514862060546875,
-0.01947021484375,
-0.017486572265625,
-0.0026340484619140625,
-0.0091400146484375,
0.032470703125,
-0.0211944580078125,
-0.01175689697265625,
0.00007158517837524414,
-0.039154052734375,
0.0171661376953125,
-0.0180206298828125,
-0.031890869140625,
0.0008416175842285156,
0.00458526611328125,
-0.0294189453125,
-0.0445556640625,
-0.052276611328125,
0.03253173828125,
-0.042938232421875,
0.01739501953125,
0.026947021484375,
-0.032440185546875,
0.0018339157104492188,
0.009765625,
0.0311126708984375,
0.050689697265625,
0.03680419921875,
-0.0288848876953125,
0.0195770263671875,
-0.0099639892578125,
0.0213165283203125,
-0.0350341796875,
-0.020965576171875,
-0.0026493072509765625,
-0.005786895751953125,
-0.00945281982421875,
-0.0386962890625,
-0.01454925537109375,
-0.06951904296875,
-0.1041259765625,
0.0389404296875,
-0.02130126953125,
-0.052642822265625,
-0.08782958984375,
0.0107574462890625,
0.0243377685546875,
0.01142120361328125,
-0.0271759033203125,
0.0033817291259765625,
-0.06378173828125,
0.025604248046875,
0.0084381103515625,
-0.0166473388671875,
0.01690673828125,
-0.0203094482421875,
-0.057037353515625,
0.0115966796875,
0.01132965087890625,
-0.00957489013671875,
0.00817108154296875,
-0.029510498046875,
0.0283660888671875,
0.02313232421875,
-0.045135498046875,
-0.040252685546875,
0.0106964111328125,
0.0093536376953125,
-0.004444122314453125,
-0.009765625,
-0.061370849609375,
0.0043487548828125,
0.083740234375,
0.0726318359375,
0.038421630859375,
-0.0511474609375,
-0.00295257568359375,
-0.0218353271484375,
-0.0203399658203125,
-0.0062255859375,
0.00775909423828125,
-0.022369384765625,
0.0220947265625,
-0.02587890625,
-0.0026264190673828125,
-0.038177490234375,
0.01055145263671875,
-0.001895904541015625,
-0.0098876953125,
0.058502197265625,
0.0008635520935058594,
0.01215362548828125,
0.0254974365234375,
0.038330078125,
-0.0028743743896484375,
0.062286376953125,
-0.0111083984375,
-0.0008206367492675781,
0.05584716796875,
0.038421630859375,
0.0204010009765625,
0.03936767578125,
-0.0655517578125,
0.019073486328125,
0.007099151611328125,
0.01495361328125,
-0.051116943359375,
-0.011871337890625,
-0.020782470703125,
0.010009765625,
0.00302886962890625,
-0.01358795166015625,
-0.037139892578125,
0.026611328125,
-0.004215240478515625,
0.10748291015625,
0.026397705078125,
-0.075927734375,
-0.030426025390625,
0.0428466796875,
-0.0210418701171875,
-0.032196044921875,
-0.027130126953125,
-0.041473388671875,
-0.00311279296875,
-0.004302978515625,
-0.015899658203125,
-0.06964111328125,
0.0240936279296875,
-0.0219573974609375,
0.0026378631591796875,
0.0250091552734375
] |
f508b210e2df41760024f02ac0c00affabf1bacc
|
Wordpress Stackexchange
Q: Can I programmatically login a user without a password? I'm manually creating users programmatically, and I want to sign in the newly created user. WP makes it easy to access the hashed password, but not the plaintext version. Is there a way to use wp_signon() without the plaintext password?
I found one person who claims to have done this here, but it didn't work for me.
THANKS!
A: This works well for me:
clean_user_cache($user->ID);
wp_clear_auth_cookie();
wp_set_current_user($user->ID);
wp_set_auth_cookie($user->ID, true, false);
update_user_caches($user);
|
Q: Can I programmatically login a user without a password? I'm manually creating users programmatically, and I want to sign in the newly created user. WP makes it easy to access the hashed password, but not the plaintext version. Is there a way to use wp_signon() without the plaintext password?
I found one person who claims to have done this here, but it didn't work for me.
THANKS!
A: This works well for me:
clean_user_cache($user->ID);
wp_clear_auth_cookie();
wp_set_current_user($user->ID);
wp_set_auth_cookie($user->ID, true, false);
update_user_caches($user);
A: The following code does the job for automatic login, without any password!
// Automatic login //
$username = "Admin";
$user = get_user_by('login', $username );
// Redirect URL //
if ( !is_wp_error( $user ) )
{
wp_clear_auth_cookie();
wp_set_current_user ( $user->ID );
wp_set_auth_cookie ( $user->ID );
$redirect_to = user_admin_url();
wp_safe_redirect( $redirect_to );
exit();
}
A: wp_set_auth_cookie() will log a user in without having to know their password.
A: In addition to Mike, Paul and Sjoerd:
To better handle login.php redirections:
//---------------------Automatic login--------------------
if(!is_user_logged_in()){
$username = "user1";
if($user=get_user_by('login',$username)){
clean_user_cache($user->ID);
wp_clear_auth_cookie();
wp_set_current_user( $user->ID );
wp_set_auth_cookie( $user->ID , true, false);
update_user_caches($user);
if(is_user_logged_in()){
$redirect_to = user_admin_url();
wp_safe_redirect( $redirect_to );
exit;
}
}
}
elseif('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] == wp_login_url()){
$redirect_to = user_admin_url();
wp_safe_redirect( $redirect_to );
exit;
}
To be placed in wp-config.php just after
require_once(ABSPATH . 'wp-settings.php');
FYI
Based on the above solution, I have released a plugin to keep the user logged in from one wordpress to another by synchronizing user data and cookie session:
https://wordpress.org/plugins/user-session-synchronizer/
A: I have found another solution here that uses a better approach (at least in my opinion...).
No need to set any cookie, it uses the Wordpress API:
/**
* Programmatically logs a user in
*
* @param string $username
* @return bool True if the login was successful; false if it wasn't
*/
function programmatic_login( $username ) {
if ( is_user_logged_in() ) {
wp_logout();
}
add_filter( 'authenticate', 'allow_programmatic_login', 10, 3 ); // hook in earlier than other callbacks to short-circuit them
$user = wp_signon( array( 'user_login' => $username ) );
remove_filter( 'authenticate', 'allow_programmatic_login', 10, 3 );
if ( is_a( $user, 'WP_User' ) ) {
wp_set_current_user( $user->ID, $user->user_login );
if ( is_user_logged_in() ) {
return true;
}
}
return false;
}
/**
* An 'authenticate' filter callback that authenticates the user using only the username.
*
* To avoid potential security vulnerabilities, this should only be used in the context of a programmatic login,
* and unhooked immediately after it fires.
*
* @param WP_User $user
* @param string $username
* @param string $password
* @return bool|WP_User a WP_User object if the username matched an existing user, or false if it didn't
*/
function allow_programmatic_login( $user, $username, $password ) {
return get_user_by( 'login', $username );
}
I think the code is self explanatory:
The filter searches for the WP_User object for the given username and returns it.
A call to the function wp_set_current_user with the WP_User object returned by wp_signon, a check with the function is_user_logged_in to make sure your are logged in, and that's it!
A nice and clean piece of code in my opinion!
A: Strange enough but the only way it works for me is if I redirect and die() after:
clean_user_cache($user->ID);
wp_clear_auth_cookie();
wp_set_current_user( $user_id, $user->user_login );
wp_set_auth_cookie( $user_id, true, true );
update_user_caches( $user );
if ( is_user_logged_in() ) {
$redirect_to = $_SERVER['REQUEST_URI'];
header("location:".$redirect_to );
die();
}
|
wordpress
|
{
"language": "en",
"length": 554,
"provenance": "stackexchange_00019.jsonl.gz:420343",
"question_score": "47",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53503"
}
|
[
0.01617431640625,
0.0023708343505859375,
-0.00882720947265625,
-0.0269317626953125,
0.0005593299865722656,
-0.0321044921875,
0.010986328125,
-0.017608642578125,
0.01132965087890625,
0.010894775390625,
-0.0150604248046875,
-0.001880645751953125,
-0.015899658203125,
-0.0263214111328125,
0.0086822509765625,
-0.031951904296875,
0.0179595947265625,
-0.00861358642578125,
0.002559661865234375,
-0.019744873046875,
0.00792694091796875,
-0.0213470458984375,
0.0291595458984375,
0.0207672119140625,
0.00836944580078125,
0.0126800537109375,
0.0628662109375,
-0.03594970703125,
0.0311279296875,
-0.00945281982421875,
0.0163421630859375,
-0.034515380859375,
0.0155792236328125,
0.024993896484375,
-0.0199432373046875,
-0.0184326171875,
-0.038482666015625,
0.0260009765625,
0.0130615234375,
-0.01465606689453125,
0.01271820068359375,
0.01093292236328125,
-0.046173095703125,
0.01922607421875,
-0.053314208984375,
-0.020172119140625,
-0.00870513916015625,
-0.0022869110107421875,
0.01983642578125,
0.0040740966796875,
0.01558685302734375,
0.034423828125,
0.0269775390625,
0.009307861328125,
-0.01165771484375,
-0.006160736083984375,
-0.029296875,
-0.04388427734375,
0.043212890625,
0.004238128662109375,
-0.00928497314453125,
-0.0643310546875,
0.027801513671875,
-0.026885986328125,
0.01383209228515625,
-0.010711669921875,
-0.027099609375,
0.0244598388671875,
-0.00986480712890625,
0.00806427001953125,
0.0104522705078125,
-0.00952911376953125,
0.0033969879150390625,
-0.0228424072265625,
-0.0141448974609375,
0.02435302734375,
-0.007099151611328125,
-0.00516510009765625,
0.02471923828125,
-0.0048675537109375,
0.012847900390625,
0.0090789794921875,
-0.033721923828125,
-0.0161590576171875,
0.005794525146484375,
-0.0032958984375,
-0.00292205810546875,
-0.0166473388671875,
0.001972198486328125,
-0.0027523040771484375,
-0.004390716552734375,
-0.01071929931640625,
0.017486572265625,
0.015167236328125,
-0.0276641845703125,
-0.026947021484375,
-0.014984130859375,
0.044158935546875,
-0.005878448486328125,
0.0248260498046875,
-0.006011962890625,
-0.032135009765625,
0.036651611328125,
-0.041259765625,
-0.0343017578125,
0.04901123046875,
0.0239410400390625,
0.0015649795532226562,
-0.04559326171875,
0.0042266845703125,
-0.0029773712158203125,
-0.08050537109375,
0.0196685791015625,
-0.037994384765625,
0.000005424022674560547,
0.04693603515625,
0.02801513671875,
-0.0093841552734375,
0.00302886962890625,
0.01088714599609375,
-0.06597900390625,
-0.0222320556640625,
-0.0196685791015625,
0.06109619140625,
0.0036258697509765625,
-0.0008401870727539062,
0.0330810546875,
0.0127410888671875,
-0.032867431640625,
0.04150390625,
-0.06341552734375,
0.01407623291015625,
0.0869140625,
0.01348876953125,
-0.00015485286712646484,
-0.039459228515625,
-0.001003265380859375,
-0.041473388671875,
-0.002960205078125,
0.0182952880859375,
0.00574493408203125,
-0.031463623046875,
0.01062774658203125,
0.0079498291015625,
0.0263824462890625,
0.045928955078125,
0.01216888427734375,
-0.00939178466796875,
0.00988006591796875,
-0.0202789306640625,
-0.0096588134765625,
-0.0278167724609375,
-0.0625,
0.05462646484375,
0.09039306640625,
0.047637939453125,
0.063720703125,
-0.0011835098266601562,
0.024688720703125,
0.0321044921875,
0.04034423828125,
-0.0196380615234375,
-0.025115966796875,
0.033203125,
0.00026702880859375,
0.01499176025390625,
-0.0158538818359375,
-0.0003733634948730469,
0.031036376953125,
-0.038116455078125,
0.03985595703125,
-0.006122589111328125,
0.046234130859375,
0.004108428955078125,
0.016143798828125,
0.01456451416015625,
-0.0267181396484375,
0.04437255859375,
0.029144287109375,
-0.0005650520324707031,
-0.0119476318359375,
-0.0185699462890625,
0.0811767578125,
-0.021728515625,
-0.07183837890625,
0.0352783203125,
0.00689697265625,
0.0869140625,
0.035797119140625,
0.02874755859375,
0.00739288330078125,
-0.005123138427734375,
0.0110321044921875,
0.0007691383361816406,
0.0292510986328125,
-0.057403564453125,
0.011688232421875,
-0.038665771484375,
-0.0013904571533203125,
0.004817962646484375,
0.07257080078125,
-0.038818359375,
0.047210693359375,
-0.03033447265625,
-0.036041259765625,
-0.006786346435546875,
-0.021728515625,
0.0011463165283203125,
-0.02532958984375,
0.0191497802734375,
0.0181884765625,
-0.01788330078125,
0.01090240478515625,
-0.04766845703125,
-0.0234527587890625,
-0.0306854248046875,
-0.0123138427734375,
0.06610107421875,
0.009307861328125,
0.059295654296875,
0.033782958984375,
-0.061920166015625,
0.030029296875,
-0.0038089752197265625,
0.0276031494140625,
-0.0169830322265625,
-0.005237579345703125,
-0.023590087890625,
0.063720703125,
-0.033538818359375,
0.057952880859375,
0.024658203125,
-0.01280975341796875,
0.0188446044921875,
-0.02783203125,
-0.01030731201171875,
-0.0232696533203125,
-0.027618408203125,
0.015655517578125,
0.04388427734375,
0.0538330078125,
0.033599853515625,
0.0027141571044921875,
-0.00347900390625,
0.059356689453125,
-0.037353515625,
0.0227508544921875,
-0.02008056640625,
-0.006313323974609375,
0.06634521484375,
0.005832672119140625,
0.017425537109375,
-0.007221221923828125,
-0.06378173828125,
-0.00890350341796875,
0.040374755859375,
0.0023479461669921875,
0.0242462158203125,
0.01407623291015625,
-0.014678955078125,
-0.0031642913818359375,
-0.0225677490234375,
-0.002269744873046875,
-0.0174713134765625,
-0.047454833984375,
-0.0241851806640625,
-0.03460693359375,
-0.031524658203125,
0.00789642333984375,
-0.0203704833984375,
0.0382080078125,
-0.046356201171875,
0.000736236572265625,
0.01177215576171875,
0.03887939453125,
-0.0021266937255859375,
-0.0660400390625,
-0.00023937225341796875,
0.054443359375,
0.01480865478515625,
-0.004364013671875,
-0.0191802978515625,
-0.00910186767578125,
-0.007396697998046875,
0.037078857421875,
0.0011053085327148438,
0.01348876953125,
-0.0007276535034179688,
-0.0260162353515625,
0.0113372802734375,
0.051055908203125,
0.019989013671875,
0.01119232177734375,
-0.00749969482421875,
-0.02252197265625,
0.00988006591796875,
-0.034698486328125,
-0.01070404052734375,
0.01076507568359375,
-0.028656005859375,
0.0023441314697265625,
0.051300048828125,
-0.002414703369140625,
0.0008296966552734375,
0.0004584789276123047,
-0.01145172119140625,
-0.0126495361328125,
0.0240631103515625,
0.00782012939453125,
-0.01953125,
-0.0223388671875,
0.04254150390625,
0.01641845703125,
0.0726318359375,
-0.0213623046875,
-0.03558349609375,
0.0037403106689453125,
0.03521728515625,
-0.014617919921875,
-0.025970458984375,
-0.082763671875,
-0.060089111328125,
0.005649566650390625,
-0.005916595458984375,
-0.0171356201171875,
0.0184783935546875,
0.0218353271484375,
0.0188751220703125,
0.0032672882080078125,
-0.037994384765625,
-0.0206451416015625,
-0.055206298828125,
-0.041015625,
-0.012054443359375,
0.01155853271484375,
-0.003997802734375,
0.0034770965576171875,
-0.00164794921875,
-0.003261566162109375,
0.003116607666015625,
-0.00545501708984375,
0.07135009765625,
-0.0035877227783203125,
-0.062225341796875,
-0.020599365234375,
-0.0233154296875,
0.042205810546875,
-0.014190673828125,
-0.06719970703125,
0.00740814208984375,
0.048797607421875,
-0.023834228515625,
0.00933837890625,
-0.061279296875,
0.01335906982421875,
-0.013519287109375,
-0.0258941650390625,
-0.0162200927734375,
0.0224151611328125,
-0.0572509765625,
0.0030670166015625,
0.00978851318359375,
-0.0257110595703125,
0.0253753662109375,
0.007602691650390625,
-0.025238037109375,
0.03253173828125,
-0.0211029052734375,
0.01239776611328125,
0.0096435546875,
-0.004604339599609375,
0.0173187255859375,
-0.01181793212890625,
-0.012969970703125,
-0.00318145751953125,
0.0032596588134765625,
0.042694091796875,
-0.0236358642578125,
-0.041595458984375,
0.00557708740234375,
0.005184173583984375,
0.01467132568359375,
-0.03790283203125,
-0.01739501953125,
-0.03717041015625,
0.0369873046875,
-0.0171966552734375,
0.0145416259765625,
-0.0548095703125,
-0.026336669921875,
-0.032135009765625,
0.0714111328125,
-0.00960540771484375,
-0.028717041015625,
-0.003936767578125,
0.0245513916015625,
-0.102294921875,
-0.039886474609375,
-0.016998291015625,
0.01837158203125,
0.00420379638671875,
-0.010406494140625,
-0.0172119140625,
-0.0086212158203125,
0.006134033203125,
-0.0648193359375,
0.0179595947265625,
-0.019317626953125,
0.007038116455078125,
0.0029773712158203125,
0.01139068603515625,
-0.046630859375,
0.0210113525390625,
-0.06719970703125,
0.042022705078125,
-0.0208740234375,
-0.06890869140625,
0.0092620849609375,
-0.04705810546875,
0.04949951171875,
0.0277862548828125,
-0.0024433135986328125,
-0.0227508544921875,
0.028289794921875,
-0.01605224609375,
0.0230712890625,
0.0175018310546875,
0.03253173828125,
-0.005680084228515625,
-0.01512908935546875,
0.0037250518798828125,
-0.036834716796875,
-0.0036296844482421875,
-0.0279693603515625,
0.0117034912109375,
0.0260467529296875,
-0.050201416015625,
-0.0012216567993164062,
-0.043975830078125,
0.01166534423828125,
-0.01520538330078125,
-0.017822265625,
-0.01519775390625,
0.0196990966796875,
-0.0181884765625,
0.0190887451171875,
-0.0306549072265625,
-0.0114898681640625,
0.05859375,
-0.013671875,
0.0025081634521484375,
-0.020538330078125,
0.08795166015625,
0.013519287109375,
-0.018463134765625,
-0.00676727294921875,
0.0216064453125,
0.026092529296875,
0.0138702392578125,
0.0121307373046875,
-0.0207061767578125,
-0.034332275390625,
0.0712890625,
-0.00902557373046875,
0.01502227783203125,
0.0213775634765625,
0.01422882080078125,
-0.00901031494140625,
-0.053619384765625,
0.041107177734375,
-0.0002944469451904297,
-0.050567626953125,
-0.0171966552734375,
0.039794921875,
-0.006587982177734375,
0.07135009765625,
-0.01464080810546875,
0.0159454345703125,
-0.0438232421875,
0.021240234375,
-0.03955078125,
0.02447509765625,
-0.04608154296875,
-0.035675048828125,
-0.014312744140625,
0.01163482666015625,
-0.0560302734375,
-0.05029296875,
-0.032318115234375,
-0.03314208984375,
-0.07049560546875,
0.0377197265625,
0.01467132568359375,
-0.0634765625,
0.0007586479187011719,
-0.015960693359375,
-0.031829833984375,
0.11187744140625,
0.011962890625,
-0.0589599609375,
0.022674560546875,
-0.024749755859375,
0.0462646484375,
0.032623291015625,
0.004917144775390625,
0.06219482421875,
-0.0209503173828125,
0.0055389404296875,
0.0023403167724609375,
-0.04608154296875,
-0.0196685791015625,
-0.051025390625,
0.054779052734375,
0.0077972412109375,
-0.0030498504638671875,
0.0085601806640625,
0.051025390625,
-0.017059326171875,
0.032257080078125,
0.006259918212890625,
0.00743865966796875,
0.0234375,
0.0050811767578125,
0.00868988037109375,
0.0243072509765625,
0.008209228515625,
-0.0213623046875,
0.04254150390625,
-0.0098114013671875,
-0.007465362548828125,
0.03277587890625,
0.019500732421875,
0.018768310546875,
0.01071929931640625,
-0.0191802978515625,
-0.0270843505859375,
-0.0225372314453125,
0.030426025390625,
-0.0245361328125,
-0.046356201171875,
-0.0301666259765625,
-0.003337860107421875,
0.0219573974609375,
-0.0208740234375,
0.032562255859375,
-0.059295654296875,
-0.0200347900390625,
-0.027496337890625,
0.02935791015625,
-0.0042266845703125,
-0.04229736328125,
-0.05169677734375,
0.0181427001953125,
-0.03314208984375,
-0.0196533203125,
0.0169525146484375,
0.03240966796875,
-0.035308837890625,
-0.03619384765625,
0.073974609375,
-0.01029205322265625,
0.03387451171875,
-0.0287933349609375,
-0.00933837890625,
-0.004486083984375,
0.0002942085266113281,
0.055694580078125,
0.0174713134765625,
0.007228851318359375,
-0.039306640625,
-0.0214996337890625,
-0.0282440185546875,
-0.01009368896484375,
-0.0224609375,
-0.0160369873046875,
0.0229034423828125,
0.0239715576171875,
0.01337432861328125,
0.0184326171875,
-0.00040411949157714844,
-0.004901885986328125,
0.0244293212890625,
0.0005202293395996094,
0.0543212890625,
-0.0113525390625,
0.043853759765625,
0.01027679443359375,
0.0002015829086303711,
0.0169677734375,
0.04791259765625,
0.0037994384765625,
-0.0194244384765625,
0.0019817352294921875,
0.032958984375,
-0.0161590576171875,
-0.01326751708984375,
0.037628173828125,
-0.035919189453125,
0.02569580078125,
-0.017242431640625,
-0.0162811279296875,
0.0009512901306152344,
0.0021209716796875,
-0.0174713134765625,
0.053863525390625,
0.0330810546875,
-0.00746917724609375,
0.0188140869140625,
-0.001552581787109375,
0.030792236328125,
-0.0037403106689453125,
-0.0017938613891601562,
0.00646209716796875,
-0.00774383544921875,
-0.00009179115295410156,
0.0233154296875,
-0.0328369140625,
0.035491943359375,
0.047149658203125,
-0.04290771484375,
0.0275115966796875,
0.0203399658203125,
-0.01513671875,
0.04345703125,
-0.0159759521484375,
-0.04644775390625,
-0.017730712890625,
0.02703857421875,
0.004558563232421875,
-0.0172271728515625,
0.0377197265625,
-0.0205230712890625,
0.032928466796875,
0.09271240234375,
0.081787109375,
-0.10101318359375,
-0.0036373138427734375,
-0.00839996337890625,
-0.051788330078125,
0.0220947265625,
0.02264404296875,
-0.01526641845703125,
-0.00988006591796875,
0.019378662109375,
-0.031768798828125,
-0.00797271728515625,
0.01165008544921875,
0.001689910888671875,
-0.00872039794921875,
0.005626678466796875,
0.00872039794921875,
0.016693115234375,
-0.0283966064453125,
0.032684326171875,
0.0185089111328125,
0.0611572265625,
-0.011993408203125,
-0.014862060546875,
0.0294952392578125,
-0.026885986328125,
-0.056884765625,
0.0216064453125,
-0.0240631103515625,
-0.02252197265625,
0.0184478759765625,
0.00677490234375,
0.05963134765625,
0.0128631591796875,
0.019012451171875,
-0.01505279541015625,
-0.0255279541015625,
0.0380859375,
0.01247406005859375,
-0.0205230712890625,
-0.0029430389404296875,
-0.019195556640625,
-0.0222320556640625,
0.0113067626953125,
-0.02252197265625,
-0.0208587646484375,
-0.012542724609375,
-0.0254974365234375,
0.0606689453125,
-0.01430511474609375,
-0.007080078125,
0.05609130859375,
0.0026874542236328125,
-0.041839599609375,
-0.01605224609375,
0.01134490966796875,
-0.0380859375,
-0.0143890380859375,
-0.0204315185546875,
-0.043060302734375,
0.0080718994140625,
-0.030609130859375,
-0.0316162109375,
0.0699462890625,
-0.0020236968994140625,
0.004993438720703125,
-0.0003352165222167969,
0.0221405029296875,
0.0259246826171875,
0.038116455078125,
-0.050750732421875,
0.051971435546875,
-0.00975799560546875,
0.03662109375,
-0.0151824951171875,
0.01239776611328125,
0.023529052734375,
-0.0189361572265625,
0.0736083984375,
0.00959014892578125,
-0.03070068359375,
-0.04150390625,
-0.0180816650390625,
0.034637451171875,
-0.023193359375,
0.0265045166015625,
0.01325225830078125,
0.0382080078125,
0.051727294921875,
-0.06689453125,
0.0164642333984375,
-0.021026611328125,
0.021148681640625,
0.0168304443359375,
0.0219573974609375,
-0.0011043548583984375,
0.02423095703125,
0.029693603515625,
-0.0850830078125,
0.0293731689453125,
0.058135986328125,
0.0501708984375,
0.003662109375,
0.0384521484375,
0.0203704833984375,
0.0179290771484375,
-0.001338958740234375,
-0.025054931640625,
0.043212890625,
0.00740814208984375,
-0.00023853778839111328,
0.01372528076171875,
0.04010009765625,
-0.011016845703125,
-0.045806884765625,
-0.0163726806640625,
0.0033931732177734375,
-0.04730224609375,
0.045166015625,
0.01097869873046875,
0.020233154296875,
-0.028045654296875,
0.023345947265625,
0.0118408203125,
0.050811767578125,
-0.046966552734375,
-0.009124755859375,
-0.0005011558532714844,
-0.000012218952178955078,
0.04071044921875,
-0.0074615478515625,
0.07843017578125,
0.0248870849609375,
-0.02105712890625,
-0.015716552734375,
0.0195770263671875,
0.00850677490234375,
-0.0210723876953125,
-0.0038604736328125,
0.0171966552734375,
0.00009626150131225586,
0.03729248046875,
-0.009765625,
0.00914764404296875,
0.0017528533935546875,
0.003055572509765625,
0.00023627281188964844,
0.0216522216796875,
0.034698486328125,
-0.0025882720947265625,
-0.0228271484375,
-0.00399017333984375,
0.02947998046875,
0.01849365234375,
0.003292083740234375,
0.03558349609375,
-0.0191497802734375,
0.0288543701171875,
0.00765228271484375,
-0.01325225830078125,
0.030914306640625,
0.011383056640625,
-0.023284912109375,
-0.02783203125,
-0.0501708984375,
-0.026580810546875,
-0.02325439453125,
-0.01428985595703125,
-0.006969451904296875,
0.0323486328125,
-0.0028858184814453125,
-0.004543304443359375,
0.0311126708984375,
0.0305633544921875,
-0.0013818740844726562,
0.0540771484375,
-0.01375579833984375,
-0.019256591796875,
0.0276641845703125,
-0.0274810791015625,
0.0645751953125,
-0.0021457672119140625,
-0.034637451171875,
0.004364013671875,
-0.033203125,
-0.035003662109375,
0.0155792236328125,
0.0195770263671875,
-0.048126220703125,
0.0526123046875,
0.038421630859375,
0.01513671875,
0.029205322265625,
-0.01800537109375,
-0.01232147216796875,
-0.0082855224609375,
0.052581787109375,
-0.0063323974609375,
-0.079345703125,
-0.028411865234375,
-0.0200958251953125,
-0.0007452964782714844,
0.027069091796875,
0.04364013671875,
0.03265380859375,
0.009857177734375,
-0.0012445449829101562,
0.01983642578125,
-0.02301025390625,
-0.0026836395263671875,
0.00882720947265625,
-0.0070648193359375,
0.00925445556640625,
-0.00429534912109375,
-0.012359619140625,
0.1094970703125,
-0.0276031494140625,
0.048828125,
0.08331298828125,
-0.0472412109375,
-0.01006317138671875,
0.026397705078125,
-0.0019216537475585938,
-0.04241943359375,
-0.07257080078125,
-0.050048828125,
0.0264434814453125,
-0.028839111328125,
0.00040912628173828125,
-0.01517486572265625,
0.036163330078125,
-0.0443115234375,
-0.04205322265625,
0.0017604827880859375,
-0.03997802734375,
-0.041839599609375,
0.00921630859375,
0.032196044921875,
0.038299560546875,
-0.035247802734375,
-0.038787841796875,
0.016326904296875,
-0.00856781005859375,
-0.03948974609375,
-0.016845703125,
-0.009613037109375,
0.035980224609375,
0.068603515625,
0.072509765625,
-0.01432037353515625,
0.0304412841796875,
0.051605224609375,
-0.02056884765625,
0.0316162109375,
-0.0416259765625,
-0.044219970703125,
-0.06427001953125,
0.0107269287109375,
-0.0002913475036621094,
-0.022979736328125,
-0.08160400390625,
-0.04345703125,
0.002223968505859375,
0.006771087646484375,
-0.00801849365234375,
-0.04315185546875,
0.015625,
-0.016876220703125,
0.03375244140625,
-0.046234130859375,
-0.0032482147216796875,
0.007358551025390625,
-0.0171966552734375,
-0.035614013671875,
0.003993988037109375,
-0.0290374755859375,
-0.00138092041015625,
0.0090179443359375,
0.0182647705078125,
0.03436279296875,
-0.0016851425170898438,
-0.0216217041015625,
-0.0024204254150390625,
-0.00629425048828125,
0.039947509765625,
-0.04156494140625,
-0.007144927978515625,
0.034210205078125,
-0.01355743408203125,
-0.0218505859375,
-0.02777099609375,
-0.0011844635009765625,
-0.056549072265625,
-0.0004010200500488281,
0.00991058349609375,
-0.009674072265625,
0.007537841796875,
-0.035919189453125,
-0.09417724609375,
0.0299072265625,
-0.0107421875,
-0.043975830078125,
-0.036590576171875,
0.00263214111328125,
-0.01447296142578125,
-0.0209503173828125,
-0.020416259765625,
-0.016845703125,
0.0010776519775390625,
0.037750244140625,
0.0152587890625,
-0.04058837890625,
0.043182373046875,
0.0219879150390625,
-0.04779052734375,
0.0247039794921875,
0.019378662109375,
-0.029571533203125,
0.030792236328125,
-0.003925323486328125,
0.055816650390625,
0.048614501953125,
-0.022918701171875,
0.09515380859375,
-0.005687713623046875,
-0.0318603515625,
-0.0135955810546875,
-0.02972412109375,
0.01611328125,
0.00495147705078125,
0.049835205078125,
0.00928497314453125,
0.004375457763671875,
-0.0257415771484375,
-0.042327880859375,
-0.01544189453125,
-0.0044097900390625,
-0.00646209716796875,
0.012664794921875,
-0.0550537109375,
-0.010650634765625,
-0.0133514404296875,
0.004222869873046875,
0.006473541259765625,
-0.0289459228515625,
-0.0169219970703125,
-0.024749755859375,
-0.001399993896484375,
0.00604248046875,
-0.00009733438491821289,
0.00177764892578125,
0.032470703125,
-0.0379638671875,
-0.027862548828125,
0.00418853759765625,
0.0117950439453125,
-0.01219940185546875,
0.004100799560546875,
0.04571533203125,
0.0138092041015625,
-0.0221710205078125,
0.01000213623046875,
0.03546142578125,
0.006443023681640625,
-0.006465911865234375,
-0.0440673828125,
-0.033416748046875,
0.038116455078125,
0.011932373046875,
0.0469970703125,
0.00048470497131347656,
0.0115966796875,
0.045379638671875,
0.0084991455078125,
0.0028972625732421875,
-0.054656982421875,
-0.05987548828125,
0.059783935546875,
0.0185394287109375,
-0.0386962890625,
0.031707763671875,
-0.0176239013671875,
-0.0040283203125,
-0.0419921875,
-0.0087432861328125,
-0.060577392578125,
0.017608642578125,
-0.0312347412109375,
-0.0208282470703125,
0.0245208740234375
] |
ac5187881294db4f5babbe4dba643a6724d72969
|
Wordpress Stackexchange
Q: Password in wp-config. Dangerous? I don't know a lot of Wordpress yet, and I'm just wondering:
Before installation you have to fill in the correct data in wp-config-sample.php but this also includes the database password. Isn't that dangerous? I mean, can some one explain how this is protected from just reading the file and thus getting the password of your DB?
A: To make a case for keeping your config file one level up from the web root (as mrwweb suggested): a few months ago, an automatic update on a production server of ours killed php but left apache running. So everyone coming to the homepage was being offered index.php as a download. In theory, anybody who knew it was a WordPress site could have requested wp-config.php, and gotten it (had it been in the web root). Of course, they'd only be able to use those DB credentials if we allowed remote MySQL connections--but still, not cool. I realize this is a fringe case, but it's so easy to keep your config out of sight, why not do it?
|
Q: Password in wp-config. Dangerous? I don't know a lot of Wordpress yet, and I'm just wondering:
Before installation you have to fill in the correct data in wp-config-sample.php but this also includes the database password. Isn't that dangerous? I mean, can some one explain how this is protected from just reading the file and thus getting the password of your DB?
A: To make a case for keeping your config file one level up from the web root (as mrwweb suggested): a few months ago, an automatic update on a production server of ours killed php but left apache running. So everyone coming to the homepage was being offered index.php as a download. In theory, anybody who knew it was a WordPress site could have requested wp-config.php, and gotten it (had it been in the web root). Of course, they'd only be able to use those DB credentials if we allowed remote MySQL connections--but still, not cool. I realize this is a fringe case, but it's so easy to keep your config out of sight, why not do it?
A: Unless someone has access via FTP, you don't need to worry about this. PHP is rendered on the server before it hit's the users browser.
A: Here's another tip: protect wp-config.php (and any other sensitive files) with .htaccess
Add the following to an .htaccess file in your site's directory where all other WordPress files are located:
<Files wp-config.php>
order allow,deny
deny from all
</Files>
from How to harden your WordPress installation
A: The "Hardening WordPress" page of the Codex contains a section on "Securing wp-config.php". It includes changing the permissions to 440 or 400. You can also move the wp-config file one directory up from the root if your server configuration allows for that.
Of course there is some danger to having a file with the password like this if someone gets access to your server, but, honestly, at that point they already are in your server.
Finally, you don't have much of a choice. I've never seen an alternate means of configuring WordPress. You can lock it down as much as you can, but this is how WordPress is built, and if it were a serious security threat, they wouldn't do it that way.
A: If somebody has access to read the contents of your Php files, you've already been hacked.
|
wordpress
|
{
"language": "en",
"length": 393,
"provenance": "stackexchange_00019.jsonl.gz:420382",
"question_score": "10",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53636"
}
|
[
0.0372314453125,
-0.026947021484375,
-0.00447845458984375,
-0.00542449951171875,
0.00020205974578857422,
-0.04473876953125,
0.0516357421875,
-0.015228271484375,
-0.038818359375,
0.022857666015625,
-0.02191162109375,
0.00275421142578125,
-0.0280914306640625,
-0.0193328857421875,
-0.004070281982421875,
-0.05780029296875,
0.025390625,
0.038177490234375,
0.037322998046875,
0.010528564453125,
-0.0216522216796875,
0.0289764404296875,
0.0163421630859375,
0.0114288330078125,
0.02667236328125,
0.00001823902130126953,
0.071044921875,
0.0017290115356445312,
0.028564453125,
0.01172637939453125,
0.035400390625,
-0.059600830078125,
0.005580902099609375,
0.0345458984375,
-0.01552581787109375,
-0.00716400146484375,
-0.003520965576171875,
0.018402099609375,
-0.00469207763671875,
0.032257080078125,
0.0153350830078125,
-0.00868988037109375,
0.04498291015625,
0.04766845703125,
-0.004108428955078125,
-0.0280914306640625,
0.01277923583984375,
-0.0633544921875,
-0.0269775390625,
-0.0169830322265625,
0.01415252685546875,
0.036285400390625,
0.029388427734375,
-0.0166473388671875,
-0.004581451416015625,
0.0085906982421875,
-0.00438690185546875,
-0.0005626678466796875,
0.0220794677734375,
0.01056671142578125,
-0.0197296142578125,
0.0035552978515625,
0.01227569580078125,
-0.03912353515625,
-0.020263671875,
0.00029277801513671875,
-0.02069091796875,
0.00658416748046875,
-0.00237274169921875,
-0.0261688232421875,
0.001117706298828125,
-0.01142120361328125,
-0.000598907470703125,
-0.046722412109375,
0.006763458251953125,
0.0413818359375,
-0.044342041015625,
-0.0106048583984375,
0.0233001708984375,
0.0021514892578125,
-0.01267242431640625,
0.00348663330078125,
-0.015869140625,
-0.031097412109375,
0.004833221435546875,
-0.023193359375,
-0.0150604248046875,
-0.0050201416015625,
0.04644775390625,
-0.01096343994140625,
0.0118865966796875,
0.014556884765625,
0.0270843505859375,
0.027740478515625,
-0.0251007080078125,
-0.03765869140625,
-0.0122833251953125,
0.0243988037109375,
-0.031158447265625,
0.0157623291015625,
-0.0006146430969238281,
-0.0187225341796875,
0.0013952255249023438,
-0.0256195068359375,
-0.00635528564453125,
0.051544189453125,
-0.0182037353515625,
0.001190185546875,
0.0030536651611328125,
0.019805908203125,
0.010406494140625,
-0.032989501953125,
0.0036258697509765625,
-0.09100341796875,
0.0023784637451171875,
0.067626953125,
0.02752685546875,
-0.0018396377563476562,
0.048431396484375,
-0.0010251998901367188,
-0.00901031494140625,
0.008941650390625,
-0.031829833984375,
0.0024089813232421875,
-0.0167694091796875,
-0.037841796875,
-0.00325775146484375,
0.028900146484375,
-0.07574462890625,
0.046630859375,
-0.03106689453125,
-0.0158233642578125,
0.05023193359375,
0.0509033203125,
0.0033702850341796875,
-0.039703369140625,
0.0121002197265625,
0.032989501953125,
0.0262451171875,
-0.008544921875,
0.0013866424560546875,
-0.037445068359375,
0.006992340087890625,
0.0180816650390625,
-0.005031585693359375,
0.0241851806640625,
-0.00009775161743164062,
0.0088653564453125,
0.01021575927734375,
-0.02239990234375,
-0.0174560546875,
-0.0197906494140625,
-0.0310211181640625,
0.040069580078125,
0.048553466796875,
0.022857666015625,
0.01515960693359375,
-0.009033203125,
0.01557159423828125,
0.00013053417205810547,
-0.01116180419921875,
-0.0260772705078125,
-0.026641845703125,
-0.0066375732421875,
-0.00450897216796875,
0.01326751708984375,
0.028350830078125,
0.0220947265625,
0.0207672119140625,
-0.00853729248046875,
0.0214385986328125,
-0.047454833984375,
0.005382537841796875,
0.005767822265625,
0.00794219970703125,
0.043060302734375,
0.0129547119140625,
0.012725830078125,
0.0284881591796875,
0.08782958984375,
0.03497314453125,
-0.0035381317138671875,
0.060577392578125,
-0.00039315223693847656,
-0.046356201171875,
-0.022003173828125,
0.010345458984375,
0.0479736328125,
0.040283203125,
0.03265380859375,
0.032989501953125,
-0.04461669921875,
-0.07012939453125,
0.06585693359375,
-0.031646728515625,
-0.01282501220703125,
0.03204345703125,
0.01763916015625,
-0.0082244873046875,
-0.01593017578125,
0.057281494140625,
0.0092620849609375,
-0.0153045654296875,
-0.01224517822265625,
-0.04803466796875,
-0.0201568603515625,
0.0026264190673828125,
0.01239013671875,
-0.0517578125,
-0.011199951171875,
0.02581787109375,
-0.0202178955078125,
0.00012493133544921875,
-0.06427001953125,
-0.03338623046875,
-0.0032253265380859375,
-0.056365966796875,
0.06591796875,
-0.01441192626953125,
0.06903076171875,
-0.036590576171875,
-0.0290985107421875,
-0.002819061279296875,
-0.03656005859375,
-0.00495147705078125,
-0.0007562637329101562,
-0.02734375,
-0.004913330078125,
-0.0038585662841796875,
0.0040130615234375,
0.010284423828125,
0.032318115234375,
0.001636505126953125,
-0.0142669677734375,
-0.038482666015625,
-0.01468658447265625,
-0.0219268798828125,
-0.0882568359375,
0.007762908935546875,
0.0628662109375,
0.0347900390625,
0.0206298828125,
-0.02203369140625,
-0.01149749755859375,
0.00986480712890625,
-0.09930419921875,
-0.0242156982421875,
0.00952911376953125,
0.0009565353393554688,
0.06512451171875,
0.0015516281127929688,
0.01241302490234375,
-0.0201873779296875,
-0.042694091796875,
-0.02587890625,
0.0276641845703125,
-0.0227203369140625,
0.031280517578125,
-0.04620361328125,
-0.00943756103515625,
-0.002506256103515625,
-0.0255126953125,
-0.01036834716796875,
-0.0178680419921875,
-0.006519317626953125,
0.00839996337890625,
0.01255035400390625,
0.0229644775390625,
0.0007033348083496094,
-0.00928497314453125,
0.01214599609375,
-0.00687408447265625,
-0.0260009765625,
0.0167999267578125,
0.054107666015625,
-0.018646240234375,
-0.036590576171875,
0.01114654541015625,
-0.01454925537109375,
0.01461029052734375,
-0.00948333740234375,
0.01372528076171875,
-0.0113372802734375,
-0.01251220703125,
-0.0221099853515625,
-0.033233642578125,
0.016448974609375,
0.03558349609375,
-0.0133209228515625,
-0.01064300537109375,
0.01390838623046875,
0.03955078125,
-0.010040283203125,
0.0345458984375,
-0.01294708251953125,
0.00601959228515625,
-0.01438140869140625,
-0.0012359619140625,
0.00262451171875,
-0.00859832763671875,
0.03814697265625,
0.060150146484375,
0.004642486572265625,
-0.00627899169921875,
-0.00970458984375,
0.0176239013671875,
-0.00537109375,
-0.00907135009765625,
-0.02777099609375,
0.0188751220703125,
-0.0826416015625,
0.01081085205078125,
0.0226898193359375,
0.01062774658203125,
0.001953125,
-0.00968170166015625,
0.0013217926025390625,
0.01496124267578125,
-0.01100921630859375,
-0.0254669189453125,
-0.0628662109375,
-0.01406097412109375,
0.016510009765625,
-0.005313873291015625,
0.0146026611328125,
0.00469970703125,
-0.006649017333984375,
0.0262603759765625,
0.00829315185546875,
-0.059356689453125,
-0.033782958984375,
-0.0927734375,
-0.07843017578125,
-0.034576416015625,
0.01593017578125,
0.01285552978515625,
-0.009246826171875,
0.0924072265625,
-0.00237274169921875,
-0.058135986328125,
-0.027313232421875,
0.002658843994140625,
-0.013885498046875,
0.0015077590942382812,
-0.0296783447265625,
-0.03826904296875,
0.0102996826171875,
-0.0165557861328125,
-0.043609619140625,
-0.0296783447265625,
0.058349609375,
-0.02655029296875,
0.0270233154296875,
0.00154876708984375,
0.028472900390625,
0.011199951171875,
-0.032501220703125,
-0.0003504753112792969,
-0.015533447265625,
-0.06182861328125,
0.0147247314453125,
0.0078277587890625,
-0.01248931884765625,
0.01056671142578125,
-0.01708984375,
-0.022247314453125,
0.01317596435546875,
0.00937652587890625,
0.020782470703125,
0.033172607421875,
-0.01404571533203125,
-0.0011472702026367188,
0.043182373046875,
0.00705718994140625,
0.0007567405700683594,
-0.0264892578125,
0.01561737060546875,
-0.03497314453125,
-0.0214385986328125,
-0.00922393798828125,
-0.027740478515625,
0.009765625,
-0.0306243896484375,
0.021270751953125,
-0.0728759765625,
0.07208251953125,
-0.01294708251953125,
0.027313232421875,
-0.0684814453125,
-0.050750732421875,
-0.0204010009765625,
0.11834716796875,
-0.0284881591796875,
-0.01110076904296875,
0.024566650390625,
0.02490234375,
-0.02996826171875,
-0.05120849609375,
-0.03411865234375,
-0.02978515625,
-0.007373809814453125,
-0.0257568359375,
-0.032867431640625,
-0.012115478515625,
0.024505615234375,
-0.08209228515625,
0.0233154296875,
-0.039886474609375,
0.0006132125854492188,
-0.00011646747589111328,
0.032257080078125,
0.0037860870361328125,
0.0261077880859375,
0.0008993148803710938,
0.0258636474609375,
-0.04766845703125,
-0.09564208984375,
-0.0156402587890625,
-0.0228271484375,
0.076904296875,
-0.0034542083740234375,
-0.005756378173828125,
-0.04010009765625,
0.045074462890625,
-0.01096343994140625,
0.0011987686157226562,
0.0200958251953125,
0.0160064697265625,
-0.01995849609375,
0.01239013671875,
0.0137176513671875,
-0.0132598876953125,
0.0087890625,
-0.03582763671875,
-0.039520263671875,
-0.053619384765625,
-0.056976318359375,
-0.0160675048828125,
-0.01043701171875,
-0.00829315185546875,
-0.0297698974609375,
-0.0241546630859375,
0.006877899169921875,
0.01824951171875,
0.0035533905029296875,
0.00948333740234375,
-0.042327880859375,
-0.0114898681640625,
0.062744140625,
0.0052337646484375,
0.003955841064453125,
-0.01495361328125,
0.0970458984375,
0.00580596923828125,
-0.0172119140625,
-0.005352020263671875,
-0.0081787109375,
0.038909912109375,
0.014190673828125,
0.07470703125,
0.054412841796875,
-0.03167724609375,
0.06640625,
0.029327392578125,
-0.01092529296875,
-0.0186614990234375,
0.056427001953125,
-0.01314544677734375,
-0.047119140625,
0.031951904296875,
-0.0219573974609375,
0.010162353515625,
0.025360107421875,
0.0091094970703125,
-0.005359649658203125,
0.051025390625,
0.00362396240234375,
-0.04656982421875,
0.013671875,
0.02508544921875,
-0.06793212890625,
0.0252532958984375,
-0.01372528076171875,
-0.006671905517578125,
-0.033233642578125,
0.0229644775390625,
0.00630950927734375,
0.0187835693359375,
0.01309967041015625,
-0.0159759521484375,
-0.016265869140625,
-0.0116424560546875,
0.0131683349609375,
0.0109710693359375,
0.0033359527587890625,
-0.0019664764404296875,
-0.03619384765625,
0.10302734375,
-0.0014066696166992188,
-0.079833984375,
0.057403564453125,
-0.0304718017578125,
0.0640869140625,
0.040802001953125,
-0.0100555419921875,
0.0164031982421875,
0.002529144287109375,
-0.0269317626953125,
-0.0214691162109375,
-0.0175628662109375,
-0.0278472900390625,
-0.038909912109375,
-0.0176849365234375,
-0.008544921875,
0.0011434555053710938,
0.06134033203125,
-0.01026153564453125,
-0.0012302398681640625,
0.0296478271484375,
-0.0110015869140625,
0.027862548828125,
0.040557861328125,
-0.00722503662109375,
0.003688812255859375,
0.03717041015625,
0.01953125,
-0.049072265625,
0.0343017578125,
-0.0531005859375,
-0.012969970703125,
0.017852783203125,
0.059356689453125,
-0.031707763671875,
-0.03814697265625,
0.02288818359375,
-0.0220184326171875,
-0.0024929046630859375,
0.037353515625,
-0.021209716796875,
-0.039581298828125,
-0.0252838134765625,
0.0030117034912109375,
0.0521240234375,
-0.023956298828125,
-0.003360748291015625,
0.007030487060546875,
-0.0249786376953125,
0.025970458984375,
-0.00867462158203125,
0.00299072265625,
-0.014312744140625,
-0.0186767578125,
0.0309295654296875,
-0.00890350341796875,
-0.042449951171875,
-0.01087188720703125,
0.0008726119995117188,
-0.00945281982421875,
0.007701873779296875,
0.0273590087890625,
0.0098724365234375,
0.0029964447021484375,
-0.005977630615234375,
-0.0263671875,
-0.01287078857421875,
0.0051116943359375,
0.0262298583984375,
-0.0049591064453125,
-0.0300750732421875,
-0.023406982421875,
-0.023681640625,
-0.018035888671875,
0.0171966552734375,
-0.0306549072265625,
-0.027557373046875,
-0.00580596923828125,
-0.0077972412109375,
-0.019683837890625,
-0.0008182525634765625,
0.00885009765625,
-0.056915283203125,
0.06884765625,
0.04241943359375,
0.004680633544921875,
-0.040435791015625,
0.03326416015625,
0.03814697265625,
-0.0164794921875,
0.0003771781921386719,
0.0145416259765625,
0.005390167236328125,
0.0010166168212890625,
0.050262451171875,
-0.005523681640625,
-0.040557861328125,
-0.052398681640625,
0.037933349609375,
-0.0360107421875,
0.0000521540641784668,
-0.0276641845703125,
-0.00931549072265625,
0.0016727447509765625,
0.01470184326171875,
0.0025653839111328125,
0.0281829833984375,
0.018524169921875,
-0.0478515625,
0.045806884765625,
-0.031524658203125,
0.028533935546875,
-0.0019521713256835938,
0.0044708251953125,
0.0306396484375,
-0.036651611328125,
0.0220947265625,
0.045257568359375,
-0.005649566650390625,
0.053131103515625,
0.08551025390625,
-0.007358551025390625,
0.06451416015625,
0.047088623046875,
0.010467529296875,
0.005596160888671875,
0.01520538330078125,
-0.084228515625,
-0.08856201171875,
-0.016448974609375,
0.0163726806640625,
0.014007568359375,
0.028594970703125,
0.01593017578125,
0.01064300537109375,
0.0196533203125,
0.07818603515625,
-0.0141754150390625,
-0.0008158683776855469,
0.0245819091796875,
-0.025665283203125,
0.005207061767578125,
0.016357421875,
-0.0185546875,
-0.0136260986328125,
-0.0006098747253417969,
-0.024017333984375,
-0.016693115234375,
-0.0096893310546875,
0.002422332763671875,
-0.0033969879150390625,
0.00508880615234375,
0.01702880859375,
0.01018524169921875,
0.00983428955078125,
-0.0224609375,
0.01029205322265625,
0.0224151611328125,
0.00551605224609375,
0.0092620849609375,
0.0007681846618652344,
-0.0528564453125,
-0.06402587890625,
-0.035247802734375,
0.0128326416015625,
-0.06854248046875,
-0.024383544921875,
0.0187530517578125,
0.033111572265625,
0.035308837890625,
0.0032291412353515625,
-0.0015859603881835938,
-0.0003116130828857422,
0.0631103515625,
0.05743408203125,
-0.000774383544921875,
0.0138397216796875,
0.004291534423828125,
-0.0223541259765625,
0.0008001327514648438,
-0.009124755859375,
-0.0152587890625,
0.004039764404296875,
0.00444793701171875,
0.07757568359375,
-0.05078125,
-0.004497528076171875,
0.039947509765625,
0.00337982177734375,
0.0059661865234375,
-0.01776123046875,
0.0335693359375,
-0.0304718017578125,
0.02557373046875,
-0.00384521484375,
0.02197265625,
-0.030487060546875,
-0.0193328857421875,
0.0103759765625,
0.06573486328125,
-0.0198974609375,
-0.057098388671875,
0.0229644775390625,
0.0511474609375,
-0.0147247314453125,
0.05584716796875,
-0.03045654296875,
0.065185546875,
0.0211944580078125,
0.035736083984375,
-0.036285400390625,
-0.00925445556640625,
0.00860595703125,
0.028961181640625,
-0.007068634033203125,
-0.0058441162109375,
0.018463134765625,
0.001392364501953125,
0.014434814453125,
0.01418304443359375,
-0.0251007080078125,
0.006084442138671875,
0.0085906982421875,
0.06414794921875,
0.059173583984375,
-0.08056640625,
0.00978851318359375,
0.0129852294921875,
0.0110321044921875,
0.0311279296875,
0.01305389404296875,
-0.002849578857421875,
-0.010040283203125,
0.040283203125,
-0.05804443359375,
0.0113525390625,
0.0399169921875,
0.012176513671875,
0.014068603515625,
-0.005146026611328125,
0.00885772705078125,
-0.01152801513671875,
0.030059814453125,
-0.019317626953125,
0.04388427734375,
0.0028247833251953125,
-0.0169219970703125,
0.0206146240234375,
0.005115509033203125,
0.0085601806640625,
0.0188140869140625,
-0.0206146240234375,
0.034912109375,
0.00449371337890625,
0.0521240234375,
0.06634521484375,
0.0241546630859375,
-0.005992889404296875,
-0.00400543212890625,
0.050750732421875,
0.07452392578125,
-0.04754638671875,
-0.037872314453125,
0.01000213623046875,
0.006381988525390625,
0.00905609130859375,
0.003814697265625,
0.01511383056640625,
0.041748046875,
0.067138671875,
0.00539398193359375,
-0.00263214111328125,
0.01317596435546875,
-0.0235137939453125,
0.0003154277801513672,
0.024566650390625,
0.00774383544921875,
0.02777099609375,
0.0094451904296875,
0.003711700439453125,
0.01861572265625,
0.0074615478515625,
-0.01654052734375,
0.0325927734375,
-0.0108184814453125,
0.0077056884765625,
-0.005146026611328125,
0.055755615234375,
0.0206146240234375,
-0.001735687255859375,
-0.0419921875,
-0.07183837890625,
0.037506103515625,
0.03961181640625,
-0.0167694091796875,
0.006168365478515625,
-0.001491546630859375,
0.0219879150390625,
-0.01031494140625,
-0.023681640625,
0.04071044921875,
-0.0228118896484375,
-0.01522064208984375,
-0.0268707275390625,
0.033905029296875,
0.03851318359375,
0.007465362548828125,
-0.004940032958984375,
0.0245361328125,
0.03131103515625,
0.02288818359375,
0.02789306640625,
0.00778961181640625,
0.01204681396484375,
-0.005580902099609375,
-0.0034389495849609375,
-0.0198974609375,
0.03680419921875,
-0.043243408203125,
-0.0236968994140625,
0.0023822784423828125,
-0.005157470703125,
0.00478363037109375,
0.023406982421875,
-0.0168914794921875,
0.0177459716796875,
0.002124786376953125,
-0.04058837890625,
0.01500701904296875,
0.0262451171875,
-0.0166473388671875,
-0.0169677734375,
0.0257568359375,
-0.04083251953125,
-0.0382080078125,
-0.032806396484375,
-0.0176849365234375,
0.049072265625,
-0.0212860107421875,
0.128173828125,
-0.0455322265625,
0.00974273681640625,
0.00009381771087646484,
0.0097503662109375,
-0.015960693359375,
0.005123138427734375,
-0.015777587890625,
0.0031261444091796875,
0.0203857421875,
-0.006084442138671875,
-0.04974365234375,
0.043853759765625,
0.0093841552734375,
0.01425933837890625,
0.034454345703125,
-0.04583740234375,
0.0125732421875,
0.004337310791015625,
0.02557373046875,
-0.0243988037109375,
-0.037322998046875,
-0.026275634765625,
0.0171661376953125,
0.0126800537109375,
0.018798828125,
-0.016387939453125,
0.00927734375,
-0.01702880859375,
0.01557159423828125,
-0.0034923553466796875,
0.009246826171875,
-0.020660400390625,
0.0113983154296875,
-0.0287628173828125,
-0.046173095703125,
-0.034515380859375,
-0.0177459716796875,
-0.038360595703125,
0.0123443603515625,
0.005443572998046875,
-0.0160064697265625,
-0.01419830322265625,
-0.0185546875,
0.060546875,
0.0819091796875,
0.0364990234375,
0.045166015625,
-0.020965576171875,
-0.021728515625,
0.03759765625,
-0.0027751922607421875,
-0.0255279541015625,
-0.004436492919921875,
-0.03564453125,
0.00315093994140625,
-0.041778564453125,
-0.08221435546875,
-0.103271484375,
0.0234527587890625,
0.046905517578125,
-0.0167999267578125,
-0.0338134765625,
0.00829315185546875,
-0.049224853515625,
0.0721435546875,
-0.0269775390625,
-0.0175018310546875,
-0.0037174224853515625,
0.02069091796875,
-0.01134490966796875,
-0.018157958984375,
-0.032073974609375,
0.011505126953125,
-0.01419830322265625,
0.038421630859375,
0.030426025390625,
-0.016021728515625,
0.018035888671875,
0.03253173828125,
0.006805419921875,
0.08038330078125,
-0.05780029296875,
-0.01543426513671875,
0.0099945068359375,
0.007282257080078125,
-0.015655517578125,
-0.08294677734375,
-0.0027065277099609375,
-0.050994873046875,
0.0070343017578125,
-0.03753662109375,
-0.004791259765625,
-0.0258026123046875,
-0.06671142578125,
-0.06536865234375,
0.052764892578125,
-0.006282806396484375,
-0.0199127197265625,
0.0142974853515625,
-0.01151275634765625,
-0.028961181640625,
0.045318603515625,
0.01763916015625,
-0.01190948486328125,
0.005077362060546875,
0.00794219970703125,
0.01776123046875,
-0.003551483154296875,
0.02301025390625,
0.025054931640625,
-0.03173828125,
0.0426025390625,
0.038787841796875,
-0.01181793212890625,
-0.00943756103515625,
0.0158843994140625,
0.01197052001953125,
0.0301055908203125,
-0.00966644287109375,
0.029327392578125,
0.0038318634033203125,
-0.0262298583984375,
-0.010772705078125,
0.0010175704956054688,
0.0006475448608398438,
0.0189361572265625,
0.0205078125,
0.061920166015625,
0.00035381317138671875,
-0.041595458984375,
-0.03680419921875,
-0.038787841796875,
0.0345458984375,
0.002811431884765625,
-0.004619598388671875,
-0.03631591796875,
0.02398681640625,
0.0163421630859375,
-0.01422882080078125,
-0.024932861328125,
-0.0209808349609375,
-0.05975341796875,
-0.00762176513671875,
-0.0404052734375,
0.00730133056640625,
-0.01367950439453125,
-0.07012939453125,
0.0804443359375,
-0.040130615234375,
0.006679534912109375,
0.0007634162902832031,
0.04315185546875,
0.045654296875,
0.0198211669921875,
-0.030731201171875,
-0.0013532638549804688,
-0.00841522216796875,
0.03021240234375,
-0.007114410400390625,
0.0504150390625,
-0.0458984375,
0.0233306884765625,
-0.006053924560546875,
0.015228271484375,
0.0123748779296875,
0.00794219970703125,
0.002902984619140625,
-0.00392913818359375,
0.0006117820739746094,
0.0186309814453125,
-0.01873779296875,
-0.029144287109375,
-0.027008056640625,
0.027252197265625,
-0.0136260986328125,
-0.0005764961242675781,
0.0166778564453125,
-0.0242462158203125,
0.00743865966796875,
0.0288238525390625,
0.029388427734375,
0.01288604736328125,
-0.0194854736328125,
-0.00731658935546875,
0.0190582275390625,
-0.01152801513671875
] |
ed675c27a82d4a9635f91d4f11d08527e10aa2e2
|
Wordpress Stackexchange
Q: Ability to set character limit in BuddyPress? I would like to limit characters in BuddyPress posts to certain limit . Ex: Set it to the limit of 150 ... just like twitter's 140.
Googled about it and found nothing. Does any one have Idea on this?
Thanks
A: Simple solution is to add a maxlength attribute to the textarea field. For example
<textarea maxlength="140">
</textarea>
|
Q: Ability to set character limit in BuddyPress? I would like to limit characters in BuddyPress posts to certain limit . Ex: Set it to the limit of 150 ... just like twitter's 140.
Googled about it and found nothing. Does any one have Idea on this?
Thanks
A: Simple solution is to add a maxlength attribute to the textarea field. For example
<textarea maxlength="140">
</textarea>
A: Just Try With the following plugin.,
http://bavotasan.com/2009/excerpt-and-content-word-limit-wordpress-plugin/
Also try with this too.,
http://buddypress.org/community/groups/creating-extending/forum/topic/character-limit-and-counter-for-the-new-status-updates-component/
A: This question was answered 3 years ago on wordpress.org.
Here is the function, which you can easily modify to your needs.
|
wordpress
|
{
"language": "en",
"length": 102,
"provenance": "stackexchange_00019.jsonl.gz:420416",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53766"
}
|
[
-0.03009033203125,
-0.0258331298828125,
-0.016876220703125,
0.035430908203125,
-0.036834716796875,
0.00476837158203125,
0.0292510986328125,
-0.00395965576171875,
-0.0083770751953125,
0.0413818359375,
0.01325225830078125,
-0.005279541015625,
-0.007534027099609375,
-0.035614013671875,
-0.034942626953125,
-0.002025604248046875,
0.0090179443359375,
0.009185791015625,
-0.027496337890625,
-0.0264739990234375,
0.0126190185546875,
-0.010223388671875,
-0.068115234375,
0.0211334228515625,
0.020843505859375,
-0.0107421875,
0.07366943359375,
-0.041046142578125,
0.0229034423828125,
-0.0238494873046875,
0.0217132568359375,
-0.0219268798828125,
0.004611968994140625,
0.06634521484375,
-0.053253173828125,
0.01397705078125,
-0.002552032470703125,
0.03070068359375,
-0.002933502197265625,
0.04681396484375,
0.01059722900390625,
0.00182342529296875,
0.01517486572265625,
0.01192474365234375,
0.01050567626953125,
-0.06292724609375,
0.04425048828125,
-0.05615234375,
0.0552978515625,
-0.02154541015625,
-0.0222015380859375,
0.0523681640625,
-0.005626678466796875,
-0.0770263671875,
-0.01226806640625,
0.00004404783248901367,
0.0137481689453125,
-0.060791015625,
0.04681396484375,
-0.006072998046875,
-0.0035457611083984375,
-0.03558349609375,
0.015655517578125,
-0.0164031982421875,
-0.005336761474609375,
0.0025539398193359375,
-0.0097198486328125,
0.02130126953125,
0.0168609619140625,
-0.0259552001953125,
-0.0115966796875,
-0.0035037994384765625,
0.006771087646484375,
-0.0295562744140625,
-0.0160369873046875,
0.023895263671875,
-0.048553466796875,
-0.0276947021484375,
0.040557861328125,
-0.01485443115234375,
-0.044342041015625,
-0.056488037109375,
0.009735107421875,
-0.01351165771484375,
-0.036895751953125,
-0.005382537841796875,
-0.034881591796875,
0.02496337890625,
-0.0006060600280761719,
-0.006908416748046875,
-0.01190185546875,
0.0055694580078125,
-0.0157012939453125,
0.0284881591796875,
-0.0000998377799987793,
-0.03900146484375,
0.0004260540008544922,
-0.044586181640625,
0.03656005859375,
0.0213470458984375,
0.031463623046875,
-0.05914306640625,
0.0631103515625,
-0.0120391845703125,
0.0220184326171875,
-0.008331298828125,
-0.03961181640625,
0.0008292198181152344,
0.0653076171875,
0.047943115234375,
0.007122039794921875,
-0.00539398193359375,
0.008331298828125,
0.0109710693359375,
-0.0123138427734375,
-0.05535888671875,
-0.057037353515625,
0.052947998046875,
-0.019866943359375,
0.018707275390625,
0.01471710205078125,
0.00893402099609375,
0.0211029052734375,
-0.0345458984375,
-0.0081939697265625,
-0.00620269775390625,
-0.0509033203125,
-0.012237548828125,
0.04217529296875,
0.0311431884765625,
-0.0103302001953125,
-0.0029659271240234375,
-0.005985260009765625,
0.00789642333984375,
-0.006839752197265625,
-0.00971221923828125,
-0.00649261474609375,
-0.0280303955078125,
-0.0290374755859375,
0.05621337890625,
-0.07696533203125,
-0.0231781005859375,
0.0679931640625,
-0.076904296875,
-0.0159912109375,
0.036590576171875,
0.0259246826171875,
0.00457763671875,
-0.0218353271484375,
-0.08001708984375,
0.024566650390625,
-0.04486083984375,
0.07568359375,
-0.01433563232421875,
-0.05126953125,
-0.04290771484375,
0.0301971435546875,
-0.050994873046875,
-0.0284271240234375,
-0.0662841796875,
-0.01163482666015625,
-0.01351165771484375,
0.0222625732421875,
-0.06768798828125,
-0.054046630859375,
-0.0035858154296875,
-0.03338623046875,
0.00855255126953125,
0.0225677490234375,
-0.0121917724609375,
0.022216796875,
0.0234222412109375,
0.0164031982421875,
-0.0217742919921875,
-0.00439453125,
-0.020172119140625,
-0.01861572265625,
-0.01837158203125,
0.030731201171875,
0.03033447265625,
0.01111602783203125,
-0.0054779052734375,
0.037841796875,
0.0192718505859375,
-0.0233154296875,
0.005157470703125,
0.0009455680847167969,
0.0209808349609375,
0.0196380615234375,
0.006664276123046875,
0.038604736328125,
-0.01520538330078125,
0.001110076904296875,
-0.020660400390625,
-0.038543701171875,
-0.03460693359375,
0.029998779296875,
0.0006604194641113281,
-0.024444580078125,
0.03564453125,
0.0223846435546875,
-0.0079193115234375,
0.0242156982421875,
-0.014739990234375,
-0.0089263916015625,
0.004894256591796875,
-0.01332855224609375,
0.0200347900390625,
-0.031341552734375,
0.0207061767578125,
0.001941680908203125,
-0.0243988037109375,
0.0042266845703125,
-0.0247039794921875,
0.0017232894897460938,
-0.013763427734375,
-0.0021800994873046875,
0.04620361328125,
0.0261383056640625,
0.01605224609375,
0.021728515625,
-0.0330810546875,
0.01328277587890625,
-0.0156402587890625,
0.01412200927734375,
-0.01172637939453125,
-0.0212554931640625,
-0.00443267822265625,
-0.0292816162109375,
0.01113128662109375,
-0.04791259765625,
0.039764404296875,
0.0175018310546875,
-0.00629425048828125,
-0.01042938232421875,
0.00409698486328125,
-0.01383209228515625,
-0.0828857421875,
-0.00618743896484375,
0.058807373046875,
0.0218963623046875,
0.0212860107421875,
-0.0229949951171875,
-0.00414276123046875,
0.0037021636962890625,
-0.0116119384765625,
0.0269927978515625,
-0.0316162109375,
0.0098419189453125,
0.068115234375,
0.015838623046875,
-0.00897979736328125,
-0.0019502639770507812,
-0.01470184326171875,
-0.0167694091796875,
0.01398468017578125,
0.0023956298828125,
0.00815582275390625,
-0.00691986083984375,
-0.00870513916015625,
0.0237884521484375,
-0.007373809814453125,
-0.029022216796875,
0.0002071857452392578,
-0.01361083984375,
0.0245819091796875,
0.037506103515625,
0.050933837890625,
0.02667236328125,
-0.007595062255859375,
-0.00635528564453125,
-0.017669677734375,
-0.01401519775390625,
-0.054962158203125,
-0.00832366943359375,
-0.0026607513427734375,
-0.06488037109375,
0.0452880859375,
0.029327392578125,
-0.03173828125,
-0.008697509765625,
0.0156707763671875,
0.0184326171875,
-0.0104522705078125,
-0.0025768280029296875,
-0.02252197265625,
0.0169525146484375,
-0.00836181640625,
-0.0003342628479003906,
-0.03680419921875,
0.00039887428283691406,
0.00550079345703125,
-0.037841796875,
0.06256103515625,
0.01378631591796875,
-0.03094482421875,
0.052337646484375,
-0.08795166015625,
0.0772705078125,
-0.04754638671875,
0.0784912109375,
0.079833984375,
-0.0222015380859375,
0.052398681640625,
0.003387451171875,
0.01000213623046875,
-0.021881103515625,
0.05535888671875,
0.006908416748046875,
-0.0130157470703125,
-0.020263671875,
0.05230712890625,
0.0018463134765625,
-0.00971221923828125,
-0.004192352294921875,
-0.031890869140625,
-0.003299713134765625,
-0.005687713623046875,
-0.041900634765625,
-0.02410888671875,
0.0129852294921875,
-0.08050537109375,
-0.0196533203125,
0.0036716461181640625,
-0.0404052734375,
-0.00140380859375,
0.03460693359375,
0.0027446746826171875,
-0.048248291015625,
-0.032318115234375,
-0.0140380859375,
-0.05731201171875,
-0.0098724365234375,
0.010894775390625,
0.0081787109375,
-0.00893402099609375,
-0.0038166046142578125,
0.08453369140625,
-0.0036163330078125,
-0.057647705078125,
-0.03717041015625,
-0.0167236328125,
-0.02801513671875,
-0.002559661865234375,
0.0124359130859375,
-0.031402587890625,
-0.00702667236328125,
-0.00821685791015625,
0.0335693359375,
0.0338134765625,
-0.037628173828125,
0.01087188720703125,
-0.01273345947265625,
-0.0103759765625,
0.034820556640625,
-0.0205535888671875,
-0.0215301513671875,
0.01187896728515625,
0.0257568359375,
-0.03564453125,
-0.04315185546875,
-0.003894805908203125,
-0.0657958984375,
-0.0217132568359375,
0.032135009765625,
0.0185394287109375,
-0.0250701904296875,
0.0070343017578125,
0.005199432373046875,
0.01277923583984375,
0.0215911865234375,
-0.0268707275390625,
0.041259765625,
-0.00388336181640625,
0.0211029052734375,
-0.028564453125,
-0.03271484375,
-0.05364990234375,
0.0655517578125,
-0.022186279296875,
-0.0288543701171875,
-0.016845703125,
0.020477294921875,
0.001926422119140625,
-0.0477294921875,
0.026824951171875,
-0.03448486328125,
0.0151214599609375,
-0.02508544921875,
-0.01520538330078125,
-0.01006317138671875,
0.0650634765625,
-0.048370361328125,
-0.01074981689453125,
0.0236968994140625,
0.017974853515625,
-0.055419921875,
-0.053741455078125,
-0.054962158203125,
-0.01374053955078125,
0.0210113525390625,
-0.0125274658203125,
-0.007465362548828125,
-0.0221099853515625,
-0.0311431884765625,
0.001514434814453125,
-0.01027679443359375,
0.002475738525390625,
0.005123138427734375,
-0.02880859375,
-0.031494140625,
-0.016937255859375,
-0.041900634765625,
-0.054229736328125,
-0.0005474090576171875,
-0.018280029296875,
-0.1015625,
-0.032958984375,
0.0290374755859375,
0.07098388671875,
-0.0119171142578125,
-0.0196380615234375,
0.00302886962890625,
0.0843505859375,
0.0352783203125,
0.0006132125854492188,
0.06805419921875,
0.004119873046875,
0.03704833984375,
0.005157470703125,
0.052490234375,
-0.033721923828125,
-0.0270843505859375,
-0.031494140625,
0.0144195556640625,
0.00736236572265625,
-0.004505157470703125,
-0.047271728515625,
0.0137786865234375,
-0.00713348388671875,
-0.09967041015625,
-0.038482666015625,
0.018585205078125,
0.03253173828125,
-0.0057830810546875,
-0.0030384063720703125,
-0.041900634765625,
-0.08270263671875,
0.04595947265625,
0.00502777099609375,
0.005245208740234375,
-0.003574371337890625,
0.078125,
-0.0038127899169921875,
-0.0265960693359375,
-0.053680419921875,
0.00583648681640625,
0.02447509765625,
0.01401519775390625,
0.01470947265625,
-0.026397705078125,
-0.033538818359375,
0.08831787109375,
-0.006618499755859375,
0.00743865966796875,
-0.015655517578125,
0.032012939453125,
0.00760650634765625,
0.0225982666015625,
-0.00881195068359375,
0.01505279541015625,
0.007686614990234375,
-0.004062652587890625,
-0.03472900390625,
0.039306640625,
-0.0269317626953125,
0.0224609375,
-0.0227203369140625,
0.0265350341796875,
-0.022735595703125,
-0.041229248046875,
0.0301971435546875,
-0.012359619140625,
-0.0679931640625,
-0.0253143310546875,
0.0125732421875,
-0.0215606689453125,
-0.054290771484375,
-0.0007123947143554688,
-0.0019989013671875,
-0.032196044921875,
0.00826263427734375,
0.0152587890625,
0.0162200927734375,
0.00592803955078125,
0.01537322998046875,
0.009521484375,
-0.00545501708984375,
0.00022649765014648438,
-0.0271759033203125,
-0.029632568359375,
0.005199432373046875,
0.032257080078125,
-0.0026531219482421875,
-0.005413055419921875,
-0.0220794677734375,
-0.00980377197265625,
-0.01407623291015625,
-0.00045990943908691406,
0.0301666259765625,
-0.026519775390625,
-0.00507354736328125,
0.02423095703125,
0.01552581787109375,
-0.0180816650390625,
0.01311492919921875,
0.0269622802734375,
-0.01560211181640625,
0.0060882568359375,
0.0017499923706054688,
0.0648193359375,
0.061248779296875,
-0.0040740966796875,
0.019927978515625,
0.044281005859375,
-0.06256103515625,
0.0184326171875,
-0.05108642578125,
-0.0240020751953125,
-0.047760009765625,
-0.004116058349609375,
0.006282806396484375,
0.01546478271484375,
0.031494140625,
0.03326416015625,
0.0457763671875,
-0.01245880126953125,
0.018402099609375,
0.0265960693359375,
-0.026885986328125,
0.01219940185546875,
0.038909912109375,
0.01424407958984375,
-0.0025234222412109375,
0.02044677734375,
-0.0238800048828125,
0.006313323974609375,
0.0082550048828125,
-0.031494140625,
-0.0012989044189453125,
-0.01389312744140625,
-0.0176239013671875,
-0.03204345703125,
-0.017669677734375,
-0.01641845703125,
-0.059417724609375,
-0.033203125,
-0.00186920166015625,
-0.01593017578125,
0.02862548828125,
-0.0016393661499023438,
-0.0060272216796875,
-0.0235137939453125,
0.008514404296875,
-0.007518768310546875,
0.00768280029296875,
0.05328369140625,
0.0088043212890625,
-0.02154541015625,
0.0186614990234375,
-0.02423095703125,
0.0032253265380859375,
0.032501220703125,
-0.004451751708984375,
-0.0282440185546875,
-0.038055419921875,
0.0017986297607421875,
0.0172576904296875,
-0.0249176025390625,
-0.0285797119140625,
-0.01035308837890625,
0.02923583984375,
0.0310516357421875,
0.043853759765625,
-0.05242919921875,
-0.01033782958984375,
0.046295166015625,
-0.006511688232421875,
-0.018310546875,
0.016510009765625,
0.11529541015625,
-0.04522705078125,
0.0163726806640625,
-0.006221771240234375,
-0.0257415771484375,
-0.0003790855407714844,
-0.0223541259765625,
-0.028167724609375,
0.01983642578125,
-0.01123809814453125,
0.016326904296875,
-0.040130615234375,
-0.00597381591796875,
-0.0243377685546875,
0.033111572265625,
-0.052581787109375,
0.00146484375,
-0.011566162109375,
0.0003917217254638672,
0.05609130859375,
-0.0406494140625,
-0.038909912109375,
0.0185699462890625,
-0.00705718994140625,
0.00885009765625,
0.0517578125,
0.031341552734375,
-0.004337310791015625,
0.06414794921875,
-0.0213165283203125,
0.0196533203125,
0.037078857421875,
-0.008453369140625,
-0.0016231536865234375,
0.0266571044921875,
-0.017669677734375,
-0.031280517578125,
0.01328277587890625,
-0.0010089874267578125,
-0.0302581787109375,
-0.01056671142578125,
-0.0247802734375,
0.016571044921875,
0.0020427703857421875,
0.037353515625,
-0.04888916015625,
0.0240936279296875,
0.00313568115234375,
-0.0070037841796875,
0.045074462890625,
-0.01235198974609375,
0.0101165771484375,
0.0189971923828125,
0.07086181640625,
-0.0374755859375,
-0.0072021484375,
0.0428466796875,
-0.01922607421875,
0.00002187490463256836,
-0.034027099609375,
0.0301361083984375,
0.021942138671875,
-0.006137847900390625,
0.00933074951171875,
0.0272216796875,
0.0087738037109375,
-0.0013408660888671875,
0.00600433349609375,
-0.027252197265625,
-0.04345703125,
-0.0245819091796875,
-0.0087127685546875,
-0.0215301513671875,
0.00713348388671875,
-0.00986480712890625,
-0.01446533203125,
-0.00795745849609375,
0.05316162109375,
-0.0259857177734375,
-0.0019207000732421875,
0.0216217041015625,
-0.0413818359375,
0.03350830078125,
-0.04656982421875,
0.01407623291015625,
0.059326171875,
-0.0239105224609375,
0.0255889892578125,
0.052520751953125,
-0.04937744140625,
0.01506805419921875,
0.00853729248046875,
0.01450347900390625,
-0.0194549560546875,
-0.0186614990234375,
0.020477294921875,
-0.0207061767578125,
-0.007701873779296875,
-0.027618408203125,
-0.01378631591796875,
-0.04266357421875,
0.012359619140625,
-0.0176239013671875,
0.000054001808166503906,
0.01016998291015625,
-0.036712646484375,
-0.049957275390625,
0.0732421875,
0.003536224365234375,
-0.0005664825439453125,
-0.0191497802734375,
0.0506591796875,
-0.01861572265625,
0.03173828125,
-0.038726806640625,
0.02587890625,
-0.0175018310546875,
0.035888671875,
-0.0423583984375,
0.002105712890625,
-0.002777099609375,
0.0081329345703125,
0.044830322265625,
0.00510406494140625,
0.0188751220703125,
-0.0252227783203125,
0.028411865234375,
0.0267333984375,
-0.01145172119140625,
-0.004489898681640625,
0.018524169921875,
-0.017364501953125,
0.0243682861328125,
-0.03753662109375,
0.007610321044921875,
-0.049560546875,
0.04461669921875,
0.02294921875,
-0.003932952880859375,
0.00988006591796875,
0.0008769035339355469,
-0.0200347900390625,
0.00533294677734375,
-0.0064697265625,
-0.0011262893676757812,
-0.05389404296875,
0.022735595703125,
0.06658935546875,
0.10595703125,
-0.04315185546875,
-0.0142364501953125,
-0.0242462158203125,
0.06146240234375,
0.03411865234375,
0.0308685302734375,
0.054473876953125,
0.019439697265625,
0.0848388671875,
0.008697509765625,
0.0396728515625,
0.007358551025390625,
-0.01080322265625,
-0.00438690185546875,
0.00949859619140625,
0.00946044921875,
-0.06378173828125,
-0.0191650390625,
0.08270263671875,
0.033050537109375,
-0.00801849365234375,
0.0020732879638671875,
0.0174407958984375,
0.046600341796875,
0.0050811767578125,
-0.0283355712890625,
0.00102996826171875,
-0.062347412109375,
0.0016460418701171875,
-0.01477813720703125,
0.0301666259765625,
0.061248779296875,
0.009002685546875,
0.0235748291015625,
0.04461669921875,
-0.10101318359375,
0.01427459716796875,
0.0026836395263671875,
-0.02825927734375,
-0.004207611083984375,
0.007381439208984375,
0.032745361328125,
0.00019288063049316406,
0.01454925537109375,
0.01371002197265625,
0.023834228515625,
0.004405975341796875,
0.042266845703125,
-0.0498046875,
0.047454833984375,
0.0207061767578125,
0.00792694091796875,
-0.0219573974609375,
0.043365478515625,
-0.0213165283203125,
0.03704833984375,
-0.007442474365234375,
-0.083251953125,
0.002910614013671875,
0.06365966796875,
-0.01371002197265625,
0.0010156631469726562,
-0.0212860107421875,
-0.00007987022399902344,
0.0005645751953125,
-0.0264892578125,
-0.01416015625,
0.006130218505859375,
0.0258941650390625,
0.0209197998046875,
-0.00933074951171875,
0.021820068359375,
0.00014913082122802734,
-0.007061004638671875,
0.0283203125,
-0.033447265625,
0.060394287109375,
-0.01708984375,
-0.006015777587890625,
-0.01126861572265625,
-0.0296478271484375,
0.0159454345703125,
0.02838134765625,
-0.0275115966796875,
0.0340576171875,
0.030242919921875,
-0.05267333984375,
0.046661376953125,
0.019805908203125,
0.005641937255859375,
0.029571533203125,
-0.0023403167724609375,
-0.01116180419921875,
-0.048919677734375,
-0.0234222412109375,
-0.0291595458984375,
0.0220489501953125,
0.029541015625,
0.01751708984375,
0.0111846923828125,
0.039703369140625,
-0.007579803466796875,
-0.01526641845703125,
0.04376220703125,
-0.004657745361328125,
0.0278472900390625,
0.07708740234375,
0.03131103515625,
-0.052703857421875,
-0.02337646484375,
0.057403564453125,
0.01271820068359375,
0.025482177734375,
0.0496826171875,
-0.026031494140625,
0.003833770751953125,
-0.0067138671875,
0.0111541748046875,
-0.019287109375,
-0.0213165283203125,
-0.046478271484375,
-0.0167999267578125,
0.038177490234375,
0.0157623291015625,
-0.031829833984375,
0.0280303955078125,
-0.005767822265625,
-0.002742767333984375,
-0.00701904296875,
-0.0191650390625,
-0.0111236572265625,
0.0176239013671875,
-0.0277099609375,
-0.0134124755859375,
0.01617431640625,
-0.00652313232421875,
-0.00666046142578125,
0.0110321044921875,
0.0036029815673828125,
0.03240966796875,
-0.0721435546875,
0.057464599609375,
-0.012451171875,
0.03607177734375,
-0.030517578125,
-0.00878143310546875,
0.0004363059997558594,
0.0290679931640625,
0.01910400390625,
0.0004334449768066406,
-0.01824951171875,
-0.053955078125,
-0.0084686279296875,
-0.003650665283203125,
-0.027618408203125,
-0.01776123046875,
-0.01195526123046875,
-0.02703857421875,
0.0034008026123046875,
0.0066680908203125,
-0.0208740234375,
0.005771636962890625,
0.02752685546875,
0.01302337646484375,
-0.00307464599609375,
-0.0206146240234375,
0.008087158203125,
0.004924774169921875,
-0.03411865234375,
-0.037353515625,
-0.023590087890625,
0.0254364013671875,
-0.01953125,
0.0132293701171875,
0.034820556640625,
-0.0266265869140625,
-0.00933074951171875,
0.019744873046875,
0.018463134765625,
0.0592041015625,
-0.0007214546203613281,
-0.01215362548828125,
0.041229248046875,
0.00426483154296875,
-0.034515380859375,
-0.08135986328125,
-0.0095977783203125,
-0.04296875,
0.0118255615234375,
-0.0303955078125,
0.002227783203125,
0.005397796630859375,
-0.042388916015625,
-0.0513916015625,
0.01493072509765625,
-0.0002894401550292969,
-0.02117919921875,
-0.0039005279541015625,
-0.0161590576171875,
0.01096343994140625,
0.01462554931640625,
0.0203094482421875,
-0.026336669921875,
-0.0594482421875,
-0.0219879150390625,
0.01209259033203125,
0.022918701171875,
0.0128631591796875,
0.00449371337890625,
0.001941680908203125,
0.035247802734375,
0.0384521484375,
0.0034656524658203125,
0.0322265625,
-0.00696563720703125,
0.0311431884765625,
0.056915283203125,
-0.0170745849609375,
0.0016326904296875,
-0.0166473388671875,
-0.060699462890625,
0.01824951171875,
-0.07891845703125,
-0.06243896484375,
-0.0699462890625,
-0.006591796875,
0.043731689453125,
0.004138946533203125,
-0.0121612548828125,
0.011444091796875,
-0.01424407958984375,
-0.0107879638671875,
-0.018218994140625,
-0.01202392578125,
-0.02001953125,
-0.00289154052734375,
-0.04461669921875,
-0.0034160614013671875,
0.041351318359375,
-0.01399993896484375,
-0.019012451171875,
0.001628875732421875,
-0.0012187957763671875,
-0.025238037109375,
-0.059600830078125,
0.017486572265625,
0.0804443359375,
-0.05047607421875,
-0.0229949951171875,
0.0238037109375,
-0.01207733154296875,
0.01276397705078125,
-0.0007534027099609375,
-0.007137298583984375,
-0.01000213623046875,
-0.038055419921875,
0.0294647216796875,
-0.021759033203125,
0.0280914306640625,
-0.05096435546875,
-0.00815582275390625,
-0.0297698974609375,
-0.0027408599853515625,
0.0246124267578125,
0.0150909423828125,
0.01715087890625,
-0.043701171875,
0.019744873046875,
-0.068603515625,
-0.022613525390625,
-0.037994384765625,
-0.011199951171875,
0.00537872314453125,
0.0018558502197265625,
-0.00144195556640625,
0.043182373046875,
-0.027801513671875,
0.00946044921875,
0.0206451416015625,
0.0171661376953125,
-0.02532958984375,
0.04345703125,
0.054595947265625,
0.01953125,
0.0195465087890625
] |
08813db2e8a65d3b8c8c797cb36b2064a0bacb6f
|
Wordpress Stackexchange
Q: how does $wpdb differ to WP_Query? I'm going to write a function to return the next/prev post in a specific category. can anyone tell me what the differences would be in using $wpdb as opposed to WP_Query(); eg new WP_Query(args)? what determines which of these should be used?
cheers,
Gregory
A: The wpdb class is the interface with the database. WP_Query uses wpdb to query the database. You should use WP_Query when dealing with the native WordPress tables, to integrate your code properly with the WordPress environment. Use wpdb directly when you need to access data in your own tables.
|
Q: how does $wpdb differ to WP_Query? I'm going to write a function to return the next/prev post in a specific category. can anyone tell me what the differences would be in using $wpdb as opposed to WP_Query(); eg new WP_Query(args)? what determines which of these should be used?
cheers,
Gregory
A: The wpdb class is the interface with the database. WP_Query uses wpdb to query the database. You should use WP_Query when dealing with the native WordPress tables, to integrate your code properly with the WordPress environment. Use wpdb directly when you need to access data in your own tables.
A: Pay attention that wp_query() doesn't exist in WP core, so I think almost nobody of us can tell you what is it.
$wpdb is object of the wpdb class, which provides ability to prepare and run database queries.
I'm going to write a function to return the next/prev post in a specific category
Use next_post_link/previous_post_link functions to do it.
Updated: To better understand when you have to use WP_Query read this thread When to use WP_query(), query_posts() and pre_get_posts
A: with a background in relational database development, what I needed was a guide to SQL. I finally found one I could relate to allowing me to understand the utility of $wpdb.
it would appear that using $wpdb is preferable to WP_Query if one is familiar with relational database design and SQL, and wants to keep database access as efficient as possible as long as one adheres to the safety precautions regarding data validation/preparation.
I'll play around with the $wpdb class/functions and move forward from there.
|
wordpress
|
{
"language": "en",
"length": 267,
"provenance": "stackexchange_00019.jsonl.gz:420435",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53819"
}
|
[
0.07037353515625,
0.0128936767578125,
0.00557708740234375,
-0.053375244140625,
0.035430908203125,
-0.035308837890625,
0.0265655517578125,
-0.0166778564453125,
0.019561767578125,
0.0276031494140625,
-0.078857421875,
-0.0005941390991210938,
0.0032100677490234375,
0.0075531005859375,
-0.0216064453125,
-0.033355712890625,
0.05633544921875,
-0.07269287109375,
-0.00920867919921875,
-0.01445770263671875,
0.01195526123046875,
0.0176544189453125,
0.0146636962890625,
0.0628662109375,
0.0305938720703125,
-0.0237884521484375,
0.0294952392578125,
0.015838623046875,
0.032379150390625,
0.008941650390625,
0.0218048095703125,
-0.036834716796875,
0.007587432861328125,
0.042510986328125,
-0.01134490966796875,
0.0194244384765625,
0.0287628173828125,
0.018341064453125,
0.04248046875,
0.0088043212890625,
0.0159454345703125,
-0.01242828369140625,
0.005176544189453125,
-0.0176544189453125,
-0.012908935546875,
-0.0163116455078125,
0.0140838623046875,
-0.028533935546875,
0.0214996337890625,
-0.0182952880859375,
0.01006317138671875,
-0.005001068115234375,
0.03399658203125,
-0.06103515625,
-0.027801513671875,
-0.00592041015625,
0.0119476318359375,
-0.0421142578125,
0.038848876953125,
-0.007534027099609375,
-0.036468505859375,
-0.0307769775390625,
0.037567138671875,
-0.0232086181640625,
0.0101470947265625,
0.0142974853515625,
0.07159423828125,
0.03564453125,
-0.0178070068359375,
-0.033935546875,
-0.010162353515625,
0.00653076171875,
-0.036865234375,
0.0206756591796875,
-0.043792724609375,
-0.00980377197265625,
0.039520263671875,
-0.0189971923828125,
-0.003509521484375,
0.052825927734375,
-0.0289764404296875,
0.021087646484375,
-0.08868408203125,
-0.00909423828125,
-0.01094818115234375,
-0.01369476318359375,
-0.0211944580078125,
-0.006877899169921875,
-0.027557373046875,
-0.0307159423828125,
-0.0223236083984375,
-0.040130615234375,
-0.034759521484375,
-0.0022983551025390625,
0.01165771484375,
-0.043731689453125,
-0.0268707275390625,
-0.01953125,
-0.0128326416015625,
0.0135650634765625,
-0.005985260009765625,
-0.00940704345703125,
-0.016998291015625,
-0.0055999755859375,
0.00960540771484375,
0.025726318359375,
-0.007320404052734375,
-0.00743865966796875,
0.037628173828125,
0.0251312255859375,
0.01523590087890625,
0.0127716064453125,
-0.007465362548828125,
-0.03955078125,
-0.0155029296875,
0.0252227783203125,
-0.0233306884765625,
-0.00385284423828125,
0.016632080078125,
-0.034332275390625,
0.006671905517578125,
0.02020263671875,
-0.00003927946090698242,
-0.04241943359375,
0.0224151611328125,
-0.00023221969604492188,
-0.01995849609375,
-0.00884246826171875,
-0.01447296142578125,
0.06903076171875,
-0.03106689453125,
-0.02349853515625,
0.036865234375,
-0.0041351318359375,
-0.01207733154296875,
-0.035064697265625,
0.0283660888671875,
0.004863739013671875,
0.0280914306640625,
0.01488494873046875,
0.02374267578125,
-0.03466796875,
-0.033050537109375,
0.0187835693359375,
-0.0034809112548828125,
-0.003662109375,
0.0163421630859375,
0.0169830322265625,
-0.0126495361328125,
-0.0171051025390625,
0.00995635986328125,
0.0128326416015625,
-0.00724029541015625,
0.00797271728515625,
-0.0026760101318359375,
0.020721435546875,
-0.028778076171875,
0.00690460205078125,
-0.01139068603515625,
0.0174713134765625,
-0.0033111572265625,
0.005130767822265625,
0.0218353271484375,
-0.056396484375,
-0.059051513671875,
-0.017578125,
-0.062744140625,
-0.005435943603515625,
0.0245208740234375,
0.00612640380859375,
0.038543701171875,
-0.015960693359375,
0.07086181640625,
0.005832672119140625,
-0.0037860870361328125,
0.0119476318359375,
-0.012786865234375,
-0.005466461181640625,
0.0238037109375,
0.0271453857421875,
-0.00246429443359375,
-0.0106201171875,
0.060455322265625,
-0.021881103515625,
-0.04443359375,
0.042816162109375,
0.007297515869140625,
0.056854248046875,
0.007266998291015625,
0.03045654296875,
0.017303466796875,
0.033294677734375,
-0.017578125,
0.059295654296875,
-0.01568603515625,
-0.0657958984375,
0.016326904296875,
0.0078582763671875,
-0.0072784423828125,
-0.0216522216796875,
-0.003589630126953125,
0.0171661376953125,
-0.0128021240234375,
0.0176544189453125,
-0.08380126953125,
0.0278167724609375,
-0.0258636474609375,
0.0374755859375,
0.03448486328125,
0.0300750732421875,
0.0036945343017578125,
0.02508544921875,
-0.023468017578125,
-0.026824951171875,
-0.058380126953125,
-0.010498046875,
-0.042877197265625,
0.00994110107421875,
-0.002002716064453125,
0.005802154541015625,
-0.0168304443359375,
-0.008514404296875,
-0.0215606689453125,
-0.01314544677734375,
0.0506591796875,
-0.0301971435546875,
0.00881195068359375,
-0.0232391357421875,
0.07470703125,
-0.0018863677978515625,
-0.00249481201171875,
0.007106781005859375,
0.05706787109375,
0.08599853515625,
0.0110626220703125,
-0.006290435791015625,
0.0163116455078125,
-0.048370361328125,
0.014007568359375,
0.0297698974609375,
0.03900146484375,
0.0258026123046875,
-0.0119781494140625,
-0.03521728515625,
-0.006626129150390625,
-0.040496826171875,
0.028564453125,
-0.040924072265625,
-0.00551605224609375,
0.01277923583984375,
0.01558685302734375,
-0.0175628662109375,
0.0240325927734375,
0.016754150390625,
-0.0194244384765625,
0.0203094482421875,
0.0111541748046875,
0.039215087890625,
-0.00649261474609375,
0.0024738311767578125,
-0.007110595703125,
-0.02667236328125,
-0.004852294921875,
-0.01557159423828125,
-0.01081085205078125,
-0.01201629638671875,
0.0148468017578125,
0.0120849609375,
0.0208282470703125,
-0.0257415771484375,
0.0004105567932128906,
-0.02557373046875,
0.01065826416015625,
0.033843994140625,
-0.040374755859375,
0.040802001953125,
-0.0279541015625,
-0.0078277587890625,
0.00595855712890625,
0.0174560546875,
-0.0070953369140625,
0.0657958984375,
-0.022796630859375,
-0.0269622802734375,
-0.0416259765625,
-0.017364501953125,
-0.0044403076171875,
0.0010271072387695312,
-0.0124969482421875,
-0.0125579833984375,
0.041107177734375,
0.0210418701171875,
-0.030059814453125,
0.040679931640625,
-0.0280303955078125,
-0.0233917236328125,
0.0107269287109375,
-0.0006880760192871094,
-0.00589752197265625,
-0.0212554931640625,
0.036590576171875,
0.034637451171875,
-0.0184173583984375,
-0.0205230712890625,
-0.0042266845703125,
0.025543212890625,
0.0174560546875,
-0.0059051513671875,
-0.0264739990234375,
0.0239105224609375,
-0.098388671875,
-0.0267181396484375,
0.04278564453125,
0.01480865478515625,
0.034820556640625,
-0.0167388916015625,
-0.00215911865234375,
0.040985107421875,
-0.0843505859375,
-0.10504150390625,
-0.04351806640625,
-0.060882568359375,
0.0276336669921875,
-0.0011320114135742188,
-0.01122283935546875,
-0.008087158203125,
0.00958251953125,
0.0310211181640625,
0.01401519775390625,
-0.0279693603515625,
-0.04571533203125,
-0.055511474609375,
-0.0562744140625,
0.005580902099609375,
0.007236480712890625,
0.013885498046875,
0.006038665771484375,
0.03448486328125,
0.0017194747924804688,
-0.0212860107421875,
-0.01129150390625,
-0.0002734661102294922,
-0.01708984375,
-0.028778076171875,
0.01776123046875,
-0.0238494873046875,
0.004901885986328125,
-0.01055145263671875,
0.0513916015625,
0.0249176025390625,
-0.0220794677734375,
0.005535125732421875,
0.032135009765625,
0.0457763671875,
0.039520263671875,
0.0360107421875,
-0.042266845703125,
0.012115478515625,
0.0143280029296875,
-0.04486083984375,
-0.0030670166015625,
-0.040283203125,
-0.03955078125,
0.032073974609375,
0.006072998046875,
0.00717926025390625,
0.005611419677734375,
0.0144805908203125,
0.03802490234375,
0.035491943359375,
-0.019805908203125,
-0.037353515625,
0.09619140625,
0.028106689453125,
0.05853271484375,
-0.01244354248046875,
-0.0200653076171875,
-0.0406494140625,
0.0150146484375,
-0.0206451416015625,
-0.004116058349609375,
0.005306243896484375,
-0.02099609375,
-0.0111236572265625,
-0.050567626953125,
0.05389404296875,
-0.00525665283203125,
-0.00843048095703125,
-0.0243682861328125,
-0.0215911865234375,
0.00048279762268066406,
0.06884765625,
-0.01224517822265625,
-0.02349853515625,
0.0189361572265625,
0.0105438232421875,
-0.048583984375,
0.0016269683837890625,
-0.057586669921875,
0.006816864013671875,
-0.0235137939453125,
-0.00600433349609375,
-0.0006551742553710938,
-0.0086212158203125,
-0.036590576171875,
0.04052734375,
-0.03704833984375,
-0.00864410400390625,
0.0406494140625,
-0.0307159423828125,
-0.004180908203125,
0.0118865966796875,
-0.005138397216796875,
-0.02923583984375,
-0.01546478271484375,
-0.023895263671875,
-0.0518798828125,
-0.0002644062042236328,
-0.005260467529296875,
0.0245819091796875,
0.005443572998046875,
-0.0048675537109375,
-0.0164337158203125,
0.019989013671875,
0.0042572021484375,
0.029205322265625,
0.0199737548828125,
0.021148681640625,
0.007274627685546875,
-0.0239105224609375,
0.0251312255859375,
-0.031585693359375,
-0.01450347900390625,
-0.05621337890625,
-0.004955291748046875,
-0.0065460205078125,
-0.045501708984375,
0.01158905029296875,
-0.06756591796875,
0.01837158203125,
-0.0015010833740234375,
-0.0164031982421875,
-0.031219482421875,
0.028656005859375,
-0.0261688232421875,
0.00992584228515625,
-0.0310211181640625,
-0.0248565673828125,
0.041168212890625,
0.0222625732421875,
0.003368377685546875,
-0.0012521743774414062,
0.0748291015625,
0.01776123046875,
-0.0276641845703125,
-0.0264892578125,
-0.01763916015625,
0.027679443359375,
-0.00952911376953125,
0.033294677734375,
0.006076812744140625,
-0.03631591796875,
0.0682373046875,
0.0005393028259277344,
-0.007022857666015625,
0.007312774658203125,
0.034820556640625,
0.01153564453125,
-0.00702667236328125,
-0.0082550048828125,
-0.008514404296875,
-0.0042724609375,
0.0289459228515625,
-0.00829315185546875,
-0.0250244140625,
0.004909515380859375,
0.0267486572265625,
-0.00307464599609375,
0.004276275634765625,
-0.03570556640625,
-0.00444793701171875,
0.00414276123046875,
0.047210693359375,
0.035003662109375,
-0.01021575927734375,
0.018096923828125,
-0.016571044921875,
0.012939453125,
-0.01149749755859375,
0.0232696533203125,
0.045074462890625,
0.027191162109375,
0.028778076171875,
0.0299835205078125,
0.0120697021484375,
-0.05511474609375,
-0.0039215087890625,
0.048431396484375,
0.005218505859375,
-0.01523590087890625,
-0.0122528076171875,
-0.029510498046875,
-0.003513336181640625,
0.01250457763671875,
-0.0014047622680664062,
0.046112060546875,
0.01971435546875,
-0.01126861572265625,
0.006328582763671875,
-0.01184844970703125,
-0.020172119140625,
-0.034454345703125,
0.048248291015625,
-0.007232666015625,
0.024200439453125,
0.027984619140625,
0.078369140625,
-0.027557373046875,
0.078369140625,
-0.0217742919921875,
0.045166015625,
0.0242462158203125,
0.01708984375,
0.00919342041015625,
-0.0150909423828125,
0.01441192626953125,
-0.017547607421875,
0.004352569580078125,
-0.0265350341796875,
-0.019317626953125,
-0.01050567626953125,
0.01528167724609375,
0.01464080810546875,
0.0262298583984375,
0.040130615234375,
0.023345947265625,
-0.015777587890625,
0.058746337890625,
0.1044921875,
0.0054473876953125,
-0.01348114013671875,
-0.029541015625,
0.01007080078125,
0.015655517578125,
-0.019622802734375,
0.0256805419921875,
-0.0169677734375,
0.061676025390625,
-0.056396484375,
0.031768798828125,
0.0024890899658203125,
-0.0038318634033203125,
0.0380859375,
-0.0179595947265625,
-0.034759521484375,
0.028350830078125,
0.027191162109375,
-0.023590087890625,
-0.028778076171875,
0.02484130859375,
-0.023193359375,
0.050140380859375,
-0.07830810546875,
0.03265380859375,
-0.075927734375,
-0.007396697998046875,
0.08197021484375,
0.060546875,
-0.00104522705078125,
-0.01419830322265625,
-0.043365478515625,
-0.0284576416015625,
-0.0180816650390625,
-0.03936767578125,
-0.0131072998046875,
-0.014923095703125,
-0.007022857666015625,
-0.0153350830078125,
0.0186767578125,
0.03472900390625,
-0.0230712890625,
0.03521728515625,
-0.008941650390625,
-0.01258087158203125,
-0.0362548828125,
0.07513427734375,
0.016845703125,
0.03466796875,
-0.0006265640258789062,
0.0197601318359375,
-0.0071868896484375,
-0.0024433135986328125,
0.01012420654296875,
-0.06610107421875,
-0.026702880859375,
-0.03887939453125,
-0.0232391357421875,
0.00803375244140625,
0.007160186767578125,
-0.0077972412109375,
0.06011962890625,
-0.0022792816162109375,
-0.0005006790161132812,
0.01100921630859375,
-0.0279541015625,
-0.039215087890625,
0.035125732421875,
0.0596923828125,
0.0084075927734375,
0.03460693359375,
-0.011871337890625,
-0.03564453125,
-0.003704071044921875,
0.0157012939453125,
-0.0148773193359375,
0.0361328125,
-0.04107666015625,
0.047943115234375,
0.03887939453125,
0.00975799560546875,
0.029266357421875,
-0.0079193115234375,
0.007320404052734375,
-0.0027751922607421875,
-0.01279449462890625,
-0.0218658447265625,
-0.004451751708984375,
0.0760498046875,
0.0018787384033203125,
-0.0206756591796875,
0.0498046875,
-0.0252227783203125,
0.034942626953125,
0.04541015625,
0.113525390625,
-0.0347900390625,
-0.0054779052734375,
0.0369873046875,
-0.05224609375,
-0.01097869873046875,
0.0156402587890625,
-0.0303192138671875,
-0.049957275390625,
0.033966064453125,
-0.02166748046875,
-0.00234222412109375,
0.0129852294921875,
-0.0058135986328125,
-0.020599365234375,
-0.0265960693359375,
0.02349853515625,
0.0183258056640625,
-0.0021343231201171875,
0.026458740234375,
-0.007389068603515625,
0.01480865478515625,
-0.0181884765625,
0.0055389404296875,
0.0308990478515625,
-0.0192413330078125,
-0.07977294921875,
0.0112762451171875,
0.0088043212890625,
-0.01375579833984375,
0.0131378173828125,
0.03436279296875,
0.024810791015625,
0.038177490234375,
0.0250244140625,
0.00272369384765625,
-0.00963592529296875,
0.0283966064453125,
-0.04852294921875,
-0.018951416015625,
0.031005859375,
0.059173583984375,
-0.07427978515625,
0.041473388671875,
-0.034332275390625,
0.007190704345703125,
0.01389312744140625,
-0.019744873046875,
0.021636962890625,
-0.048309326171875,
0.0170135498046875,
0.045135498046875,
0.006809234619140625,
-0.007427215576171875,
0.00760650634765625,
-0.015106201171875,
-0.0465087890625,
-0.0104217529296875,
-0.01065826416015625,
-0.038665771484375,
0.007354736328125,
-0.007030487060546875,
-0.0251312255859375,
0.047943115234375,
0.017120361328125,
0.0179443359375,
0.060943603515625,
-0.0036487579345703125,
-0.0311279296875,
-0.007659912109375,
-0.042266845703125,
0.03167724609375,
0.025115966796875,
0.04681396484375,
-0.05108642578125,
-0.019287109375,
-0.0003330707550048828,
0.03472900390625,
0.0662841796875,
-0.001934051513671875,
-0.03277587890625,
-0.0081787109375,
0.0665283203125,
0.044342041015625,
0.01042938232421875,
0.03082275390625,
0.0166015625,
0.06622314453125,
0.08013916015625,
-0.033294677734375,
0.05450439453125,
-0.0093994140625,
-0.0013275146484375,
0.03192138671875,
0.0167236328125,
0.01210784912109375,
0.01261138916015625,
0.006092071533203125,
-0.01444244384765625,
0.0091705322265625,
0.01543426513671875,
-0.0011577606201171875,
-0.0121002197265625,
0.07061767578125,
0.0330810546875,
-0.058868408203125,
-0.0635986328125,
-0.037017822265625,
0.029998779296875,
-0.00457000732421875,
0.037506103515625,
0.0684814453125,
0.0121917724609375,
0.11981201171875,
-0.01038360595703125,
0.01244354248046875,
-0.007320404052734375,
0.0091705322265625,
0.06182861328125,
0.023345947265625,
0.0215301513671875,
-0.05999755859375,
0.010772705078125,
0.061431884765625,
0.077880859375,
-0.060821533203125,
-0.03509521484375,
0.00925445556640625,
0.01079559326171875,
0.00710296630859375,
-0.024993896484375,
-0.006862640380859375,
-0.0179595947265625,
0.0150146484375,
-0.0193023681640625,
0.00543975830078125,
0.01071929931640625,
-0.007732391357421875,
-0.002857208251953125,
0.0279388427734375,
0.007320404052734375,
-0.001995086669921875,
0.011474609375,
-0.01309967041015625,
0.02764892578125,
0.02880859375,
-0.006687164306640625,
0.0173797607421875,
-0.03472900390625,
0.00024437904357910156,
-0.043914794921875,
0.04620361328125,
-0.00542449951171875,
0.05535888671875,
-0.0621337890625,
-0.038238525390625,
0.03173828125,
0.0430908203125,
0.0253143310546875,
0.036346435546875,
0.00738525390625,
0.0188446044921875,
0.042083740234375,
0.01451873779296875,
0.03997802734375,
-0.0025615692138671875,
-0.036956787109375,
-0.02728271484375,
0.0230560302734375,
0.025238037109375,
0.03167724609375,
0.011627197265625,
0.06121826171875,
-0.0022182464599609375,
0.00910186767578125,
0.024688720703125,
0.003314971923828125,
-0.0206451416015625,
0.038848876953125,
-0.0250244140625,
0.06884765625,
0.0171661376953125,
-0.047943115234375,
-0.031005859375,
0.01224517822265625,
-0.0238800048828125,
0.0267181396484375,
0.0452880859375,
0.0063018798828125,
-0.01373291015625,
0.0013971328735351562,
-0.020538330078125,
-0.0106353759765625,
0.00318145751953125,
0.0199737548828125,
-0.062286376953125,
-0.0148162841796875,
-0.0244598388671875,
-0.05267333984375,
-0.023681640625,
-0.0120697021484375,
0.00691986083984375,
-0.005157470703125,
0.027496337890625,
0.01178741455078125,
0.0056610107421875,
-0.0164947509765625,
0.04632568359375,
-0.05694580078125,
-0.027252197265625,
0.047515869140625,
-0.04827880859375,
-0.0154571533203125,
0.00223541259765625,
-0.032501220703125,
-0.034271240234375,
0.039459228515625,
-0.04669189453125,
-0.020050048828125,
-0.01340484619140625,
0.037445068359375,
-0.0273284912109375,
-0.0176849365234375,
-0.032867431640625,
0.040130615234375,
0.022430419921875,
-0.0255889892578125,
0.041534423828125,
-0.041717529296875,
-0.027435302734375,
0.0138397216796875,
0.007015228271484375,
-0.0214691162109375,
0.01520538330078125,
-0.011077880859375,
0.0195465087890625,
0.026885986328125,
-0.0035266876220703125,
-0.01180267333984375,
0.006744384765625,
-0.0278472900390625,
-0.01328277587890625,
0.0140838623046875,
-0.00032019615173339844,
0.01171875,
-0.07080078125,
-0.032318115234375,
0.01824951171875,
0.040069580078125,
0.0159149169921875,
0.0184783935546875,
-0.0306854248046875,
-0.02301025390625,
-0.007640838623046875,
-0.0182647705078125,
-0.020782470703125,
-0.002704620361328125,
-0.01910400390625,
0.0175628662109375,
-0.016632080078125,
-0.01381683349609375,
-0.052734375,
0.00007420778274536133,
0.0489501953125,
0.0239410400390625,
-0.06878662109375,
0.05419921875,
-0.0335693359375,
0.0024166107177734375,
0.00643157958984375,
-0.055694580078125,
0.0107421875,
0.018341064453125,
-0.0254669189453125,
-0.0305023193359375,
-0.04986572265625,
-0.01395416259765625,
-0.058563232421875,
0.03521728515625,
0.034515380859375,
-0.050445556640625,
0.00759124755859375,
0.059417724609375,
0.03338623046875,
0.10308837890625,
0.032989501953125,
-0.0208282470703125,
0.01088714599609375,
0.013397216796875,
-0.010589599609375,
-0.0201873779296875,
0.0005769729614257812,
-0.00624847412109375,
-0.0016050338745117188,
-0.01027679443359375,
0.0044708251953125,
0.02154541015625,
-0.0355224609375,
-0.100341796875,
0.048065185546875,
-0.0207061767578125,
-0.0386962890625,
-0.04437255859375,
0.004913330078125,
0.01419830322265625,
-0.01479339599609375,
-0.01611328125,
-0.0102996826171875,
-0.049591064453125,
0.000965118408203125,
0.03125,
0.03009033203125,
0.009735107421875,
0.00516510009765625,
-0.0794677734375,
0.0227508544921875,
-0.003864288330078125,
0.05523681640625,
-0.0132598876953125,
0.0259857177734375,
-0.00431060791015625,
0.0203399658203125,
-0.02874755859375,
0.035491943359375,
-0.00579071044921875,
0.022705078125,
-0.0238494873046875,
0.0067291259765625,
-0.0026035308837890625,
0.00804901123046875,
0.03399658203125,
0.0787353515625,
0.01132965087890625,
-0.039215087890625,
0.007091522216796875,
-0.0095367431640625,
-0.024139404296875,
-0.0216064453125,
0.01407623291015625,
-0.03729248046875,
-0.0121917724609375,
-0.0036373138427734375,
-0.003475189208984375,
-0.00013208389282226562,
-0.00006139278411865234,
-0.021881103515625,
-0.01617431640625,
-0.00818634033203125,
-0.01198577880859375,
-0.0252838134765625,
-0.06756591796875,
0.055450439453125,
-0.03411865234375,
-0.018829345703125,
0.00905609130859375,
0.04595947265625,
-0.01166534423828125,
0.01445770263671875,
0.00232696533203125,
0.0213775634765625,
-0.00792694091796875,
-0.0157318115234375,
0.0247650146484375,
-0.04669189453125,
0.0307769775390625,
0.01200103759765625,
-0.00548553466796875,
0.01690673828125,
0.00981903076171875,
0.0183868408203125,
-0.0184478759765625,
0.046722412109375,
0.01357269287109375,
0.049591064453125,
0.0258941650390625,
0.01715087890625,
0.0007476806640625,
0.0400390625,
-0.001438140869140625,
-0.032989501953125,
0.0028743743896484375,
-0.0245208740234375,
-0.0013561248779296875,
-0.007015228271484375,
-0.032073974609375,
-0.038177490234375,
0.0097808837890625,
0.006084442138671875,
-0.02496337890625,
0.01517486572265625
] |
29a07a5a565570576ff8d4221342e4bb8a0eeac7
|
Wordpress Stackexchange
Q: get_the_category_list or get_the_tag_list for custom post types and taxonomies? Basically I've setup a custom post type and taxonomy for a set type of posts and I'm creating a child theme from twentyeleven.
When I use the default WP Posts and then I tag them and categorize them, get_the_category_list and get_the_tag_list do their work and display below the post.
Now I would like to do the same with my custom post type with two taxonomies that behave as tags and categories. Is there a way I can do this without having to redo the work that get_the_category_list and get_the_tag_list already do?
A: You can use the generic get_the_term_list() for all taxonomies.
|
Q: get_the_category_list or get_the_tag_list for custom post types and taxonomies? Basically I've setup a custom post type and taxonomy for a set type of posts and I'm creating a child theme from twentyeleven.
When I use the default WP Posts and then I tag them and categorize them, get_the_category_list and get_the_tag_list do their work and display below the post.
Now I would like to do the same with my custom post type with two taxonomies that behave as tags and categories. Is there a way I can do this without having to redo the work that get_the_category_list and get_the_tag_list already do?
A: You can use the generic get_the_term_list() for all taxonomies.
|
wordpress
|
{
"language": "en",
"length": 111,
"provenance": "stackexchange_00019.jsonl.gz:420441",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53837"
}
|
[
0.048919677734375,
-0.003025054931640625,
-0.00894927978515625,
-0.05657958984375,
0.0264434814453125,
-0.016998291015625,
0.054229736328125,
0.01271820068359375,
-0.039642333984375,
-0.000530242919921875,
-0.0264892578125,
-0.0242462158203125,
-0.03985595703125,
-0.0290069580078125,
0.003475189208984375,
-0.0745849609375,
0.04962158203125,
-0.02734375,
0.032501220703125,
-0.0135040283203125,
0.0249481201171875,
0.0094146728515625,
0.0350341796875,
0.045928955078125,
0.039642333984375,
-0.032684326171875,
0.029266357421875,
-0.019500732421875,
0.0253448486328125,
-0.017852783203125,
0.03399658203125,
-0.00955963134765625,
0.029266357421875,
0.00020885467529296875,
-0.0177001953125,
0.0121002197265625,
-0.00780487060546875,
0.006305694580078125,
0.016204833984375,
0.006732940673828125,
0.025299072265625,
-0.02020263671875,
0.02032470703125,
-0.0105438232421875,
0.01073455810546875,
-0.0243682861328125,
0.025054931640625,
-0.060333251953125,
-0.00807952880859375,
-0.02716064453125,
0.045318603515625,
-0.0248565673828125,
0.06640625,
-0.08544921875,
-0.01580810546875,
-0.01134490966796875,
-0.003147125244140625,
-0.0330810546875,
0.05621337890625,
-0.045806884765625,
-0.03857421875,
-0.062347412109375,
0.05322265625,
-0.0066070556640625,
-0.00019180774688720703,
0.0362548828125,
0.056182861328125,
0.004367828369140625,
-0.04461669921875,
-0.02850341796875,
0.007740020751953125,
-0.038726806640625,
0.0185546875,
-0.01427459716796875,
-0.01220703125,
-0.0433349609375,
0.0286712646484375,
-0.0107574462890625,
0.005725860595703125,
0.003353118896484375,
0.01250457763671875,
-0.02587890625,
-0.0303802490234375,
-0.00298309326171875,
0.009307861328125,
0.0228118896484375,
-0.014495849609375,
-0.0175323486328125,
-0.03070068359375,
-0.03277587890625,
-0.0219268798828125,
-0.041961669921875,
-0.058685302734375,
0.01474761962890625,
0.0206451416015625,
-0.0283050537109375,
0.0307464599609375,
0.04840087890625,
-0.01320648193359375,
0.0257720947265625,
-0.01641845703125,
-0.042144775390625,
0.03717041015625,
-0.04388427734375,
0.033538818359375,
0.006565093994140625,
-0.032073974609375,
-0.00640869140625,
0.07598876953125,
0.041107177734375,
0.01004791259765625,
0.0380859375,
0.0174102783203125,
-0.024810791015625,
-0.0003452301025390625,
0.0018711090087890625,
-0.015838623046875,
0.0217742919921875,
0.007556915283203125,
-0.01030731201171875,
0.0167694091796875,
0.041290283203125,
0.005764007568359375,
0.013214111328125,
-0.002002716064453125,
0.0234375,
0.010986328125,
-0.06494140625,
0.028778076171875,
-0.0032863616943359375,
-0.044219970703125,
0.00846099853515625,
0.0218963623046875,
0.0161895751953125,
0.0006470680236816406,
-0.00891876220703125,
-0.033966064453125,
-0.020538330078125,
0.0102081298828125,
-0.006439208984375,
-0.0005741119384765625,
-0.022003173828125,
0.028045654296875,
-0.00516510009765625,
0.036041259765625,
0.00246429443359375,
0.009002685546875,
0.018035888671875,
0.020965576171875,
-0.002254486083984375,
0.0321044921875,
-0.0035152435302734375,
0.0283355712890625,
-0.00234222412109375,
-0.0089263916015625,
-0.039459228515625,
-0.005767822265625,
-0.035247802734375,
0.004337310791015625,
-0.045867919921875,
0.0299072265625,
0.011444091796875,
0.0019311904907226562,
-0.00925445556640625,
-0.0213775634765625,
-0.00778961181640625,
-0.0280914306640625,
-0.0013589859008789062,
0.0220489501953125,
-0.056396484375,
0.03460693359375,
0.00102996826171875,
0.02301025390625,
0.020751953125,
0.03350830078125,
0.02197265625,
-0.03424072265625,
-0.0233917236328125,
0.04937744140625,
0.00957489013671875,
-0.0206146240234375,
-0.0298614501953125,
0.02471923828125,
-0.005413055419921875,
-0.04351806640625,
0.004314422607421875,
0.01995849609375,
0.058563232421875,
0.021575927734375,
0.0301361083984375,
0.028289794921875,
-0.0158233642578125,
-0.068359375,
0.01483154296875,
0.00666046142578125,
0.013885498046875,
-0.0469970703125,
-0.00405120849609375,
0.0026607513427734375,
-0.0211029052734375,
-0.040985107421875,
-0.005397796630859375,
-0.0041046142578125,
0.0200653076171875,
-0.0170440673828125,
-0.0016231536865234375,
-0.0175323486328125,
0.039306640625,
0.002452850341796875,
0.0205535888671875,
0.004062652587890625,
-0.028778076171875,
-0.00753021240234375,
-0.031097412109375,
-0.01480865478515625,
0.0151824951171875,
-0.036651611328125,
-0.01535797119140625,
-0.0205230712890625,
-0.03436279296875,
-0.00001150369644165039,
-0.00977325439453125,
-0.005229949951171875,
0.0477294921875,
0.045166015625,
0.028472900390625,
-0.0221710205078125,
0.01113128662109375,
0.0360107421875,
0.062225341796875,
-0.056854248046875,
-0.029083251953125,
0.0374755859375,
0.0194244384765625,
-0.0234832763671875,
0.00040078163146972656,
0.058563232421875,
-0.042999267578125,
0.01910400390625,
0.046051025390625,
0.0321044921875,
0.01395416259765625,
-0.01291656494140625,
-0.0012788772583007812,
0.0811767578125,
-0.0189971923828125,
0.005615234375,
-0.012725830078125,
0.0305938720703125,
0.048858642578125,
0.04754638671875,
0.0194854736328125,
0.004772186279296875,
0.0241851806640625,
0.034912109375,
0.01091766357421875,
0.01148223876953125,
-0.01168060302734375,
0.022216796875,
-0.03857421875,
0.02362060546875,
-0.0170745849609375,
-0.05584716796875,
0.0238037109375,
0.042144775390625,
0.02496337890625,
0.048614501953125,
0.041748046875,
-0.00928497314453125,
-0.007720947265625,
-0.0004432201385498047,
-0.004772186279296875,
0.0029754638671875,
0.041595458984375,
-0.0174560546875,
0.00948333740234375,
-0.0296630859375,
-0.0012750625610351562,
-0.022857666015625,
0.00562286376953125,
0.01116943359375,
0.05975341796875,
-0.02288818359375,
-0.005374908447265625,
-0.041015625,
-0.06024169921875,
-0.01226806640625,
0.0625,
-0.057403564453125,
-0.025238037109375,
0.00736236572265625,
0.020233154296875,
-0.00989532470703125,
-0.0095977783203125,
-0.0240936279296875,
0.0031108856201171875,
0.007114410400390625,
-0.035125732421875,
0.036895751953125,
-0.028411865234375,
0.0093231201171875,
0.06243896484375,
0.0106964111328125,
-0.0081329345703125,
0.02301025390625,
-0.0178985595703125,
0.02740478515625,
0.0153656005859375,
0.0012388229370117188,
-0.01666259765625,
-0.047271728515625,
-0.018524169921875,
0.01308441162109375,
0.048126220703125,
-0.0036792755126953125,
-0.04827880859375,
-0.01132965087890625,
0.044952392578125,
-0.034698486328125,
-0.005096435546875,
0.0765380859375,
-0.04730224609375,
-0.002124786376953125,
-0.050994873046875,
-0.0338134765625,
-0.037506103515625,
-0.0379638671875,
-0.007625579833984375,
0.015716552734375,
-0.03155517578125,
-0.03924560546875,
-0.045684814453125,
-0.06854248046875,
-0.02362060546875,
-0.0016126632690429688,
0.002552032470703125,
0.0103912353515625,
0.08544921875,
0.0079345703125,
-0.057769775390625,
0.0068359375,
0.01384735107421875,
-0.01264190673828125,
0.05224609375,
0.01678466796875,
-0.014251708984375,
0.035552978515625,
0.01316070556640625,
-0.0310821533203125,
0.0263519287109375,
-0.00852203369140625,
-0.03204345703125,
-0.01291656494140625,
0.02117919921875,
0.031402587890625,
-0.0201873779296875,
-0.01079559326171875,
0.0572509765625,
0.025482177734375,
-0.005828857421875,
0.03131103515625,
-0.0092315673828125,
-0.00043773651123046875,
0.016021728515625,
-0.01947021484375,
-0.01468658447265625,
-0.01189422607421875,
0.01508331298828125,
-0.0142364501953125,
0.02288818359375,
0.01126861572265625,
-0.04034423828125,
0.03338623046875,
-0.004764556884765625,
-0.009979248046875,
-0.0030803680419921875,
-0.0107421875,
-0.045257568359375,
0.018646240234375,
-0.0254364013671875,
0.0019254684448242188,
-0.007030487060546875,
-0.0024356842041015625,
-0.0241851806640625,
-0.07708740234375,
0.05926513671875,
-0.03387451171875,
-0.04669189453125,
-0.0238037109375,
-0.0213775634765625,
0.01393890380859375,
0.089111328125,
-0.0229339599609375,
-0.0031414031982421875,
-0.01134490966796875,
0.01453399658203125,
-0.016693115234375,
-0.057708740234375,
-0.039703369140625,
-0.037384033203125,
-0.09112548828125,
0.000016689300537109375,
-0.0014295578002929688,
-0.041900634765625,
-0.0096588134765625,
0.049285888671875,
-0.06866455078125,
-0.032318115234375,
0.03759765625,
-0.033538818359375,
0.016082763671875,
-0.00852203369140625,
0.0295562744140625,
-0.056976318359375,
-0.0225677490234375,
-0.00885772705078125,
-0.034637451171875,
-0.005466461181640625,
-0.017486572265625,
0.01450347900390625,
0.0162811279296875,
-0.0182952880859375,
0.029571533203125,
0.049774169921875,
0.0345458984375,
-0.0001747608184814453,
0.0147552490234375,
-0.01073455810546875,
0.0183868408203125,
-0.00881195068359375,
0.01067352294921875,
-0.0139312744140625,
-0.056884765625,
-0.040740966796875,
-0.0135040283203125,
0.03814697265625,
0.017303466796875,
0.0163726806640625,
0.0058441162109375,
0.010467529296875,
-0.047088623046875,
-0.02716064453125,
-0.051055908203125,
-0.0545654296875,
-0.034423828125,
0.0031948089599609375,
0.006072998046875,
-0.050323486328125,
0.041107177734375,
0.0142974853515625,
-0.027069091796875,
0.005413055419921875,
0.07159423828125,
0.010223388671875,
-0.0263824462890625,
-0.047515869140625,
-0.004032135009765625,
0.02978515625,
-0.025421142578125,
0.04254150390625,
0.0270843505859375,
-0.02001953125,
0.052642822265625,
0.005695343017578125,
-0.0017185211181640625,
0.002475738525390625,
0.0716552734375,
-0.001995086669921875,
0.007457733154296875,
-0.005519866943359375,
-0.0240631103515625,
-0.00702667236328125,
0.048614501953125,
-0.0234222412109375,
-0.0216064453125,
-0.022613525390625,
0.035736083984375,
-0.024566650390625,
0.0296478271484375,
-0.03765869140625,
0.00843048095703125,
0.0119781494140625,
0.0379638671875,
-0.0163421630859375,
0.0247344970703125,
-0.002689361572265625,
-0.03173828125,
-0.0499267578125,
0.01105499267578125,
-0.02294921875,
0.002231597900390625,
0.0158843994140625,
0.02105712890625,
0.0030689239501953125,
0.019287109375,
-0.031646728515625,
0.00799560546875,
0.0084228515625,
-0.02130126953125,
-0.036773681640625,
-0.0193328857421875,
-0.00612640380859375,
0.017425537109375,
0.034210205078125,
-0.01271820068359375,
0.032989501953125,
0.042327880859375,
-0.0099029541015625,
0.01010894775390625,
-0.03179931640625,
0.01947021484375,
-0.041259765625,
-0.0152435302734375,
0.016754150390625,
-0.01396942138671875,
-0.0005478858947753906,
0.067138671875,
0.013580322265625,
0.03936767578125,
-0.0277557373046875,
0.018402099609375,
0.000060439109802246094,
0.0159759521484375,
0.01519012451171875,
-0.00553131103515625,
0.00908660888671875,
-0.026031494140625,
0.006015777587890625,
-0.01485443115234375,
-0.0041046142578125,
0.0110931396484375,
0.0293426513671875,
-0.0009160041809082031,
-0.00966644287109375,
0.0186614990234375,
-0.023284912109375,
-0.007236480712890625,
-0.011322021484375,
-0.024566650390625,
-0.019866943359375,
-0.0171661376953125,
0.021331787109375,
0.0279083251953125,
0.00550079345703125,
-0.0328369140625,
0.0472412109375,
-0.020904541015625,
0.06207275390625,
-0.0081329345703125,
-0.0065460205078125,
0.01898193359375,
0.026031494140625,
-0.07586669921875,
-0.01296234130859375,
0.0341796875,
-0.04705810546875,
-0.01824951171875,
-0.002590179443359375,
-0.033721923828125,
-0.004650115966796875,
-0.01015472412109375,
0.0567626953125,
-0.034759521484375,
-0.044036865234375,
-0.005702972412109375,
-0.0095367431640625,
0.09063720703125,
0.044769287109375,
-0.02471923828125,
-0.00433349609375,
-0.065185546875,
-0.00928497314453125,
-0.020355224609375,
-0.06427001953125,
-0.0290985107421875,
0.0020046234130859375,
0.0178680419921875,
0.01114654541015625,
0.019866943359375,
0.014892578125,
-0.016571044921875,
0.01248931884765625,
0.01444244384765625,
0.005279541015625,
-0.0038013458251953125,
0.0231170654296875,
0.023651123046875,
0.0127410888671875,
0.015960693359375,
-0.007160186767578125,
-0.0248870849609375,
-0.01306915283203125,
-0.02191162109375,
-0.08587646484375,
-0.003353118896484375,
0.01152801513671875,
-0.0014657974243164062,
0.039581298828125,
0.0099945068359375,
0.0196380615234375,
0.010467529296875,
-0.0182342529296875,
0.002758026123046875,
-0.00788116455078125,
-0.0228271484375,
-0.005916595458984375,
-0.031402587890625,
0.040435791015625,
-0.0093994140625,
0.0006613731384277344,
0.004802703857421875,
-0.0263519287109375,
0.0297698974609375,
-0.00609588623046875,
0.027069091796875,
0.007152557373046875,
-0.00835418701171875,
0.009857177734375,
0.0311126708984375,
0.0109710693359375,
0.0025386810302734375,
-0.013580322265625,
0.0033664703369140625,
-0.0224609375,
0.0094451904296875,
-0.0190887451171875,
-0.023712158203125,
0.041290283203125,
0.01007843017578125,
-0.022918701171875,
0.032745361328125,
-0.0352783203125,
-0.035003662109375,
0.004856109619140625,
0.0347900390625,
-0.01296234130859375,
-0.01105499267578125,
0.048095703125,
0.005908966064453125,
-0.051300048828125,
0.0347900390625,
-0.04669189453125,
-0.052154541015625,
-0.00820159912109375,
-0.0589599609375,
-0.021270751953125,
-0.006351470947265625,
0.001007080078125,
-0.0186309814453125,
-0.01398468017578125,
0.053924560546875,
0.0199737548828125,
0.014190673828125,
-0.01239013671875,
-0.01751708984375,
-0.003612518310546875,
-0.020751953125,
0.02667236328125,
-0.040008544921875,
-0.0187530517578125,
-0.04107666015625,
0.0117950439453125,
0.011474609375,
-0.006633758544921875,
0.0083770751953125,
-0.041534423828125,
-0.0009617805480957031,
0.029571533203125,
-0.0318603515625,
0.0066986083984375,
-0.00225830078125,
-0.051300048828125,
-0.013092041015625,
0.00516510009765625,
-0.00258636474609375,
0.001720428466796875,
-0.01010894775390625,
-0.0019350051879882812,
-0.048583984375,
-0.0027484893798828125,
-0.00543975830078125,
-0.041290283203125,
0.060821533203125,
-0.02899169921875,
-0.010040283203125,
0.01444244384765625,
0.0207977294921875,
0.01611328125,
-0.0213623046875,
0.03466796875,
-0.0264892578125,
0.006107330322265625,
-0.01535797119140625,
0.0012235641479492188,
-0.01111602783203125,
-0.02081298828125,
-0.07879638671875,
0.09033203125,
0.008056640625,
0.04986572265625,
-0.0027561187744140625,
0.0167083740234375,
-0.008331298828125,
-0.0005879402160644531,
-0.05120849609375,
0.06634521484375,
0.0183563232421875,
0.0155487060546875,
-0.0933837890625,
-0.021240234375,
-0.0264129638671875,
0.04547119140625,
0.03912353515625,
0.01236724853515625,
-0.0259552001953125,
-0.01324462890625,
0.04986572265625,
0.03948974609375,
0.004894256591796875,
0.0193023681640625,
0.037384033203125,
0.04742431640625,
0.0229034423828125,
-0.0181427001953125,
0.054107666015625,
-0.051177978515625,
-0.01113128662109375,
0.05255126953125,
0.0213623046875,
0.0106658935546875,
0.0014867782592773438,
0.00490570068359375,
-0.056732177734375,
0.011383056640625,
0.03704833984375,
-0.00994873046875,
-0.0015954971313476562,
0.043060302734375,
0.049896240234375,
-0.031982421875,
0.0211944580078125,
-0.0382080078125,
0.056671142578125,
-0.0031890869140625,
0.034759521484375,
0.0033321380615234375,
0.0052642822265625,
0.0709228515625,
-0.0076446533203125,
0.0222625732421875,
0.01580810546875,
-0.01113128662109375,
0.047821044921875,
0.0163726806640625,
-0.00336456298828125,
-0.06207275390625,
0.024566650390625,
0.037933349609375,
0.051513671875,
-0.06427001953125,
-0.04901123046875,
0.0152130126953125,
0.02227783203125,
0.00670623779296875,
0.00919342041015625,
0.02392578125,
0.0185089111328125,
0.07879638671875,
-0.067138671875,
-0.00861358642578125,
0.00321197509765625,
0.045257568359375,
-0.0099334716796875,
-0.01226043701171875,
-0.0279998779296875,
-0.046539306640625,
-0.0638427734375,
0.0200958251953125,
0.0255584716796875,
0.0576171875,
0.0213165283203125,
0.06085205078125,
-0.00896453857421875,
-0.023651123046875,
0.006511688232421875,
0.03887939453125,
0.005153656005859375,
-0.01512908935546875,
-0.00704193115234375,
-0.0292816162109375,
0.003551483154296875,
0.0258636474609375,
0.0255584716796875,
-0.0213470458984375,
0.01068115234375,
0.03997802734375,
0.0088653564453125,
-0.01445770263671875,
0.057342529296875,
0.013153076171875,
-0.00585174560546875,
-0.02545166015625,
-0.006744384765625,
0.0216217041015625,
-0.0216217041015625,
0.032379150390625,
-0.04217529296875,
0.07525634765625,
-0.02911376953125,
0.0625,
-0.00592041015625,
-0.024017333984375,
0.046966552734375,
-0.0028209686279296875,
0.09222412109375,
-0.00539398193359375,
-0.08935546875,
-0.00838470458984375,
-0.0859375,
-0.01421356201171875,
0.043304443359375,
0.03289794921875,
0.00572967529296875,
0.00568389892578125,
-0.00768280029296875,
-0.049713134765625,
0.0111236572265625,
0.03387451171875,
0.033843994140625,
0.0279083251953125,
-0.0288848876953125,
0.001850128173828125,
-0.038909912109375,
-0.016998291015625,
-0.014007568359375,
0.01490020751953125,
0.034759521484375,
0.030181884765625,
0.00528717041015625,
0.0215911865234375,
-0.037384033203125,
0.0867919921875,
-0.092529296875,
-0.04254150390625,
0.053985595703125,
0.005519866943359375,
0.004032135009765625,
-0.002094268798828125,
-0.01232147216796875,
0.0186309814453125,
0.04766845703125,
-0.0452880859375,
-0.0027675628662109375,
-0.01242828369140625,
0.00707244873046875,
-0.0264434814453125,
0.046905517578125,
-0.019012451171875,
-0.01345062255859375,
-0.0389404296875,
-0.0225982666015625,
0.0350341796875,
0.02520751953125,
0.0012798309326171875,
-0.006153106689453125,
-0.005634307861328125,
-0.0194091796875,
0.01593017578125,
0.023590087890625,
0.005435943603515625,
0.03155517578125,
-0.029998779296875,
-0.041107177734375,
0.029205322265625,
-0.0095062255859375,
0.0123748779296875,
0.01983642578125,
0.025970458984375,
0.042694091796875,
-0.0238494873046875,
-0.0006928443908691406,
0.00623321533203125,
0.0335693359375,
-0.036651611328125,
0.01451873779296875,
0.0020294189453125,
0.00689697265625,
0.01242828369140625,
-0.059356689453125,
-0.034942626953125,
-0.047149658203125,
-0.008087158203125,
0.00479888916015625,
-0.01488494873046875,
-0.0565185546875,
-0.0178985595703125,
-0.0168609619140625,
0.03173828125,
-0.0187835693359375,
0.01494598388671875,
0.00920867919921875,
-0.051116943359375,
-0.017486572265625,
-0.01009368896484375,
-0.0343017578125,
0.0213775634765625,
0.0214385986328125,
-0.047119140625,
-0.00518035888671875,
-0.0300445556640625,
-0.01471710205078125,
-0.01910400390625,
0.038330078125,
0.0428466796875,
-0.0516357421875,
-0.04217529296875,
0.066162109375,
0.0377197265625,
0.1131591796875,
0.02825927734375,
-0.0246124267578125,
-0.0207977294921875,
0.0264892578125,
-0.03436279296875,
-0.034912109375,
0.04681396484375,
-0.050750732421875,
-0.0310821533203125,
0.01558685302734375,
0.0208740234375,
0.0574951171875,
-0.019195556640625,
-0.07574462890625,
0.06890869140625,
-0.0281219482421875,
-0.0341796875,
-0.036895751953125,
0.0056304931640625,
-0.00894927978515625,
-0.0029697418212890625,
0.0025424957275390625,
-0.03326416015625,
-0.026519775390625,
0.0301361083984375,
0.0199127197265625,
0.033843994140625,
0.03204345703125,
-0.0033359527587890625,
-0.062042236328125,
-0.00365447998046875,
-0.007808685302734375,
0.02679443359375,
-0.001110076904296875,
-0.00841522216796875,
-0.009857177734375,
0.021728515625,
-0.052734375,
-0.0208587646484375,
-0.0142059326171875,
0.0252685546875,
0.0150909423828125,
-0.033294677734375,
-0.0223236083984375,
-0.0411376953125,
-0.01175689697265625,
0.01425933837890625,
0.0004279613494873047,
0.007781982421875,
-0.0618896484375,
-0.03387451171875,
-0.050323486328125,
-0.01441192626953125,
0.041717529296875,
-0.0869140625,
0.01015472412109375,
0.01560211181640625,
-0.01395416259765625,
-0.001857757568359375,
-0.01097869873046875,
-0.049560546875,
-0.00832366943359375,
-0.039825439453125,
0.0026397705078125,
-0.061798095703125,
0.02410888671875,
-0.01320648193359375,
-0.009613037109375,
-0.0280609130859375,
-0.01568603515625,
-0.004787445068359375,
-0.03912353515625,
-0.0079345703125,
-0.011199951171875,
0.002674102783203125,
0.01129913330078125,
0.01197052001953125,
0.01416778564453125,
-0.0079193115234375,
0.0209808349609375,
0.028076171875,
-0.015167236328125,
0.022308349609375,
0.0012683868408203125,
0.0238189697265625,
-0.0204620361328125,
0.05517578125,
0.025054931640625,
0.028045654296875,
0.01462554931640625,
0.058197021484375,
0.00714874267578125,
0.06317138671875,
-0.022216796875,
-0.033599853515625,
-0.00893402099609375,
-0.02960205078125,
-0.0053863525390625,
-0.001705169677734375,
-0.028717041015625,
-0.019287109375,
-0.00771331787109375,
-0.0272369384765625,
-0.01337432861328125,
0.00957489013671875
] |
0cbc4eb8e40f8f1851a46a5ab609382a384719c4
|
Wordpress Stackexchange
Q: Add a custom walker to a menu created in a widget I know how to add a Walker to a custom menu created by the theme (menu named primary in this example), but how can I target a menu thats created in a widget with the default wordpress custom menu widget?
if ( has_nav_menu( 'primary' ) ) {
$args = array(
'menu' => 'main-menu',
'menu_id' => 'main-menu',
'theme_location' => 'primary',
'depth' => 0,
'container' => false,
'menu_class' => 'nav',
'walker' => new Myprefix_Walker_Nav_Menu(),
'echo' => 0
);
$nav = wp_nav_menu( $args );
}
A: Expanding on @Eugene's answer, if you want to limit this to a specific menu, just check the term ID of the menu:
function custom_nav_args($args){
$menu = $args['menu'];
if($menu->term_id === 17) /* replace term_id with menu id, or use $menu->name to do it by menu name*/
{
$args['walker'] = new My_Custom_Walker();
}
return $args;
}
add_filter('wp_nav_menu_args', 'custom_nav_args');
|
Q: Add a custom walker to a menu created in a widget I know how to add a Walker to a custom menu created by the theme (menu named primary in this example), but how can I target a menu thats created in a widget with the default wordpress custom menu widget?
if ( has_nav_menu( 'primary' ) ) {
$args = array(
'menu' => 'main-menu',
'menu_id' => 'main-menu',
'theme_location' => 'primary',
'depth' => 0,
'container' => false,
'menu_class' => 'nav',
'walker' => new Myprefix_Walker_Nav_Menu(),
'echo' => 0
);
$nav = wp_nav_menu( $args );
}
A: Expanding on @Eugene's answer, if you want to limit this to a specific menu, just check the term ID of the menu:
function custom_nav_args($args){
$menu = $args['menu'];
if($menu->term_id === 17) /* replace term_id with menu id, or use $menu->name to do it by menu name*/
{
$args['walker'] = new My_Custom_Walker();
}
return $args;
}
add_filter('wp_nav_menu_args', 'custom_nav_args');
A: This is an alternative to targeting a menu by term_id and I thought it might be of use to someone as a way of modifying several menus without having to look up their ids.
By adding print_r($args) to a filter, I noticed that $args['menu'] is a string for menus in predefined theme locations and WP_Term_Object for a custom menu widget in a sidebar.
I used this to target menus by slug and add a class to their container. A number of menus can be targeted by including a common string in their slugs. Note: menu slug comes from the array key in register_nav_menus().
function my_menu_thingy( $args ) {
if( is_object($args['menu']) && strpos($args['menu']->{slug},'my-common-string') !== false ) {
$args['walker'] = new My_Custom_Walker();
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_menu_thingy' );
For a single menu you would just need to check that $args['menu']->{slug} == 'your-slug' instead of the strpos() bit above.
A: You can add a custom walker to a nav menu created in a widget using the widget_nav_menu_args filter added in wordpress 4.2.0. It accepts four arguments (see wp-includes/widgets/class-wp-nav-menu-widget.php). But to add only a custom walker you just need to use the first argument, the same way you use the wp_nav_menu_args filter.
add_filter('wp_nav_menu_args', 'my_args'); //for menus
add_filter('widget_nav_menu_args', 'my_args'); //for menus in widgets
function my_args($args) { //$args is only argument needed to add custom walker
return array_merge( $args, array(
'walker' => new My_Custom_Walker(),
) );
}
A: If you look at implementation of WP_Nav_Menu_Widget class you will see the following code:
function widget($args, $instance) {
// Get menu
$nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false;
if ( !$nav_menu )
return;
$instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
echo $args['before_widget'];
if ( !empty($instance['title']) )
echo $args['before_title'] . $instance['title'] . $args['after_title'];
wp_nav_menu( array( 'fallback_cb' => '', 'menu' => $nav_menu ) );
echo $args['after_widget'];
}
It means that there is no any chance to hook a menu. So you need to take a look at wp_nav_menu function implementation, where you can find following lines of code:
$defaults = array(
'menu' => '',
'container' => 'div',
'container_class' => '',
'container_id' => '',
'menu_class' => 'menu',
'menu_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
'depth' => 0,
'walker' => '',
'theme_location' => ''
);
$args = wp_parse_args( $args, $defaults );
$args = apply_filters( 'wp_nav_menu_args', $args );
$args = (object) $args;
Here you can see that all arguments passed to the wp_nav_menu function could be replaced. So what you need is to create your own hook handler which will add your walker to a navigation menu. It could be simple as:
function myplugin_custom_walker( $args ) {
return array_merge( $args, array(
'walker' => new My_Custom_Walker(),
// another setting go here ...
) );
}
add_filter( 'wp_nav_menu_args', 'myplugin_custom_walker' );
|
wordpress
|
{
"language": "en",
"length": 630,
"provenance": "stackexchange_00019.jsonl.gz:420475",
"question_score": "11",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53950"
}
|
[
0.07550048828125,
-0.034759521484375,
0.061279296875,
-0.0187835693359375,
-0.010009765625,
-0.01311492919921875,
0.05621337890625,
-0.0281219482421875,
-0.05963134765625,
0.00917816162109375,
-0.014251708984375,
-0.0011911392211914062,
-0.0643310546875,
-0.0260009765625,
0.006801605224609375,
-0.07452392578125,
0.019622802734375,
0.035858154296875,
0.044219970703125,
-0.019622802734375,
0.02838134765625,
-0.00920867919921875,
0.028839111328125,
0.096435546875,
0.0285491943359375,
-0.0215606689453125,
0.0020084381103515625,
-0.0229034423828125,
0.0078125,
0.0025615692138671875,
0.01453399658203125,
-0.01090240478515625,
0.00910186767578125,
-0.03643798828125,
0.06109619140625,
0.01215362548828125,
0.0207977294921875,
-0.0166168212890625,
0.03106689453125,
-0.018280029296875,
0.01480865478515625,
-0.0005154609680175781,
-0.0304107666015625,
0.0008401870727539062,
-0.040069580078125,
-0.0389404296875,
0.0008192062377929688,
-0.0241851806640625,
0.0014600753784179688,
-0.053253173828125,
0.0163421630859375,
-0.0005517005920410156,
0.03448486328125,
-0.03167724609375,
-0.0160064697265625,
-0.006591796875,
0.013153076171875,
-0.058563232421875,
0.04656982421875,
0.049468994140625,
-0.02001953125,
-0.043426513671875,
0.023773193359375,
-0.06842041015625,
-0.0174713134765625,
0.01543426513671875,
0.00202178955078125,
0.002895355224609375,
-0.04345703125,
-0.02862548828125,
0.01800537109375,
-0.0341796875,
0.002384185791015625,
0.03558349609375,
-0.033416748046875,
-0.08013916015625,
0.053802490234375,
-0.037261962890625,
0.00214385986328125,
0.0379638671875,
0.038604736328125,
0.0215911865234375,
-0.00022351741790771484,
0.0015020370483398438,
0.01837158203125,
0.018218994140625,
-0.0100555419921875,
-0.039031982421875,
0.007747650146484375,
-0.0181121826171875,
-0.000011205673217773438,
-0.004009246826171875,
-0.004276275634765625,
-0.00940704345703125,
-0.01012420654296875,
-0.04437255859375,
-0.0184783935546875,
0.0295867919921875,
-0.0008254051208496094,
0.0706787109375,
0.007442474365234375,
-0.044921875,
0.10205078125,
-0.08587646484375,
0.0060882568359375,
0.0645751953125,
0.01800537109375,
0.0277099609375,
0.036773681640625,
0.013458251953125,
0.037567138671875,
0.03271484375,
0.01666259765625,
-0.01039886474609375,
-0.0296173095703125,
-0.00626373291015625,
-0.01043701171875,
-0.0096282958984375,
0.00397491455078125,
-0.0239410400390625,
-0.0145416259765625,
-0.00015854835510253906,
0.0158538818359375,
-0.013641357421875,
0.038787841796875,
0.01285552978515625,
-0.0160064697265625,
-0.006740570068359375,
-0.03338623046875,
0.0137939453125,
-0.0008950233459472656,
0.005451202392578125,
0.03076171875,
0.058319091796875,
-0.00006920099258422852,
-0.01047515869140625,
0.0201416015625,
-0.0210418701171875,
-0.007068634033203125,
0.00319671630859375,
0.029296875,
-0.01467132568359375,
-0.0291290283203125,
-0.0159149169921875,
0.01403045654296875,
0.0015249252319335938,
0.0026111602783203125,
0.022064208984375,
0.0193939208984375,
-0.0129852294921875,
-0.006198883056640625,
-0.032928466796875,
0.0239715576171875,
0.0161895751953125,
-0.0198211669921875,
0.009857177734375,
0.0219879150390625,
-0.014892578125,
-0.04718017578125,
-0.030853271484375,
-0.05657958984375,
-0.007183074951171875,
0.00826263427734375,
-0.10552978515625,
-0.06329345703125,
-0.0013799667358398438,
0.00799560546875,
0.01006317138671875,
0.01285552978515625,
0.050201416015625,
-0.02447509765625,
-0.0202789306640625,
-0.01412200927734375,
0.014923095703125,
-0.0098114013671875,
0.0133209228515625,
-0.01678466796875,
0.03338623046875,
0.01605224609375,
0.016265869140625,
-0.0102691650390625,
-0.057891845703125,
0.046142578125,
-0.01035308837890625,
-0.068115234375,
0.026458740234375,
0.010955810546875,
0.11737060546875,
0.0285491943359375,
0.033599853515625,
0.0032482147216796875,
-0.04998779296875,
-0.07476806640625,
-0.011077880859375,
-0.022186279296875,
0.005924224853515625,
0.017852783203125,
0.00014388561248779297,
-0.0020771026611328125,
0.032562255859375,
-0.010498046875,
-0.03912353515625,
0.01519012451171875,
-0.01280975341796875,
-0.092041015625,
0.00638580322265625,
-0.040374755859375,
0.03985595703125,
0.0292816162109375,
0.005146026611328125,
-0.0172576904296875,
-0.017120361328125,
0.0237274169921875,
-0.030120849609375,
-0.05078125,
0.002902984619140625,
-0.00281524658203125,
0.051544189453125,
-0.017730712890625,
0.01248931884765625,
-0.0292816162109375,
-0.052276611328125,
-0.01271820068359375,
0.03533935546875,
0.043060302734375,
-0.0181884765625,
-0.0179290771484375,
-0.0183868408203125,
0.01239776611328125,
0.0078887939453125,
-0.044891357421875,
0.0341796875,
0.050567626953125,
0.03204345703125,
-0.0118865966796875,
0.011566162109375,
0.0200958251953125,
-0.06640625,
-0.0014333724975585938,
0.0367431640625,
0.038543701171875,
0.03680419921875,
0.01055145263671875,
0.003086090087890625,
0.0411376953125,
-0.057891845703125,
0.017791748046875,
-0.005306243896484375,
-0.00634765625,
-0.0010623931884765625,
0.05950927734375,
-0.01177215576171875,
0.032379150390625,
0.019775390625,
0.0307464599609375,
0.0103912353515625,
-0.027191162109375,
-0.01336669921875,
-0.000823974609375,
-0.0166778564453125,
0.007457733154296875,
-0.037841796875,
-0.021209716796875,
-0.008056640625,
-0.01052093505859375,
0.05328369140625,
0.03460693359375,
0.0350341796875,
-0.03582763671875,
0.0203704833984375,
0.00809478759765625,
0.031585693359375,
-0.00725555419921875,
-0.01085662841796875,
0.03558349609375,
0.0103607177734375,
-0.01247406005859375,
0.0072784423828125,
-0.00482177734375,
-0.0167694091796875,
-0.007228851318359375,
0.0582275390625,
0.0277252197265625,
-0.0093231201171875,
-0.050445556640625,
-0.0689697265625,
0.02459716796875,
0.00543975830078125,
-0.01448822021484375,
-0.04522705078125,
0.00698089599609375,
-0.0215301513671875,
-0.0487060546875,
0.01495361328125,
0.0203704833984375,
-0.0531005859375,
0.036163330078125,
0.017578125,
-0.0015344619750976562,
-0.0039215087890625,
0.034332275390625,
0.0445556640625,
-0.0298004150390625,
-0.0054473876953125,
0.000629425048828125,
-0.0303192138671875,
-0.0287017822265625,
0.0312042236328125,
-0.0038299560546875,
-0.032379150390625,
-0.00490570068359375,
0.0594482421875,
-0.005054473876953125,
0.03045654296875,
-0.0207672119140625,
-0.0233306884765625,
-0.010772705078125,
-0.009979248046875,
-0.02392578125,
-0.0010023117065429688,
0.04608154296875,
-0.0295867919921875,
0.040313720703125,
0.031280517578125,
-0.01329803466796875,
-0.05572509765625,
0.0794677734375,
-0.00194549560546875,
-0.03143310546875,
-0.0158843994140625,
-0.0171966552734375,
-0.01445770263671875,
-0.051971435546875,
0.044219970703125,
0.0033206939697265625,
0.0275421142578125,
0.00560760498046875,
0.055206298828125,
0.01006317138671875,
-0.008392333984375,
0.067138671875,
-0.0102386474609375,
0.003185272216796875,
0.03521728515625,
0.04412841796875,
-0.036865234375,
0.014617919921875,
0.0013456344604492188,
0.0538330078125,
0.05816650390625,
-0.0477294921875,
0.0026035308837890625,
-0.0238037109375,
0.0282135009765625,
0.00679779052734375,
0.0232086181640625,
0.0259857177734375,
0.026824951171875,
0.033935546875,
-0.005947113037109375,
0.005657196044921875,
-0.015716552734375,
-0.0252838134765625,
0.032928466796875,
0.0128631591796875,
-0.010009765625,
-0.00635528564453125,
0.0035839080810546875,
0.00811004638671875,
0.001983642578125,
0.053802490234375,
-0.016571044921875,
0.004436492919921875,
-0.0239715576171875,
-0.0288848876953125,
-0.040283203125,
0.03564453125,
-0.020599365234375,
0.03106689453125,
0.0217742919921875,
0.0186004638671875,
0.006023406982421875,
0.002490997314453125,
-0.04034423828125,
-0.040252685546875,
0.021331787109375,
-0.0070037841796875,
0.054443359375,
-0.0172882080078125,
-0.004894256591796875,
-0.0029354095458984375,
0.07318115234375,
-0.0654296875,
-0.0261077880859375,
-0.00727081298828125,
0.0298004150390625,
0.00530242919921875,
-0.01541900634765625,
0.0011396408081054688,
-0.043853759765625,
-0.07806396484375,
0.010589599609375,
0.0034313201904296875,
-0.04193115234375,
-0.016754150390625,
-0.0014476776123046875,
-0.057708740234375,
-0.0416259765625,
0.0478515625,
-0.0755615234375,
0.0384521484375,
0.0222015380859375,
-0.0086669921875,
-0.00435638427734375,
-0.034698486328125,
-0.03424072265625,
-0.06988525390625,
-0.0103607177734375,
-0.037078857421875,
0.056976318359375,
0.029754638671875,
-0.0110626220703125,
-0.0113067626953125,
0.038055419921875,
0.047393798828125,
0.00916290283203125,
-0.0039825439453125,
-0.043212890625,
0.0190582275390625,
0.0241546630859375,
0.0038394927978515625,
0.0018835067749023438,
0.01357269287109375,
0.01029205322265625,
-0.05218505859375,
0.016387939453125,
-0.004291534423828125,
0.01557159423828125,
0.05181884765625,
-0.06109619140625,
-0.07513427734375,
-0.056304931640625,
-0.0277252197265625,
0.00907135009765625,
-0.0274658203125,
0.007114410400390625,
-0.036468505859375,
-0.07867431640625,
-0.0013151168823242188,
-0.0693359375,
-0.0200958251953125,
0.007389068603515625,
0.077880859375,
0.033111572265625,
0.016845703125,
0.060791015625,
-0.00649261474609375,
0.010498046875,
-0.017791748046875,
0.0296173095703125,
-0.003314971923828125,
0.0035076141357421875,
0.01016998291015625,
-0.0257110595703125,
0.01239013671875,
-0.02789306640625,
0.058319091796875,
0.0217742919921875,
0.01708984375,
-0.01319122314453125,
0.0010347366333007812,
-0.0001863241195678711,
0.0377197265625,
-0.001983642578125,
-0.0175323486328125,
0.02276611328125,
0.034881591796875,
-0.020050048828125,
-0.010772705078125,
-0.040130615234375,
0.0273590087890625,
-0.01026153564453125,
-0.00963592529296875,
0.055755615234375,
0.03546142578125,
-0.000568389892578125,
-0.0140533447265625,
0.024505615234375,
-0.0007905960083007812,
0.01568603515625,
0.0295562744140625,
-0.005992889404296875,
0.029296875,
0.033721923828125,
0.0032978057861328125,
-0.01922607421875,
-0.01433563232421875,
0.0732421875,
0.0296630859375,
-0.019683837890625,
-0.01092529296875,
0.009735107421875,
0.020599365234375,
-0.006351470947265625,
0.0034961700439453125,
0.04290771484375,
0.0267333984375,
-0.0168609619140625,
-0.006683349609375,
-0.0439453125,
-0.00531005859375,
-0.041473388671875,
-0.0222930908203125,
-0.015045166015625,
-0.0127716064453125,
-0.00252532958984375,
0.042083740234375,
0.025909423828125,
0.005947113037109375,
-0.0286102294921875,
-0.01483154296875,
-0.01053619384765625,
0.0245361328125,
0.0165557861328125,
0.004352569580078125,
-0.005275726318359375,
0.00799560546875,
0.036865234375,
-0.00022208690643310547,
-0.0401611328125,
-0.019287109375,
-0.01549530029296875,
-0.01148223876953125,
0.0372314453125,
0.0416259765625,
0.0293731689453125,
0.003444671630859375,
0.0095672607421875,
-0.0706787109375,
-0.0828857421875,
-0.022186279296875,
0.0058441162109375,
0.0218963623046875,
-0.053375244140625,
-0.0254974365234375,
0.028076171875,
-0.036346435546875,
0.007068634033203125,
-0.01081085205078125,
-0.006053924560546875,
0.00039887428283691406,
-0.001743316650390625,
-0.00959014892578125,
-0.047698974609375,
0.017364501953125,
-0.09521484375,
0.01273345947265625,
-0.0323486328125,
-0.00006216764450073242,
0.0277099609375,
-0.0176849365234375,
0.029083251953125,
-0.029266357421875,
-0.004169464111328125,
-0.0112762451171875,
0.0094146728515625,
0.031646728515625,
0.0035877227783203125,
-0.0015306472778320312,
-0.0093536376953125,
-0.006938934326171875,
-0.0176239013671875,
0.0042572021484375,
-0.033355712890625,
-0.0225067138671875,
-0.0306396484375,
-0.0341796875,
0.0113983154296875,
-0.0023326873779296875,
0.0452880859375,
-0.02520751953125,
0.020660400390625,
-0.0255279541015625,
-0.006351470947265625,
-0.0216217041015625,
0.030792236328125,
0.022705078125,
0.007076263427734375,
0.006137847900390625,
0.0100555419921875,
-0.016204833984375,
-0.01169586181640625,
0.0047149658203125,
-0.0208282470703125,
-0.01296234130859375,
-0.01096343994140625,
-0.0092926025390625,
0.0245513916015625,
0.049407958984375,
-0.005779266357421875,
0.0562744140625,
-0.0186309814453125,
-0.0009627342224121094,
-0.01425933837890625,
-0.0087738037109375,
-0.032867431640625,
0.025360107421875,
0.049835205078125,
-0.0218505859375,
-0.00734710693359375,
-0.0163116455078125,
0.037261962890625,
-0.0033855438232421875,
-0.021820068359375,
0.007137298583984375,
-0.005916595458984375,
-0.08026123046875,
0.0867919921875,
0.07073974609375,
0.01213836669921875,
0.052947998046875,
0.020172119140625,
0.011993408203125,
0.0128936767578125,
-0.00919342041015625,
0.008697509765625,
0.030853271484375,
0.059478759765625,
-0.002582550048828125,
0.0009164810180664062,
0.0438232421875,
-0.0196533203125,
-0.02313232421875,
0.0041961669921875,
0.0248260498046875,
-0.0191497802734375,
0.00997161865234375,
0.003631591796875,
0.0013799667358398438,
0.04217529296875,
0.0008411407470703125,
0.002948760986328125,
0.0191650390625,
0.01241302490234375,
-0.03973388671875,
-0.035888671875,
0.0017375946044921875,
0.0008854866027832031,
0.0095062255859375,
0.01361846923828125,
-0.0028972625732421875,
-0.001224517822265625,
0.0170135498046875,
-0.047576904296875,
-0.0188751220703125,
0.0019445419311523438,
-0.01238250732421875,
0.0083465576171875,
0.0102996826171875,
-0.01076507568359375,
-0.040008544921875,
0.040069580078125,
-0.03662109375,
0.01251983642578125,
0.07208251953125,
0.0037021636962890625,
0.017059326171875,
0.038787841796875,
-0.0167388916015625,
0.05792236328125,
-0.006244659423828125,
0.0211334228515625,
0.002025604248046875,
-0.0261383056640625,
0.0067596435546875,
0.0233154296875,
-0.0413818359375,
0.023773193359375,
0.0022335052490234375,
-0.021759033203125,
-0.018157958984375,
-0.0184783935546875,
0.0894775390625,
-0.06829833984375,
-0.00696563720703125,
0.007274627685546875,
0.01157379150390625,
0.0108642578125,
-0.0020847320556640625,
0.03875732421875,
-0.07098388671875,
-0.055206298828125,
0.0179901123046875,
-0.046783447265625,
-0.0304718017578125,
-0.017303466796875,
-0.023956298828125,
0.06634521484375,
-0.021270751953125,
-0.0180816650390625,
0.0010061264038085938,
0.04217529296875,
-0.0031871795654296875,
0.033416748046875,
-0.051605224609375,
0.0345458984375,
-0.003238677978515625,
0.04107666015625,
-0.047943115234375,
-0.0007152557373046875,
-0.003021240234375,
0.013671875,
-0.045440673828125,
-0.002086639404296875,
0.0036773681640625,
0.0279693603515625,
0.039825439453125,
0.0208892822265625,
0.007602691650390625,
0.00811767578125,
-0.0002372264862060547,
-0.0298919677734375,
0.0184326171875,
0.0009641647338867188,
0.034423828125,
-0.032501220703125,
0.005344390869140625,
-0.00992584228515625,
0.0250701904296875,
0.045684814453125,
-0.0250091552734375,
0.0399169921875,
-0.007335662841796875,
-0.0134735107421875,
0.01319122314453125,
-0.01189422607421875,
-0.0173492431640625,
0.052825927734375,
0.02105712890625,
-0.030181884765625,
-0.028839111328125,
-0.03466796875,
0.039337158203125,
0.0022735595703125,
-0.0032901763916015625,
0.0467529296875,
0.0175933837890625,
0.0004780292510986328,
0.004085540771484375,
-0.0039043426513671875,
0.017822265625,
0.005634307861328125,
0.052093505859375,
0.0270233154296875,
0.0223388671875,
-0.0288848876953125,
0.00971221923828125,
0.03485107421875,
0.07147216796875,
-0.040985107421875,
-0.034393310546875,
0.00383758544921875,
0.005855560302734375,
0.01181793212890625,
0.0061492919921875,
0.035247802734375,
-0.0197296142578125,
0.00244903564453125,
-0.038787841796875,
0.0257720947265625,
0.033172607421875,
0.0085906982421875,
-0.01280975341796875,
0.0029621124267578125,
-0.052215576171875,
0.038818359375,
-0.0333251953125,
0.0180816650390625,
0.006458282470703125,
0.030029296875,
-0.00258636474609375,
0.0455322265625,
0.0002760887145996094,
-0.00940704345703125,
0.0062103271484375,
0.020233154296875,
0.00412750244140625,
-0.0216064453125,
-0.007266998291015625,
-0.044525146484375,
-0.0028362274169921875,
0.022216796875,
0.032196044921875,
0.055511474609375,
0.032684326171875,
-0.01427459716796875,
0.0006022453308105469,
0.0206756591796875,
0.051513671875,
-0.031524658203125,
-0.03131103515625,
-0.0233612060546875,
-0.0033931732177734375,
0.0244598388671875,
0.00975799560546875,
0.02667236328125,
0.01282501220703125,
0.031707763671875,
0.0127105712890625,
0.024932861328125,
-0.0042266845703125,
-0.037017822265625,
-0.005451202392578125,
-0.0262298583984375,
0.05401611328125,
0.0116729736328125,
-0.11712646484375,
-0.02276611328125,
-0.0210113525390625,
-0.075439453125,
0.049407958984375,
0.056365966796875,
-0.02947998046875,
0.01074981689453125,
0.00445556640625,
0.0069580078125,
-0.00411224365234375,
-0.0116119384765625,
-0.0265960693359375,
-0.01532745361328125,
0.04193115234375,
0.003322601318359375,
-0.052154541015625,
-0.006237030029296875,
-0.002803802490234375,
-0.000008702278137207031,
0.023590087890625,
0.00821685791015625,
0.036590576171875,
0.01175689697265625,
-0.0257720947265625,
-0.0224609375,
-0.009033203125,
-0.030548095703125,
0.028656005859375,
0.017974853515625,
-0.00860595703125,
-0.004425048828125,
-0.0177001953125,
-0.0159454345703125,
0.062408447265625,
-0.044708251953125,
-0.0205230712890625,
0.002361297607421875,
0.035003662109375,
-0.0274200439453125,
0.0164337158203125,
-0.0299530029296875,
-0.031768798828125,
-0.06463623046875,
-0.04107666015625,
0.04595947265625,
0.0209197998046875,
-0.005504608154296875,
0.020233154296875,
0.0144805908203125,
-0.033660888671875,
0.030059814453125,
-0.0142822265625,
0.026153564453125,
0.0281524658203125,
0.01428985595703125,
-0.0009860992431640625,
-0.01189422607421875,
-0.01016998291015625,
-0.01462554931640625,
0.0167083740234375,
-0.037506103515625,
-0.0006623268127441406,
-0.0164031982421875,
0.033294677734375,
0.025909423828125,
0.041717529296875,
-0.04241943359375,
0.0253448486328125,
0.01032257080078125,
0.00521087646484375,
0.046356201171875,
-0.042510986328125,
-0.053741455078125,
-0.06793212890625,
0.03192138671875,
0.03778076171875,
-0.01500701904296875,
-0.012939453125,
-0.09033203125,
0.013671875,
0.046173095703125,
0.025146484375,
-0.052520751953125,
0.060577392578125,
-0.0384521484375,
0.00576019287109375,
0.0057220458984375,
-0.01824951171875,
-0.01146697998046875,
-0.0357666015625,
-0.0243377685546875,
0.01947021484375,
-0.03753662109375,
0.01165008544921875,
0.005657196044921875,
-0.0208740234375,
-0.004680633544921875,
0.0008668899536132812,
-0.027069091796875,
-0.0014047622680664062,
-0.00927734375,
0.041168212890625,
0.036834716796875,
-0.037872314453125,
-0.0241241455078125,
0.0025005340576171875,
0.0054931640625,
-0.001766204833984375,
0.01505279541015625,
-0.031463623046875,
-0.03369140625,
0.005428314208984375,
-0.01428985595703125,
0.00433349609375,
-0.04693603515625,
-0.0885009765625,
0.01056671142578125,
-0.00495147705078125,
-0.051544189453125,
-0.03155517578125,
0.0096282958984375,
-0.0236663818359375,
-0.004779815673828125,
-0.00012135505676269531,
-0.041259765625,
0.0269775390625,
0.040313720703125,
0.0008339881896972656,
0.0499267578125,
-0.006893157958984375,
0.042388916015625,
-0.020172119140625,
0.01503753662109375,
-0.01206207275390625,
-0.02325439453125,
0.01522064208984375,
-0.035247802734375,
0.021148681640625,
0.0259857177734375,
-0.0643310546875,
-0.06732177734375,
-0.0157623291015625,
0.021240234375,
0.00037980079650878906,
-0.018035888671875,
-0.0245361328125,
-0.0152740478515625,
0.046356201171875,
0.03155517578125,
0.0177764892578125,
-0.0150146484375,
-0.037628173828125,
-0.0281219482421875,
0.005161285400390625,
0.000965118408203125,
0.00955963134765625,
-0.06732177734375,
-0.0006856918334960938,
0.020660400390625,
-0.039520263671875,
-0.0158538818359375,
0.031494140625,
-0.045318603515625,
0.029022216796875,
0.04547119140625,
-0.0174560546875,
-0.040008544921875,
-0.000560760498046875,
0.058563232421875,
-0.038116455078125,
0.03277587890625,
-0.0144500732421875,
0.020782470703125,
0.05487060546875,
-0.0149383544921875,
-0.0450439453125,
0.007110595703125,
-0.021759033203125,
0.0119781494140625,
-0.0225067138671875,
0.0231170654296875,
-0.0106964111328125,
0.02044677734375,
-0.0214385986328125,
0.0166015625,
0.0095977783203125,
0.0277252197265625,
-0.017120361328125,
0.01557159423828125,
0.0145111083984375,
0.03009033203125,
0.0027484893798828125,
0.01001739501953125,
0.0018444061279296875,
0.03662109375,
-0.020782470703125,
-0.019500732421875,
0.007801055908203125,
-0.058929443359375,
0.00827789306640625,
-0.01496124267578125,
-0.022857666015625,
-0.04632568359375,
0.0308837890625,
0.053253173828125,
-0.03277587890625,
0.0360107421875
] |
c76a28046acc2e645be531f50132761b32b59c81
|
Wordpress Stackexchange
Q: Delete Child Posts I'm trying to delete all child posts when the parent is deleted.
The parent post deletes just fine, but the child posts are not properly deleting.
Here's the code I have in place now:
$args = array(
'post_parent' => $parentid,
'post_type' => 'custom-type'
);
$posts = get_posts( $args );
if ($posts) {
// Delete all the Children of the Parent Page
foreach($posts as $post){
wp_delete_post($post->ID, true);
}
}
// Delete the Parent Page
wp_delete_post($parentid, true);
What it should do is loop through and get the posts that are the child of $parentid and delete them, then delete the parent post.
Currently, it just deletes the parent post, but leaves all the children behind.
I'm looking at my database and the child pages are definitely created correctly with the correct post_parent id.
Is there a way to get all child posts and delete them?
Thanks,
Jason
A: Try it like this:
$args = array(
'post_parent' => $parentid,
'post_type' => 'custom-type'
);
$posts = get_posts( $args );
if (is_array($posts) && count($posts) > 0) {
// Delete all the Children of the Parent Page
foreach($posts as $post){
wp_delete_post($post->ID, true);
}
}
// Delete the Parent Page
wp_delete_post($parentid, true);
|
Q: Delete Child Posts I'm trying to delete all child posts when the parent is deleted.
The parent post deletes just fine, but the child posts are not properly deleting.
Here's the code I have in place now:
$args = array(
'post_parent' => $parentid,
'post_type' => 'custom-type'
);
$posts = get_posts( $args );
if ($posts) {
// Delete all the Children of the Parent Page
foreach($posts as $post){
wp_delete_post($post->ID, true);
}
}
// Delete the Parent Page
wp_delete_post($parentid, true);
What it should do is loop through and get the posts that are the child of $parentid and delete them, then delete the parent post.
Currently, it just deletes the parent post, but leaves all the children behind.
I'm looking at my database and the child pages are definitely created correctly with the correct post_parent id.
Is there a way to get all child posts and delete them?
Thanks,
Jason
A: Try it like this:
$args = array(
'post_parent' => $parentid,
'post_type' => 'custom-type'
);
$posts = get_posts( $args );
if (is_array($posts) && count($posts) > 0) {
// Delete all the Children of the Parent Page
foreach($posts as $post){
wp_delete_post($post->ID, true);
}
}
// Delete the Parent Page
wp_delete_post($parentid, true);
A: Hook into delete_post. The code below should run recursively and will delete if there are grandchilds too. code not tested
add_action('delete_post', 'wpse53967_clear_all_childs');
function wpse53967_clear_all_childs($post_id){
$childs = get_post(
'post_parent' => $post_id,
'post_type' => 'post-type'
);
if(empty($childs))
return;
foreach($childs as $post){
wp_delete_post($post->ID, true); // true => bypass trash and permanently delete
}
}
|
wordpress
|
{
"language": "en",
"length": 251,
"provenance": "stackexchange_00019.jsonl.gz:420480",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53967"
}
|
[
0.028228759765625,
0.01200103759765625,
-0.0213165283203125,
0.0068359375,
0.01812744140625,
-0.0282745361328125,
0.05059814453125,
-0.030731201171875,
-0.01404571533203125,
0.020355224609375,
-0.033355712890625,
-0.0240478515625,
-0.023284912109375,
-0.021453857421875,
-0.0176544189453125,
-0.060943603515625,
0.04010009765625,
-0.0328369140625,
0.027923583984375,
-0.021881103515625,
-0.0010995864868164062,
-0.00592041015625,
0.08026123046875,
0.030853271484375,
0.0209808349609375,
-0.00033211708068847656,
0.005428314208984375,
-0.01873779296875,
-0.007022857666015625,
-0.0310211181640625,
0.0118560791015625,
0.037017822265625,
-0.004451751708984375,
0.00753021240234375,
0.044158935546875,
-0.0256195068359375,
-0.0020694732666015625,
0.0034465789794921875,
0.03363037109375,
0.004055023193359375,
-0.0017042160034179688,
0.00959014892578125,
0.03094482421875,
0.00858306884765625,
-0.0280914306640625,
0.013519287109375,
-0.033050537109375,
-0.0174407958984375,
0.027252197265625,
-0.008392333984375,
0.018096923828125,
-0.017547607421875,
0.031402587890625,
-0.0283660888671875,
-0.022979736328125,
-0.022216796875,
0.021087646484375,
-0.0094757080078125,
0.0699462890625,
-0.020538330078125,
-0.07232666015625,
-0.032562255859375,
0.037567138671875,
-0.044647216796875,
0.0016965866088867188,
0.01313018798828125,
-0.0290679931640625,
0.0111236572265625,
-0.0450439453125,
-0.00878143310546875,
0.033172607421875,
-0.0498046875,
0.004108428955078125,
-0.0231170654296875,
0.01409149169921875,
-0.03460693359375,
-0.0153045654296875,
-0.044158935546875,
0.0014905929565429688,
0.034210205078125,
-0.0177764892578125,
0.00742340087890625,
-0.07977294921875,
0.01113128662109375,
-0.024017333984375,
0.0175933837890625,
-0.031524658203125,
-0.01544189453125,
-0.04779052734375,
-0.0167999267578125,
-0.03936767578125,
-0.05133056640625,
0.00226593017578125,
-0.0016660690307617188,
-0.0179901123046875,
-0.008758544921875,
0.03289794921875,
0.055755615234375,
-0.0237884521484375,
-0.0106964111328125,
-0.021942138671875,
-0.021697998046875,
-0.0202484130859375,
-0.0310516357421875,
0.0190277099609375,
0.015380859375,
-0.01363372802734375,
-0.010650634765625,
0.0439453125,
0.03924560546875,
0.005077362060546875,
0.041717529296875,
-0.0041656494140625,
-0.0240020751953125,
-0.0208587646484375,
0.04248046875,
-0.026092529296875,
-0.0023441314697265625,
-0.0008187294006347656,
0.0124969482421875,
-0.01352691650390625,
-0.0188751220703125,
-0.0257110595703125,
0.0028591156005859375,
0.014862060546875,
0.00272369384765625,
-0.0240478515625,
0.014190673828125,
0.0308685302734375,
0.0218505859375,
-0.055084228515625,
0.018829345703125,
0.0833740234375,
-0.005313873291015625,
0.00656890869140625,
-0.026153564453125,
0.0094146728515625,
-0.019927978515625,
0.0190277099609375,
-0.046051025390625,
0.0738525390625,
0.0017728805541992188,
0.005687713623046875,
0.03790283203125,
0.00782012939453125,
0.0256195068359375,
0.01348876953125,
-0.0153656005859375,
0.003368377685546875,
-0.0145416259765625,
-0.030181884765625,
-0.0264739990234375,
0.0645751953125,
-0.0174102783203125,
-0.00281524658203125,
-0.043792724609375,
0.037750244140625,
-0.042236328125,
-0.0223236083984375,
-0.0655517578125,
0.014801025390625,
0.0012617111206054688,
0.00586700439453125,
-0.036865234375,
-0.07586669921875,
0.0110321044921875,
-0.04681396484375,
-0.0279998779296875,
0.0176849365234375,
-0.048431396484375,
0.038330078125,
-0.062255859375,
-0.0338134765625,
0.0013179779052734375,
0.01947021484375,
0.05419921875,
-0.0243377685546875,
-0.036651611328125,
0.03924560546875,
0.0183258056640625,
-0.00399017333984375,
-0.01314544677734375,
-0.0171356201171875,
0.034820556640625,
-0.03204345703125,
-0.01397705078125,
0.0248260498046875,
0.0307464599609375,
0.00014579296112060547,
0.022491455078125,
0.028076171875,
0.013519287109375,
-0.0191497802734375,
0.0543212890625,
0.017242431640625,
-0.053741455078125,
-0.041351318359375,
-0.033935546875,
-0.0140533447265625,
-0.00013971328735351562,
-0.00876617431640625,
-0.03253173828125,
0.0033397674560546875,
-0.00327301025390625,
-0.04266357421875,
-0.01016998291015625,
-0.01087188720703125,
0.032745361328125,
0.0103759765625,
0.035247802734375,
0.022735595703125,
0.0245819091796875,
-0.039093017578125,
-0.01076507568359375,
-0.033050537109375,
0.018463134765625,
0.0141754150390625,
0.001399993896484375,
-0.0191497802734375,
0.004680633544921875,
-0.0361328125,
-0.01336669921875,
-0.034942626953125,
0.040802001953125,
0.090576171875,
-0.034332275390625,
0.003910064697265625,
-0.037078857421875,
0.05584716796875,
0.0032939910888671875,
-0.07159423828125,
0.040679931640625,
0.02105712890625,
0.010223388671875,
-0.038177490234375,
-0.0115509033203125,
-0.007526397705078125,
-0.059722900390625,
0.018829345703125,
0.0653076171875,
0.01568603515625,
0.0340576171875,
-0.0172576904296875,
0.00865936279296875,
0.05487060546875,
-0.036102294921875,
-0.013214111328125,
-0.0005574226379394531,
0.0233306884765625,
0.07049560546875,
-0.0009965896606445312,
-0.00841522216796875,
0.00928497314453125,
-0.03192138671875,
0.01007843017578125,
0.02386474609375,
-0.00170135498046875,
0.00305938720703125,
-0.03277587890625,
-0.00250244140625,
0.0207672119140625,
-0.059112548828125,
-0.054290771484375,
-0.005146026611328125,
0.0498046875,
-0.0163726806640625,
0.0274658203125,
0.011077880859375,
-0.0260467529296875,
0.00937652587890625,
0.012237548828125,
-0.040740966796875,
0.0061187744140625,
-0.0028553009033203125,
-0.0179443359375,
-0.0004949569702148438,
-0.04443359375,
0.01788330078125,
0.01788330078125,
-0.0271759033203125,
0.002162933349609375,
0.0306854248046875,
0.0364990234375,
-0.0012416839599609375,
-0.01056671142578125,
-0.004077911376953125,
0.0290374755859375,
0.0423583984375,
-0.0066070556640625,
0.00043773651123046875,
0.018463134765625,
0.060882568359375,
0.00473785400390625,
0.018157958984375,
0.022186279296875,
0.01201629638671875,
0.00841522216796875,
-0.03594970703125,
0.032379150390625,
-0.0297088623046875,
0.0146484375,
0.054931640625,
0.01953125,
-0.025604248046875,
0.00164794921875,
0.0243072509765625,
0.0240631103515625,
0.01551055908203125,
-0.0005826950073242188,
-0.016510009765625,
-0.020721435546875,
0.0010700225830078125,
0.0266265869140625,
0.08251953125,
0.0017232894897460938,
-0.0364990234375,
0.01326751708984375,
0.03985595703125,
-0.06634521484375,
-0.0908203125,
0.034027099609375,
-0.049102783203125,
-0.01806640625,
-0.04132080078125,
-0.033599853515625,
0.0013799667358398438,
-0.037322998046875,
-0.0039825439453125,
-0.002399444580078125,
-0.00008976459503173828,
-0.02166748046875,
-0.01331329345703125,
-0.052581787109375,
0.0010538101196289062,
0.006103515625,
0.028411865234375,
0.0008382797241210938,
0.07476806640625,
0.009429931640625,
-0.05865478515625,
-0.01282501220703125,
0.032501220703125,
-0.02972412109375,
-0.01071929931640625,
-0.00534820556640625,
0.0246124267578125,
-0.009185791015625,
0.00807952880859375,
0.01464080810546875,
0.01468658447265625,
-0.0386962890625,
-0.0262603759765625,
-0.01160430908203125,
0.041778564453125,
0.0296630859375,
-0.0235137939453125,
0.011627197265625,
0.050384521484375,
0.00167083740234375,
-0.01113128662109375,
-0.0192718505859375,
-0.0408935546875,
-0.056121826171875,
0.04119873046875,
0.046356201171875,
0.01250457763671875,
-0.00849151611328125,
-0.003665924072265625,
0.037139892578125,
0.0311431884765625,
0.0162506103515625,
0.01947021484375,
0.0245208740234375,
-0.0012664794921875,
0.01396942138671875,
-0.03143310546875,
0.01483154296875,
-0.0273284912109375,
0.005645751953125,
-0.0103607177734375,
0.00841522216796875,
-0.004749298095703125,
-0.031280517578125,
-0.058258056640625,
-0.041351318359375,
0.046905517578125,
0.0172882080078125,
0.01107025146484375,
-0.0228271484375,
-0.02801513671875,
-0.0195465087890625,
0.048309326171875,
-0.03759765625,
-0.03912353515625,
-0.07073974609375,
-0.0005445480346679688,
0.0163116455078125,
-0.032501220703125,
0.045623779296875,
-0.0270843505859375,
-0.028717041015625,
0.025665283203125,
0.018157958984375,
-0.0039825439453125,
-0.033660888671875,
0.038665771484375,
-0.04046630859375,
0.0001703500747680664,
0.051025390625,
-0.06866455078125,
0.0217132568359375,
0.00501251220703125,
0.01140594482421875,
-0.0302886962890625,
-0.032867431640625,
-0.0221099853515625,
-0.06298828125,
-0.00782012939453125,
0.0012903213500976562,
0.0491943359375,
-0.0018682479858398438,
-0.0029850006103515625,
-0.0272979736328125,
0.042877197265625,
0.0213470458984375,
0.01465606689453125,
-0.0335693359375,
-0.011749267578125,
-0.056793212890625,
0.00814056396484375,
-0.01050567626953125,
-0.01093292236328125,
-0.0274810791015625,
-0.015838623046875,
0.0031280517578125,
0.00037598609924316406,
-0.0224761962890625,
-0.0247955322265625,
0.0099334716796875,
-0.022216796875,
-0.03802490234375,
-0.0235443115234375,
-0.0654296875,
-0.01605224609375,
-0.03985595703125,
-0.01128387451171875,
-0.03143310546875,
-0.0787353515625,
0.03839111328125,
0.0230712890625,
-0.0209197998046875,
-0.0054168701171875,
0.09765625,
0.0215911865234375,
-0.0232696533203125,
-0.039031982421875,
-0.0257110595703125,
0.00327301025390625,
-0.0355224609375,
0.061676025390625,
0.02508544921875,
0.0183258056640625,
0.0309600830078125,
-0.020599365234375,
-0.00882720947265625,
-0.005126953125,
0.08673095703125,
-0.00734710693359375,
-0.0103912353515625,
0.01335906982421875,
-0.03509521484375,
-0.00563812255859375,
0.02886962890625,
-0.00893402099609375,
-0.003078460693359375,
0.00864410400390625,
0.036590576171875,
-0.0198211669921875,
-0.0009322166442871094,
-0.049468994140625,
-0.014007568359375,
0.0029754638671875,
-0.0169830322265625,
-0.01021575927734375,
0.0271148681640625,
-0.01136016845703125,
0.0016622543334960938,
0.00887298583984375,
0.011383056640625,
-0.043609619140625,
0.06805419921875,
-0.0157470703125,
0.036773681640625,
-0.004299163818359375,
0.00047850608825683594,
-0.05670166015625,
-0.011077880859375,
0.0272979736328125,
0.01390838623046875,
-0.037078857421875,
0.0211944580078125,
-0.01511383056640625,
0.014923095703125,
-0.02569580078125,
0.0308685302734375,
0.0308685302734375,
0.034912109375,
0.004711151123046875,
-0.040008544921875,
-0.0021190643310546875,
0.05072021484375,
-0.04144287109375,
-0.0289764404296875,
0.01019287109375,
-0.025543212890625,
-0.0132293701171875,
0.05328369140625,
-0.00620269775390625,
0.01611328125,
-0.014190673828125,
0.0159759521484375,
0.0020656585693359375,
0.0465087890625,
0.03369140625,
-0.020721435546875,
0.01910400390625,
-0.0120849609375,
0.0029773712158203125,
-0.051605224609375,
-0.06219482421875,
0.06298828125,
0.07904052734375,
0.039459228515625,
0.0169525146484375,
-0.037567138671875,
0.017120361328125,
-0.0290069580078125,
0.019744873046875,
0.0253753662109375,
-0.015960693359375,
-0.004810333251953125,
0.015228271484375,
0.03192138671875,
0.036163330078125,
-0.026611328125,
0.002956390380859375,
-0.050811767578125,
-0.0038299560546875,
-0.0147247314453125,
-0.0102691650390625,
0.007671356201171875,
-0.0021076202392578125,
-0.006412506103515625,
-0.033660888671875,
0.0164947509765625,
-0.01549530029296875,
0.00241851806640625,
-0.026275634765625,
-0.0305023193359375,
0.01305389404296875,
0.005847930908203125,
0.06195068359375,
-0.041778564453125,
-0.02691650390625,
-0.0155792236328125,
-0.00780487060546875,
0.06829833984375,
0.03973388671875,
-0.0227203369140625,
-0.0206451416015625,
-0.02838134765625,
-0.0250701904296875,
-0.037353515625,
-0.04193115234375,
-0.042236328125,
0.0025882720947265625,
-0.0219573974609375,
0.01409149169921875,
-0.007083892822265625,
0.0265045166015625,
-0.0224151611328125,
-0.002826690673828125,
-0.0204315185546875,
-0.0042266845703125,
-0.00289154052734375,
0.066650390625,
-0.0362548828125,
0.0222625732421875,
0.0218658447265625,
0.06121826171875,
0.01137542724609375,
-0.0183563232421875,
0.021026611328125,
-0.0178680419921875,
-0.0029144287109375,
-0.015838623046875,
-0.0071563720703125,
-0.051177978515625,
0.0023136138916015625,
-0.00777435302734375,
-0.0007596015930175781,
-0.03558349609375,
-0.01531219482421875,
-0.0282440185546875,
0.055267333984375,
-0.0274505615234375,
0.031768798828125,
-0.01140594482421875,
-0.019866943359375,
-0.03753662109375,
0.0093536376953125,
0.00861358642578125,
-0.01079559326171875,
0.0177154541015625,
-0.01425933837890625,
-0.00634002685546875,
-0.01099395751953125,
0.036590576171875,
0.031341552734375,
-0.021087646484375,
0.0261383056640625,
0.00797271728515625,
0.0157928466796875,
0.023529052734375,
0.008148193359375,
0.005420684814453125,
-0.007572174072265625,
0.0618896484375,
-0.0031452178955078125,
-0.0108642578125,
0.0341796875,
-0.03839111328125,
-0.0218048095703125,
-0.002376556396484375,
0.0194091796875,
-0.023529052734375,
-0.0004849433898925781,
0.00884246826171875,
0.0010175704956054688,
0.0252532958984375,
-0.00135040283203125,
0.039794921875,
0.0672607421875,
-0.006923675537109375,
-0.0109710693359375,
-0.0341796875,
0.008087158203125,
-0.0155487060546875,
0.019989013671875,
-0.02386474609375,
0.019317626953125,
0.00344085693359375,
-0.021881103515625,
0.024627685546875,
0.0147705078125,
0.0204620361328125,
-0.0362548828125,
0.0234375,
-0.0227203369140625,
0.00605010986328125,
-0.0767822265625,
0.00933074951171875,
-0.0239410400390625,
0.00091552734375,
0.035675048828125,
-0.0252532958984375,
-0.0237579345703125,
0.059844970703125,
-0.04315185546875,
0.05426025390625,
0.0126190185546875,
-0.04571533203125,
-0.12158203125,
-0.007022857666015625,
0.03460693359375,
-0.00101470947265625,
-0.055694580078125,
0.045196533203125,
-0.09429931640625,
-0.00875091552734375,
-0.0066986083984375,
0.0091400146484375,
0.03521728515625,
-0.05255126953125,
0.0007448196411132812,
0.0423583984375,
0.03778076171875,
-0.0218353271484375,
-0.0060272216796875,
-0.0270233154296875,
-0.03533935546875,
-0.0111083984375,
-0.0238800048828125,
-0.0269012451171875,
-0.00687408447265625,
-0.04962158203125,
-0.07611083984375,
0.119384765625,
-0.0042877197265625,
0.0462646484375,
0.0015306472778320312,
0.040557861328125,
-0.03900146484375,
0.00896453857421875,
-0.045684814453125,
0.054595947265625,
0.056732177734375,
0.0160675048828125,
-0.057464599609375,
-0.0309295654296875,
-0.0135955810546875,
0.052398681640625,
0.05072021484375,
-0.00004971027374267578,
-0.0244903564453125,
-0.023773193359375,
0.022216796875,
0.038787841796875,
0.002475738525390625,
0.039337158203125,
0.006412506103515625,
0.0216064453125,
0.036285400390625,
-0.0271759033203125,
0.03765869140625,
-0.01399993896484375,
-0.0004119873046875,
0.015533447265625,
0.01378631591796875,
-0.004302978515625,
-0.01273345947265625,
0.00921630859375,
-0.036041259765625,
-0.0021877288818359375,
0.0011911392211914062,
0.0013599395751953125,
0.029876708984375,
0.033599853515625,
0.053497314453125,
-0.062347412109375,
-0.031982421875,
-0.0161285400390625,
0.049774169921875,
0.0013513565063476562,
0.0113525390625,
0.0038623809814453125,
0.0259857177734375,
-0.020721435546875,
-0.0245208740234375,
0.0086517333984375,
0.033050537109375,
-0.052398681640625,
0.033721923828125,
0.059844970703125,
0.01241302490234375,
-0.0234222412109375,
0.03369140625,
0.04852294921875,
0.0489501953125,
-0.061676025390625,
-0.06549072265625,
0.021484375,
0.0114593505859375,
0.0110626220703125,
0.0207366943359375,
0.0305328369140625,
-0.023223876953125,
0.053253173828125,
-0.03277587890625,
-0.01349639892578125,
0.00638580322265625,
0.048126220703125,
0.00836181640625,
-0.0027217864990234375,
-0.040802001953125,
-0.038818359375,
-0.0076751708984375,
-0.0273284912109375,
0.00522613525390625,
0.025390625,
0.036712646484375,
-0.00524139404296875,
-0.030242919921875,
-0.0008187294006347656,
0.0138397216796875,
-0.00012063980102539062,
0.0134124755859375,
-0.0154266357421875,
-0.003856658935546875,
-0.01849365234375,
0.0054168701171875,
0.020294189453125,
0.03692626953125,
0.01617431640625,
0.07861328125,
0.04266357421875,
-0.0655517578125,
-0.01551055908203125,
0.0164031982421875,
-0.025177001953125,
-0.028106689453125,
-0.0006041526794433594,
-0.04132080078125,
-0.01123046875,
-0.0308074951171875,
0.0089111328125,
0.03082275390625,
-0.023406982421875,
0.01033782958984375,
0.029815673828125,
0.005611419677734375,
-0.0021800994873046875,
0.04559326171875,
0.0235748291015625,
0.0382080078125,
0.03631591796875,
-0.054229736328125,
-0.01885986328125,
-0.00934600830078125,
-0.0141143798828125,
0.017547607421875,
0.0272064208984375,
-0.0084381103515625,
0.031707763671875,
0.01070404052734375,
-0.0399169921875,
0.0014314651489257812,
0.056610107421875,
-0.021331787109375,
0.00246429443359375,
0.0263824462890625,
-0.01097869873046875,
0.01727294921875,
0.021209716796875,
0.0330810546875,
0.01412200927734375,
0.022430419921875,
0.045989990234375,
-0.013275146484375,
0.006679534912109375,
-0.0100860595703125,
0.0670166015625,
-0.03643798828125,
-0.027099609375,
0.055084228515625,
-0.0139923095703125,
0.0138397216796875,
-0.01397705078125,
-0.03338623046875,
0.037078857421875,
0.0269927978515625,
0.004730224609375,
0.0145111083984375,
-0.0148468017578125,
0.00620269775390625,
-0.0190582275390625,
0.01294708251953125,
-0.01309967041015625,
-0.00434112548828125,
-0.03369140625,
-0.034332275390625,
0.05841064453125,
0.06329345703125,
0.017120361328125,
0.049102783203125,
0.018035888671875,
-0.022064208984375,
0.051025390625,
-0.057891845703125,
0.039306640625,
0.016387939453125,
0.01654052734375,
-0.050689697265625,
0.018707275390625,
-0.00429534912109375,
-0.003215789794921875,
0.0200653076171875,
0.040863037109375,
0.025238037109375,
-0.0228118896484375,
-0.03558349609375,
0.01300048828125,
0.0286712646484375,
-0.017974853515625,
0.010772705078125,
-0.0288238525390625,
-0.00923919677734375,
0.00677490234375,
-0.00811767578125,
-0.0239410400390625,
-0.03289794921875,
-0.0033130645751953125,
-0.0025997161865234375,
-0.013214111328125,
-0.043975830078125,
-0.012298583984375,
0.0204620361328125,
0.02960205078125,
0.0181427001953125,
-0.042327880859375,
0.06805419921875,
-0.036651611328125,
-0.03289794921875,
0.0134124755859375,
-0.0081024169921875,
-0.01556396484375,
-0.042816162109375,
-0.03369140625,
-0.007904052734375,
-0.045440673828125,
0.033416748046875,
-0.0302581787109375,
0.02423095703125,
0.01203155517578125,
-0.036346435546875,
-0.01155853271484375,
0.028350830078125,
0.045013427734375,
0.058624267578125,
0.06884765625,
-0.033599853515625,
-0.0081329345703125,
0.0227508544921875,
0.01163482666015625,
-0.004947662353515625,
0.017181396484375,
-0.0233306884765625,
-0.03460693359375,
-0.033843994140625,
0.054534912109375,
0.0799560546875,
-0.0100250244140625,
-0.063720703125,
0.0921630859375,
-0.045684814453125,
-0.0292205810546875,
-0.0229034423828125,
0.04327392578125,
0.006961822509765625,
-0.046875,
0.012603759765625,
-0.0204315185546875,
0.01523590087890625,
0.01386260986328125,
0.0015544891357421875,
0.03369140625,
-0.00855255126953125,
0.027069091796875,
-0.0009860992431640625,
0.039215087890625,
0.0193634033203125,
-0.025543212890625,
-0.005062103271484375,
-0.011016845703125,
0.0299224853515625,
0.049896240234375,
-0.00494384765625,
0.02313232421875,
0.0260009765625,
-0.0196533203125,
-0.00891876220703125,
-0.01309967041015625,
-0.01385498046875,
0.00812530517578125,
0.0377197265625,
0.045745849609375,
0.008575439453125,
-0.030853271484375,
-0.04376220703125,
-0.0275421142578125,
-0.033905029296875,
-0.0040740966796875,
0.027130126953125,
-0.0654296875,
0.0016765594482421875,
0.0009512901306152344,
-0.007366180419921875,
-0.0061187744140625,
-0.0284271240234375,
-0.024200439453125,
-0.0222930908203125,
-0.0180511474609375,
-0.004425048828125,
0.021240234375,
0.0177459716796875,
0.02508544921875,
-0.012969970703125,
0.025634765625,
-0.03485107421875,
-0.0015125274658203125,
0.032012939453125,
0.017791748046875,
-0.0107879638671875,
0.017608642578125,
-0.02825927734375,
-0.0051727294921875,
0.00907135009765625,
0.0238037109375,
-0.00878143310546875,
0.0020732879638671875,
-0.014404296875,
0.01088714599609375,
0.00838470458984375,
-0.007091522216796875,
-0.00685882568359375,
0.04864501953125,
0.00860595703125,
0.0399169921875,
0.006153106689453125,
0.0694580078125,
-0.0035724639892578125,
0.05255126953125,
0.004726409912109375,
-0.0206451416015625,
0.0203094482421875,
-0.017974853515625,
-0.007015228271484375,
-0.03460693359375,
-0.00720977783203125,
-0.06549072265625,
0.0479736328125,
0.06512451171875,
-0.007965087890625,
0.041046142578125
] |
633993fea5b3cfa100d3a834aa9d8e8e1c86dbba
|
Wordpress Stackexchange
Q: Sanitize User Entered CSS Does anyone have any idea how to sanitize CSS entered via user input? I am concerned about cross-site scripting via CSS. I am using wp_filter_kses to clean up user entered HTML, but I need a like solution for user entered styles. So far I am using the following ugly and incomplete function but I'd like something more complete.
function sanitizeCSS ( $css ) {
$css = str_replace( '/-moz-binding/', '', $css );
$css = str_replace( '/expression/', '', $css );
$css = str_replace( '/javascript/', '', $css );
$css = str_replace( '/vbscript/', '', $css );
return $css;
}
A: You’ll a need a real CSS parser like this one to filter the CSS. Regular expressions or simple string replacements are not safe enough.
|
Q: Sanitize User Entered CSS Does anyone have any idea how to sanitize CSS entered via user input? I am concerned about cross-site scripting via CSS. I am using wp_filter_kses to clean up user entered HTML, but I need a like solution for user entered styles. So far I am using the following ugly and incomplete function but I'd like something more complete.
function sanitizeCSS ( $css ) {
$css = str_replace( '/-moz-binding/', '', $css );
$css = str_replace( '/expression/', '', $css );
$css = str_replace( '/javascript/', '', $css );
$css = str_replace( '/vbscript/', '', $css );
return $css;
}
A: You’ll a need a real CSS parser like this one to filter the CSS. Regular expressions or simple string replacements are not safe enough.
A: Jetpack doesn't really sanitize CSS, it just cleans it up, which has the side-effect of removing some vulnerabilities, but not all.
An attacker can still use @import to import unsanitized CSS; expression() to introduce XSS to older IE browsers; @charset to trick the browser into interpreting the CSS as HTML, opening up XSS opportunities; set URLs with arbitrary protocols to launch SSRF attacks, etc.
If you want full sanitization, you'll need to do something like r2085-meta.
You should run your sanitization against comprehensive test cases to verify that it's cleaning everything.
CSSTidy isn't really abandoned, though; one of the original authors forked the PHP class, and the Jetpack team and others have made contributions to keep it reasonably up to date. If you don't feel comfortable with it, though, Caja is another option.
A: I use the following function that combines the strength of wp_filter_nohtml_kses and then restores the required escape characters, namely quotes and the > selector.
function escape_css($css) {
$escaped_css = strtr(wp_filter_nohtml_kses($css),
[
'>' => '>',
"\'" => "'",
'\"' => '"',
]);
return $escaped_css;
}
A: The best approach I found was to incorporate CSSTidy into my plugin. I took a page from JetPack which has a Custom CSS feature.
JetPack's CSSTidy implementation is contained in the Jetpack_Safe_CSS class as function, filter_attr. I couldn't entirely figure out why JetPack was nesting the user entered CSS inside a 'div' element prior to parsing, but after some trial and error I learned that CSSTidy isn't really capable of parsing a CSS file. That lesson learned I literally ripped off the code from JetPack.
I downloaded CSSTidy, created a directory to contain the CSSTidy PHP files. I then require class.csstidy.php as necessary in my code and initialize a new csstidy object. Nest the CSS to be validated in a 'div' element, parse it through CSSTidy, then yank the plain CSS back out of the csstidy object. So far so good with thousands of installs (although I'll never know how many users actually use the CSS feature of my plugin).
I may not have noted this is my original question, but I was looking for the simplest, easiest approach, not the most technical, sophisticated, or powerful approach. I value modifying the WordPress experience as little as possible. This is why I turned to JetPack as the closest thing to "source". I consider JetPack nearly canonical as it is developed by Automattic (the developers of WordPress itself). My only... regret?... is that CSSTidy was abandoned in 2007, so I imagine I will need to find another solution at some point.
require_once( 'csstidy/class.csstidy.php' );
$csstidy = new csstidy();
$csstidy->set_cfg( 'remove_bslash', FALSE );
$csstidy->set_cfg( 'compress_colors', FALSE );
$csstidy->set_cfg( 'compress_font-weight', FALSE );
$csstidy->set_cfg( 'discard_invalid_properties', TRUE );
$csstidy->set_cfg( 'merge_selectors', FALSE );
$csstidy->set_cfg( 'remove_last_;', FALSE );
$csstidy->set_cfg( 'css_level', 'CSS3.0' );
$csstovalidateindiv = 'div {' . $csstovalidate . '}';
$csstovalidateindiv = preg_replace( '/\\\\([0-9a-fA-F]{4})/', '\\\\\\\\$1', $csstovalidateindiv );
$csstovalidateindiv = wp_kses_split( $csstovalidateindiv, array(), array() );
$csstidy->parse( $csstovalidateindiv );
$csstovalidateindiv = $csstidy->print->plain();
$csstovalidateindiv = str_replace( array( "\n", "\r", "\t" ), '', $csstovalidateindiv );
preg_match( "/^div\s*{(.*)}\s*$/", $csstovalidateindiv, $matches );
if ( !empty( $matches[1] ) ) $cssvalidated = $matches[1];
(code or it didn't happen)
A: wp_filter_nohtml_kses()
doesn't appear to work properly because it escapes the " character, so you can't write any attribute selectors. It seems like there is no "simple" way to do this.
A: Well, if you want the 50mm-barrel gun approach, you could use wp_filter_nohtml_kses(), but there may be better ways.
|
wordpress
|
{
"language": "en",
"length": 697,
"provenance": "stackexchange_00019.jsonl.gz:420481",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53970"
}
|
[
0.05291748046875,
0.016448974609375,
-0.01470947265625,
-0.039306640625,
0.03363037109375,
-0.03033447265625,
0.0181732177734375,
-0.0188446044921875,
-0.041351318359375,
0.0133209228515625,
-0.03570556640625,
0.040557861328125,
-0.04864501953125,
-0.0058746337890625,
-0.0015726089477539062,
-0.05023193359375,
0.00937652587890625,
-0.01904296875,
-0.00630950927734375,
-0.024169921875,
-0.0219879150390625,
-0.009796142578125,
0.0287017822265625,
-0.00687408447265625,
0.00931549072265625,
-0.025238037109375,
0.08135986328125,
0.0177764892578125,
0.011962890625,
-0.0055389404296875,
0.017425537109375,
-0.0447998046875,
-0.0019931793212890625,
0.056427001953125,
-0.041107177734375,
0.070556640625,
0.01523590087890625,
0.032745361328125,
0.029632568359375,
0.0217132568359375,
0.0251922607421875,
-0.021820068359375,
-0.0218658447265625,
0.03936767578125,
-0.0295257568359375,
-0.0232391357421875,
0.045989990234375,
0.00887298583984375,
-0.011016845703125,
-0.016357421875,
0.0047760009765625,
0.002155303955078125,
0.040802001953125,
-0.08026123046875,
-0.0064239501953125,
0.002155303955078125,
-0.0511474609375,
0.027587890625,
0.016326904296875,
0.054962158203125,
0.00888824462890625,
-0.00644683837890625,
-0.01085662841796875,
-0.033538818359375,
0.0073089599609375,
-0.007610321044921875,
0.0177154541015625,
0.0219879150390625,
-0.01062774658203125,
0.0146636962890625,
0.005802154541015625,
-0.0006127357482910156,
0.010040283203125,
-0.048309326171875,
0.0083160400390625,
0.043701171875,
-0.055419921875,
-0.016448974609375,
0.051025390625,
0.0010347366333007812,
-0.00717926025390625,
-0.01056671142578125,
-0.045806884765625,
-0.0266876220703125,
0.0145263671875,
-0.005542755126953125,
-0.01410675048828125,
0.0087432861328125,
-0.0265960693359375,
0.0005307197570800781,
-0.021484375,
0.01396942138671875,
-0.027984619140625,
-0.0101776123046875,
-0.0077362060546875,
-0.0179290771484375,
0.0240478515625,
0.04034423828125,
-0.0243072509765625,
-0.0022945404052734375,
0.005863189697265625,
-0.036285400390625,
0.005733489990234375,
-0.0232696533203125,
-0.01446533203125,
0.049957275390625,
0.0194244384765625,
0.032501220703125,
0.0232391357421875,
0.0023632049560546875,
0.01313018798828125,
-0.0113525390625,
-0.0016946792602539062,
0.00371551513671875,
-0.037567138671875,
0.002170562744140625,
-0.004253387451171875,
-0.01126861572265625,
-0.0141143798828125,
-0.022674560546875,
0.003692626953125,
0.0014495849609375,
0.004535675048828125,
0.018096923828125,
-0.023223876953125,
-0.032318115234375,
-0.0202484130859375,
-0.0026035308837890625,
0.00949859619140625,
-0.01349639892578125,
-0.057525634765625,
0.0271453857421875,
0.0927734375,
0.041717529296875,
0.0255584716796875,
-0.0222320556640625,
0.033355712890625,
-0.014312744140625,
-0.001415252685546875,
0.016845703125,
-0.01245880126953125,
-0.044891357421875,
-0.01512908935546875,
-0.005970001220703125,
0.03564453125,
0.031951904296875,
0.0152435302734375,
0.0008349418640136719,
0.01384735107421875,
-0.08441162109375,
0.06805419921875,
-0.054443359375,
0.04254150390625,
0.0163726806640625,
-0.030670166015625,
-0.031951904296875,
0.0233154296875,
-0.0513916015625,
-0.0021839141845703125,
-0.06201171875,
0.00884246826171875,
0.01739501953125,
0.05010986328125,
0.0089874267578125,
0.003887176513671875,
-0.0176544189453125,
-0.046539306640625,
0.0007920265197753906,
0.0165863037109375,
0.01267242431640625,
-0.0222015380859375,
-0.0008029937744140625,
0.009613037109375,
0.004413604736328125,
-0.0132904052734375,
0.0209503173828125,
-0.007801055908203125,
0.04986572265625,
0.00960540771484375,
0.041961669921875,
0.036895751953125,
-0.049530029296875,
0.06884765625,
-0.0152435302734375,
-0.0038776397705078125,
-0.00859832763671875,
0.0030422210693359375,
0.01284027099609375,
0.026824951171875,
0.01470947265625,
-0.01004791259765625,
-0.00565338134765625,
-0.009918212890625,
-0.029052734375,
0.00890350341796875,
-0.04949951171875,
0.04986572265625,
-0.01386260986328125,
0.012420654296875,
0.0272064208984375,
0.01540374755859375,
-0.0195770263671875,
0.046844482421875,
-0.0352783203125,
-0.028564453125,
-0.0120391845703125,
-0.021881103515625,
0.0302886962890625,
-0.0265655517578125,
0.023956298828125,
0.004482269287109375,
-0.029022216796875,
-0.00676727294921875,
0.0296630859375,
0.03924560546875,
0.0144805908203125,
0.0096282958984375,
0.040740966796875,
0.01212310791015625,
0.0290679931640625,
0.027679443359375,
-0.035430908203125,
0.0210723876953125,
-0.01354217529296875,
-0.00975799560546875,
-0.0219573974609375,
-0.00640106201171875,
-0.003276824951171875,
-0.0034084320068359375,
-0.005741119384765625,
0.06280517578125,
0.0201568603515625,
0.0958251953125,
0.0509033203125,
-0.0010747909545898438,
0.00351715087890625,
0.0192413330078125,
-0.09185791015625,
-0.020355224609375,
0.061004638671875,
0.0234222412109375,
0.020172119140625,
-0.009735107421875,
-0.00913238525390625,
0.083251953125,
-0.02154541015625,
0.01218414306640625,
-0.00391387939453125,
-0.00713348388671875,
0.0240631103515625,
-0.005126953125,
-0.007404327392578125,
0.00673675537109375,
-0.0819091796875,
0.00850677490234375,
0.0159454345703125,
-0.034576416015625,
-0.003204345703125,
-0.0177459716796875,
0.017547607421875,
-0.01025390625,
-0.005344390869140625,
0.023193359375,
-0.02362060546875,
0.051513671875,
-0.028289794921875,
0.004222869873046875,
-0.0256500244140625,
0.01158905029296875,
0.001163482666015625,
0.01343536376953125,
-0.11712646484375,
-0.01064300537109375,
0.0204620361328125,
0.00693511962890625,
0.0034618377685546875,
-0.0185089111328125,
-0.00937652587890625,
0.0102996826171875,
0.007564544677734375,
0.01320648193359375,
0.026824951171875,
-0.0066680908203125,
-0.00646209716796875,
-0.0014638900756835938,
-0.037750244140625,
0.01496124267578125,
0.05322265625,
0.0065155029296875,
0.00360870361328125,
0.023895263671875,
0.0333251953125,
-0.012481689453125,
0.0294952392578125,
0.0287933349609375,
-0.0175933837890625,
0.02783203125,
0.0285797119140625,
0.006839752197265625,
0.00911712646484375,
0.03912353515625,
0.0400390625,
0.0131683349609375,
-0.004241943359375,
0.028778076171875,
0.021148681640625,
0.017791748046875,
0.017181396484375,
0.01033782958984375,
0.007259368896484375,
-0.052093505859375,
-0.032928466796875,
0.00887298583984375,
0.0173187255859375,
-0.0279693603515625,
-0.037139892578125,
-0.03466796875,
-0.0164947509765625,
-0.06634521484375,
-0.040191650390625,
-0.0094146728515625,
-0.022125244140625,
-0.06719970703125,
0.00792694091796875,
-0.0281219482421875,
0.04010009765625,
-0.004032135009765625,
-0.031005859375,
0.01088714599609375,
-0.025146484375,
-0.039886474609375,
-0.032440185546875,
-0.05877685546875,
0.0078125,
-0.001964569091796875,
-0.006496429443359375,
0.0030002593994140625,
0.0307769775390625,
0.0035400390625,
-0.026885986328125,
0.01904296875,
0.0056610107421875,
-0.014373779296875,
-0.00640869140625,
-0.0245208740234375,
-0.05682373046875,
-0.036163330078125,
-0.0157623291015625,
0.006122589111328125,
-0.0223236083984375,
0.030426025390625,
0.04595947265625,
-0.0049285888671875,
-0.01459503173828125,
-0.0219268798828125,
0.05462646484375,
0.0234527587890625,
-0.0170135498046875,
0.00888824462890625,
-0.040313720703125,
0.0249481201171875,
0.01125335693359375,
0.01439666748046875,
0.0289154052734375,
-0.02008056640625,
-0.02813720703125,
0.0010099411010742188,
0.03900146484375,
0.05450439453125,
0.0217132568359375,
0.007610321044921875,
0.0172882080078125,
0.0097503662109375,
0.0153961181640625,
0.024383544921875,
-0.037628173828125,
0.026092529296875,
-0.0276947021484375,
0.0084686279296875,
-0.004627227783203125,
-0.016265869140625,
-0.0221405029296875,
-0.0045013427734375,
-0.035797119140625,
-0.0117340087890625,
0.0252685546875,
0.01078033447265625,
0.05157470703125,
-0.04034423828125,
-0.0212554931640625,
-0.022247314453125,
0.070556640625,
-0.0267791748046875,
-0.0263519287109375,
0.02264404296875,
0.0281829833984375,
-0.066162109375,
-0.022064208984375,
-0.032867431640625,
-0.006938934326171875,
-0.1689453125,
0.0054473876953125,
-0.01192474365234375,
-0.0687255859375,
-0.0010480880737304688,
-0.0550537109375,
-0.087890625,
-0.05963134765625,
0.024017333984375,
-0.0238037109375,
-0.0019254684448242188,
0.01378631591796875,
-0.00986480712890625,
-0.015716552734375,
-0.0020542144775390625,
-0.030181884765625,
-0.07928466796875,
-0.023193359375,
-0.0230712890625,
0.0618896484375,
0.0166473388671875,
-0.0021343231201171875,
-0.017669677734375,
0.046844482421875,
-0.028656005859375,
0.039947509765625,
-0.01187896728515625,
0.0255889892578125,
-0.001888275146484375,
0.004261016845703125,
0.0124664306640625,
-0.02069091796875,
-0.0055389404296875,
0.0103607177734375,
-0.037322998046875,
0.0060272216796875,
0.0028076171875,
-0.0306396484375,
0.06280517578125,
-0.0367431640625,
-0.009796142578125,
-0.0268402099609375,
-0.045501708984375,
0.01247406005859375,
-0.025177001953125,
-0.01873779296875,
-0.02392578125,
0.0020599365234375,
0.03515625,
0.016510009765625,
0.0139617919921875,
-0.010467529296875,
0.043060302734375,
0.0172576904296875,
-0.029449462890625,
0.006145477294921875,
-0.018096923828125,
0.01361083984375,
-0.001125335693359375,
0.01293182373046875,
0.002056121826171875,
-0.02703857421875,
0.01371002197265625,
-0.01444244384765625,
-0.0196685791015625,
0.01253509521484375,
0.07080078125,
0.00785064697265625,
-0.01049041748046875,
0.0135498046875,
-0.00024771690368652344,
-0.02056884765625,
-0.0010700225830078125,
0.0035400390625,
0.0232086181640625,
0.0011873245239257812,
-0.01384735107421875,
0.0333251953125,
-0.03912353515625,
-0.00765228271484375,
-0.0231781005859375,
0.01453399658203125,
-0.01580810546875,
0.045074462890625,
0.0089569091796875,
-0.0006089210510253906,
0.00925445556640625,
0.00823974609375,
-0.0003368854522705078,
-0.027801513671875,
-0.01558685302734375,
-0.0160675048828125,
0.039398193359375,
-0.060150146484375,
-0.003993988037109375,
-0.00603485107421875,
-0.007053375244140625,
0.01497650146484375,
0.005336761474609375,
-0.031280517578125,
-0.0211639404296875,
0.01534271240234375,
-0.015472412109375,
0.0119781494140625,
0.0184326171875,
-0.0213470458984375,
-0.00189971923828125,
0.0012722015380859375,
0.01849365234375,
0.031341552734375,
-0.006191253662109375,
-0.007648468017578125,
-0.006298065185546875,
0.007205963134765625,
-0.033172607421875,
0.026153564453125,
-0.0181427001953125,
0.007205963134765625,
-0.00670623779296875,
-0.00907135009765625,
0.0050201416015625,
0.016876220703125,
0.00786590576171875,
0.00594329833984375,
0.01678466796875,
0.005435943603515625,
-0.00151824951171875,
0.0487060546875,
-0.02996826171875,
-0.047088623046875,
0.042572021484375,
0.0298614501953125,
-0.021728515625,
0.0201416015625,
0.01454925537109375,
0.0311431884765625,
-0.05145263671875,
-0.0252838134765625,
-0.052154541015625,
0.00567626953125,
-0.050994873046875,
-0.033538818359375,
0.00379180908203125,
0.06695556640625,
-0.005512237548828125,
-0.0153045654296875,
-0.03924560546875,
-0.041748046875,
0.03662109375,
-0.039764404296875,
-0.0198822021484375,
-0.0238800048828125,
-0.00025463104248046875,
-0.0197601318359375,
-0.0295562744140625,
-0.0614013671875,
0.0024089813232421875,
-0.020751953125,
0.0014238357543945312,
0.03448486328125,
-0.0163726806640625,
0.042572021484375,
-0.0285491943359375,
0.0025634765625,
0.01385498046875,
0.00406646728515625,
0.035675048828125,
0.001865386962890625,
-0.01387786865234375,
-0.0184478759765625,
-0.03680419921875,
-0.0101776123046875,
-0.0224456787109375,
-0.0262603759765625,
-0.016510009765625,
0.00849151611328125,
-0.036865234375,
0.0164642333984375,
-0.01216888427734375,
0.0128173828125,
-0.00980377197265625,
0.0260162353515625,
-0.016448974609375,
0.04229736328125,
-0.05401611328125,
0.043701171875,
0.041107177734375,
-0.0291595458984375,
-0.0036144256591796875,
0.02972412109375,
0.0210418701171875,
0.007274627685546875,
-0.0234832763671875,
-0.052032470703125,
-0.006809234619140625,
-0.01233673095703125,
0.0204925537109375,
0.0771484375,
0.0775146484375,
0.0175323486328125,
0.033447265625,
-0.007671356201171875,
0.01311492919921875,
-0.031646728515625,
-0.020294189453125,
-0.04693603515625,
0.0024166107177734375,
-0.006908416748046875,
0.0138702392578125,
0.0167694091796875,
0.003978729248046875,
-0.032196044921875,
0.0131683349609375,
0.0377197265625,
0.02099609375,
-0.034942626953125,
-0.0176849365234375,
0.004425048828125,
-0.0122528076171875,
0.010406494140625,
0.01235198974609375,
-0.016265869140625,
0.0213165283203125,
-0.0015926361083984375,
-0.0204010009765625,
0.007511138916015625,
0.038055419921875,
0.01490020751953125,
-0.0175018310546875,
0.03961181640625,
0.00945281982421875,
0.0035724639892578125,
0.0152587890625,
0.113037109375,
0.114501953125,
-0.11480712890625,
-0.014556884765625,
0.025543212890625,
-0.046875,
-0.0184783935546875,
0.00994110107421875,
0.0256500244140625,
-0.022491455078125,
0.0202178955078125,
-0.0037937164306640625,
0.007167816162109375,
0.021636962890625,
-0.015869140625,
0.008392333984375,
-0.0003421306610107422,
0.0751953125,
-0.0005435943603515625,
-0.04547119140625,
-0.04437255859375,
0.03033447265625,
-0.0201416015625,
-0.035797119140625,
0.003597259521484375,
0.001781463623046875,
0.0018053054809570312,
-0.055572509765625,
0.0089111328125,
-0.029815673828125,
0.01012420654296875,
0.01419830322265625,
-0.0012693405151367188,
0.036773681640625,
0.03619384765625,
-0.0048065185546875,
-0.0196990966796875,
0.01122283935546875,
0.0105743408203125,
0.0333251953125,
-0.032073974609375,
-0.024322509765625,
0.023040771484375,
-0.006587982177734375,
0.008026123046875,
0.038055419921875,
-0.0203399658203125,
-0.0242462158203125,
0.0025081634521484375,
0.07318115234375,
0.0228424072265625,
-0.03570556640625,
0.0223388671875,
0.0167083740234375,
-0.023468017578125,
-0.01715087890625,
-0.0118255615234375,
-0.0589599609375,
-0.037689208984375,
-0.0229034423828125,
-0.055755615234375,
0.018280029296875,
-0.02630615234375,
-0.08416748046875,
0.010833740234375,
0.038116455078125,
0.053009033203125,
0.004364013671875,
-0.018310546875,
-0.036102294921875,
-0.060394287109375,
0.0109405517578125,
0.0028362274169921875,
-0.03759765625,
0.00997161865234375,
-0.0241851806640625,
-0.007328033447265625,
0.006542205810546875,
0.05322265625,
-0.00366973876953125,
-0.01435089111328125,
-0.0069580078125,
-0.02691650390625,
0.0235595703125,
0.033294677734375,
0.0159759521484375,
0.003498077392578125,
-0.007904052734375,
0.002330780029296875,
0.06207275390625,
-0.028076171875,
0.0225372314453125,
-0.0196075439453125,
-0.00377655029296875,
0.0035572052001953125,
-0.0034942626953125,
-0.00959014892578125,
-0.00823974609375,
0.03338623046875,
-0.0643310546875,
0.01250457763671875,
0.0310516357421875,
0.015655517578125,
-0.047332763671875,
0.059539794921875,
0.0201568603515625,
-0.0205841064453125,
-0.01763916015625,
-0.033416748046875,
0.032012939453125,
0.010406494140625,
0.0200347900390625,
0.036834716796875,
0.022308349609375,
0.0115509033203125,
0.04461669921875,
0.0257720947265625,
0.03631591796875,
-0.0032100677490234375,
0.0183563232421875,
0.00582122802734375,
0.030731201171875,
-0.038055419921875,
-0.04351806640625,
0.00582122802734375,
0.0328369140625,
-0.0095062255859375,
0.005741119384765625,
0.01064300537109375,
0.0288238525390625,
-0.001819610595703125,
-0.0081939697265625,
0.05108642578125,
-0.0263214111328125,
-0.03192138671875,
0.01427459716796875,
0.01157379150390625,
0.037322998046875,
-0.0024585723876953125,
0.01393890380859375,
0.039703369140625,
-0.01343536376953125,
0.039154052734375,
-0.0230255126953125,
-0.0394287109375,
0.01157379150390625,
0.04266357421875,
0.03338623046875,
0.0099029541015625,
0.00043010711669921875,
-0.016571044921875,
-0.033721923828125,
0.0178070068359375,
0.045745849609375,
0.010894775390625,
0.038970947265625,
0.06915283203125,
0.01418304443359375,
-0.01436614990234375,
-0.026214599609375,
0.0408935546875,
0.04107666015625,
0.0017652511596679688,
-0.07012939453125,
-0.0177154541015625,
0.02569580078125,
-0.060089111328125,
-0.02032470703125,
0.0014753341674804688,
0.0008339881896972656,
0.048980712890625,
-0.006000518798828125,
0.0078277587890625,
0.0259246826171875,
0.056365966796875,
0.0225677490234375,
0.0251617431640625,
0.016693115234375,
0.0165557861328125,
-0.01528167724609375,
0.01354217529296875,
-0.0242919921875,
0.053619384765625,
-0.01439666748046875,
0.002590179443359375,
-0.032501220703125,
0.0164642333984375,
-0.00400543212890625,
0.0129852294921875,
0.003734588623046875,
0.042694091796875,
0.06256103515625,
-0.084228515625,
0.0305328369140625,
0.08038330078125,
0.00311279296875,
-0.001300811767578125,
0.006717681884765625,
-0.0147247314453125,
-0.09149169921875,
-0.06744384765625,
-0.0297698974609375,
0.0711669921875,
-0.06036376953125,
0.07049560546875,
-0.042694091796875,
0.00916290283203125,
-0.01543426513671875,
0.0089111328125,
-0.028594970703125,
-0.0093994140625,
0.03436279296875,
-0.0037403106689453125,
-0.0146636962890625,
-0.0062103271484375,
-0.0280609130859375,
0.047698974609375,
0.007549285888671875,
0.0106658935546875,
0.0313720703125,
0.0006799697875976562,
0.004669189453125,
0.004505157470703125,
0.0246429443359375,
-0.03009033203125,
-0.038787841796875,
-0.040069580078125,
-0.00420379638671875,
0.0187225341796875,
0.02166748046875,
0.013763427734375,
0.07342529296875,
0.00748443603515625,
0.0207672119140625,
0.037261962890625,
-0.0604248046875,
0.06549072265625,
0.02410888671875,
-0.07025146484375,
0.0234832763671875,
0.01526641845703125,
-0.0206146240234375,
-0.0032806396484375,
0.030548095703125,
-0.037567138671875,
0.023223876953125,
-0.02166748046875,
-0.00612640380859375,
0.04217529296875,
0.07769775390625,
0.039794921875,
0.0284423828125,
0.000030994415283203125,
-0.04083251953125,
-0.0111846923828125,
-0.02117919921875,
-0.020294189453125,
-0.0382080078125,
0.02264404296875,
0.0244598388671875,
0.0107879638671875,
-0.0007014274597167969,
-0.007701873779296875,
-0.005153656005859375,
0.0153961181640625,
-0.029266357421875,
0.01824951171875,
-0.01364898681640625,
-0.05029296875,
0.03271484375,
-0.01137542724609375,
0.0257568359375,
-0.006259918212890625,
-0.01355743408203125,
-0.052459716796875,
-0.0360107421875,
-0.03955078125,
0.053009033203125,
-0.03289794921875,
0.013397216796875,
0.03314208984375,
0.0102386474609375,
0.01165771484375,
0.0283660888671875,
-0.00710296630859375,
0.07879638671875,
-0.07525634765625,
-0.00751495361328125,
0.0240478515625,
0.0017261505126953125,
-0.0034275054931640625,
-0.1014404296875,
-0.0268402099609375,
-0.059661865234375,
0.053497314453125,
0.004547119140625,
-0.0312042236328125,
-0.0193023681640625,
-0.0556640625,
-0.08843994140625,
0.00116729736328125,
0.0250244140625,
-0.046295166015625,
-0.01959228515625,
0.01007843017578125,
0.0192413330078125,
-0.03533935546875,
-0.01020050048828125,
-0.00876617431640625,
-0.0087127685546875,
0.00989532470703125,
0.00914764404296875,
0.00982666015625,
0.004436492919921875,
0.0208740234375,
-0.053955078125,
0.01473236083984375,
0.004024505615234375,
-0.00722503662109375,
-0.043975830078125,
0.004604339599609375,
0.01004791259765625,
0.01210784912109375,
0.003879547119140625,
-0.0114288330078125,
0.051544189453125,
-0.00711822509765625,
0.002407073974609375,
-0.00731658935546875,
-0.03619384765625,
-0.0179595947265625,
0.061004638671875,
0.0034503936767578125,
0.0183868408203125,
0.007328033447265625,
0.004016876220703125,
-0.0190582275390625,
0.0130767822265625,
0.006988525390625,
-0.01192474365234375,
-0.0162811279296875,
-0.002452850341796875,
0.0015392303466796875,
0.0102081298828125,
-0.0084228515625,
0.00978851318359375,
0.01904296875,
-0.0193023681640625,
0.03887939453125,
-0.018585205078125,
0.016876220703125,
-0.060699462890625,
0.05804443359375,
-0.04150390625,
-0.024261474609375,
0.00499725341796875,
0.05810546875,
0.00841522216796875,
-0.01044464111328125,
-0.00966644287109375,
0.002445220947265625,
-0.0201873779296875,
-0.0036563873291015625,
0.01043701171875,
0.026031494140625,
-0.024566650390625,
-0.015167236328125,
0.005077362060546875,
0.0180816650390625,
-0.016021728515625,
0.024444580078125,
0.02105712890625,
0.020050048828125,
-0.0176544189453125,
0.0185089111328125,
-0.041748046875,
-0.031890869140625,
-0.026824951171875,
0.00818634033203125,
0.0234375,
-0.008087158203125,
0.1016845703125,
-0.04669189453125,
-0.00965118408203125,
-0.0075531005859375,
-0.001445770263671875,
-0.08551025390625,
0.040985107421875,
0.01129913330078125,
0.037994384765625,
0.0305328369140625
] |
d4392ae8ce1f40bcc14a49e56f5e15137d0e1b5c
|
Wordpress Stackexchange
Q: How to automatically add paragraph tags in the Visual Editor From my Googling, it appears as though the default behavior in Wordpress is to add paragraphs automatically, but in the HTML view, regardless of what style I choose in the Visual Editor's style drop-down (paragraph, for example), paragraph tags never appear. I also do not see wpautop() called anywhere in my theme (which I inherited from a now departed developer).
What can I do to set this straight? Adding <p> tags to everything is obviously not going to fly with the content editors.
A: One solution is to install the TinyMCE Advanced plugin. In the plugin settings you have a option "Stop removing the <p> and <br /> tags when saving and show Them in the HTML editor".
|
Q: How to automatically add paragraph tags in the Visual Editor From my Googling, it appears as though the default behavior in Wordpress is to add paragraphs automatically, but in the HTML view, regardless of what style I choose in the Visual Editor's style drop-down (paragraph, for example), paragraph tags never appear. I also do not see wpautop() called anywhere in my theme (which I inherited from a now departed developer).
What can I do to set this straight? Adding <p> tags to everything is obviously not going to fly with the content editors.
A: One solution is to install the TinyMCE Advanced plugin. In the plugin settings you have a option "Stop removing the <p> and <br /> tags when saving and show Them in the HTML editor".
A: Make sure you are using the_content for calling the post content and not something like get_the_content. WordPress wpautop filter is applied on the_content.
A: Paragraph tags are added upon display, not upon storage. The wpautop() function is added as a filter to the_content.
You won't ever see these added paragraph tags in either the visual or HTML editors.
A: I just struggled with this same issue and was about to loose my mind because I tried everything mentioned above and other ideas. It turned out that the client was using a Yootheme, and there is a tick box in the settings of that particular theme, which when clicked solved the issue immediately. Here's a link to the forum post: https://yootheme.com/support/question/4342
In other words, it could be a theme related issue.
A: nl2br() can be used to add the line breaks again when using the filtered HTML again
A: The wpautop() filter changes the content view but not changes the view mode on the content editor.
Example:
<?php the_content(); ?> displays the content normally. If you add remove_filter('the_content', 'wpautop'); the content is displayed without p tags.
In both cases, the content editor is displayed in the same manner
|
wordpress
|
{
"language": "en",
"length": 327,
"provenance": "stackexchange_00019.jsonl.gz:420485",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/53980"
}
|
[
0.010284423828125,
0.0014095306396484375,
-0.0212860107421875,
0.02471923828125,
0.0032024383544921875,
-0.034088134765625,
0.056396484375,
-0.0185699462890625,
-0.0014524459838867188,
0.027008056640625,
-0.042327880859375,
0.0068817138671875,
0.0011434555053710938,
-0.0179290771484375,
-0.00611114501953125,
-0.0243377685546875,
0.007465362548828125,
-0.0115509033203125,
-0.003215789794921875,
-0.005420684814453125,
0.014984130859375,
-0.002681732177734375,
0.0023708343505859375,
-0.033966064453125,
0.00972747802734375,
0.0270233154296875,
0.058319091796875,
-0.038360595703125,
0.0029449462890625,
-0.0224609375,
0.01554107666015625,
-0.00754547119140625,
0.01181793212890625,
0.049774169921875,
-0.0496826171875,
0.01251983642578125,
-0.006557464599609375,
0.0279388427734375,
0.001277923583984375,
0.0264739990234375,
0.004161834716796875,
0.0157318115234375,
0.049591064453125,
0.0231475830078125,
-0.01409912109375,
-0.0194549560546875,
-0.0122222900390625,
-0.047607421875,
-0.0195465087890625,
-0.06195068359375,
0.0015783309936523438,
-0.00927734375,
0.043426513671875,
-0.0853271484375,
-0.0159454345703125,
-0.0225372314453125,
-0.0040130615234375,
-0.0098114013671875,
0.0208740234375,
-0.0012903213500976562,
-0.003116607666015625,
-0.004314422607421875,
0.0184326171875,
-0.0076751708984375,
-0.00279998779296875,
0.022491455078125,
-0.00502777099609375,
0.012939453125,
-0.0014352798461914062,
-0.021484375,
-0.01251220703125,
-0.0302581787109375,
-0.006153106689453125,
-0.0179443359375,
0.027984619140625,
-0.0157470703125,
-0.0178375244140625,
-0.0288848876953125,
0.006076812744140625,
0.0311126708984375,
0.02984619140625,
0.01226806640625,
0.005504608154296875,
-0.0243072509765625,
0.00832366943359375,
-0.0243377685546875,
-0.004974365234375,
-0.009368896484375,
-0.04571533203125,
-0.03900146484375,
-0.029144287109375,
-0.049041748046875,
-0.06707763671875,
-0.00841522216796875,
-0.002544403076171875,
-0.042327880859375,
-0.029083251953125,
-0.01444244384765625,
0.0008959770202636719,
0.07269287109375,
-0.01441192626953125,
-0.0465087890625,
0.1146240234375,
-0.0595703125,
0.0221710205078125,
0.00015974044799804688,
-0.039459228515625,
0.038421630859375,
0.07427978515625,
0.048492431640625,
0.01885986328125,
0.00439453125,
0.03155517578125,
0.00958251953125,
-0.0105133056640625,
-0.04510498046875,
-0.01513671875,
0.0295257568359375,
-0.007965087890625,
-0.013336181640625,
-0.00980377197265625,
0.03271484375,
-0.07330322265625,
-0.0175933837890625,
-0.0177764892578125,
-0.0379638671875,
0.0168914794921875,
0.02362060546875,
-0.01364898681640625,
0.0163726806640625,
-0.0050811767578125,
0.0234832763671875,
0.01125335693359375,
0.02044677734375,
-0.010101318359375,
-0.00693511962890625,
0.0190887451171875,
-0.04388427734375,
-0.024322509765625,
0.0160675048828125,
-0.0303802490234375,
-0.0200653076171875,
-0.0017547607421875,
-0.039886474609375,
0.00644683837890625,
0.019012451171875,
0.025970458984375,
0.0223541259765625,
-0.00437164306640625,
-0.050872802734375,
0.0462646484375,
-0.0246124267578125,
0.031768798828125,
0.00875091552734375,
-0.0085296630859375,
-0.034210205078125,
0.00247955322265625,
-0.0271148681640625,
0.01226043701171875,
-0.032684326171875,
0.026092529296875,
-0.012969970703125,
0.01432037353515625,
-0.045196533203125,
-0.0355224609375,
-0.004638671875,
-0.07330322265625,
-0.0111083984375,
0.03851318359375,
0.043701171875,
-0.0079803466796875,
-0.017364501953125,
0.05133056640625,
0.0194854736328125,
-0.0289764404296875,
0.026458740234375,
0.0003094673156738281,
0.02239990234375,
0.014434814453125,
0.0231781005859375,
0.00428009033203125,
-0.01873779296875,
0.0819091796875,
-0.02508544921875,
-0.0709228515625,
0.0169677734375,
-0.01274871826171875,
0.10595703125,
0.053375244140625,
0.0312042236328125,
-0.0159454345703125,
-0.0552978515625,
-0.0256195068359375,
0.00812530517578125,
0.023345947265625,
-0.0234222412109375,
-0.03021240234375,
-0.0209197998046875,
-0.006961822509765625,
-0.0046539306640625,
-0.0218505859375,
-0.028045654296875,
0.00748443603515625,
-0.005512237548828125,
0.0020999908447265625,
-0.0374755859375,
0.00348663330078125,
0.0239715576171875,
0.038726806640625,
-0.0208740234375,
-0.0183868408203125,
-0.0594482421875,
0.03753662109375,
-0.0361328125,
-0.055633544921875,
0.02606201171875,
-0.019561767578125,
0.038909912109375,
0.00678253173828125,
0.0111083984375,
0.01340484619140625,
-0.0298614501953125,
0.034332275390625,
0.0127716064453125,
0.01293182373046875,
-0.01531219482421875,
-0.029052734375,
-0.01467132568359375,
0.007228851318359375,
-0.01198577880859375,
0.0134429931640625,
0.038543701171875,
-0.0003046989440917969,
0.0185089111328125,
-0.0384521484375,
-0.037109375,
-0.03314208984375,
-0.045684814453125,
0.0253753662109375,
0.051483154296875,
0.03814697265625,
0.0494384765625,
0.00289154052734375,
0.000598907470703125,
0.06707763671875,
-0.0214080810546875,
0.014892578125,
-0.0322265625,
-0.0022125244140625,
0.01102447509765625,
0.0086212158203125,
-0.016265869140625,
0.0199432373046875,
-0.0877685546875,
0.0090484619140625,
0.034759521484375,
-0.0009274482727050781,
0.0199737548828125,
-0.0091094970703125,
-0.005855560302734375,
0.01430511474609375,
0.0161285400390625,
-0.01383209228515625,
-0.00267791748046875,
0.042510986328125,
0.01116943359375,
0.055511474609375,
0.056884765625,
-0.0224609375,
-0.0160675048828125,
0.0007786750793457031,
0.045257568359375,
-0.004425048828125,
0.023834228515625,
0.01129913330078125,
-0.0155029296875,
-0.0095062255859375,
-0.0011653900146484375,
-0.020660400390625,
0.00353240966796875,
-0.03375244140625,
0.027313232421875,
0.0024623870849609375,
-0.0251617431640625,
0.0137481689453125,
-0.04571533203125,
-0.01235198974609375,
-0.07769775390625,
-0.0196990966796875,
-0.01171875,
0.017059326171875,
0.024932861328125,
-0.0188140869140625,
0.003662109375,
0.03143310546875,
-0.0012674331665039062,
0.0281829833984375,
-0.025909423828125,
0.056182861328125,
-0.0287933349609375,
0.053619384765625,
0.064697265625,
-0.033905029296875,
0.03240966796875,
0.0199127197265625,
0.005481719970703125,
0.01488494873046875,
0.0221405029296875,
0.0158233642578125,
0.0275115966796875,
-0.045379638671875,
0.0172119140625,
0.018646240234375,
-0.01111602783203125,
-0.011260986328125,
-0.023773193359375,
-0.04071044921875,
0.00487518310546875,
-0.06256103515625,
-0.01031494140625,
0.0286865234375,
-0.07720947265625,
-0.045196533203125,
-0.00637054443359375,
-0.0634765625,
0.016937255859375,
0.0246124267578125,
-0.019287109375,
-0.058441162109375,
-0.0249176025390625,
-0.038848876953125,
-0.07623291015625,
-0.051513671875,
-0.00475311279296875,
-0.01311492919921875,
0.01502227783203125,
0.01097869873046875,
0.07696533203125,
0.0101776123046875,
-0.03802490234375,
0.00891876220703125,
-0.09661865234375,
-0.0151824951171875,
0.044921875,
0.0254364013671875,
-0.06964111328125,
0.033416748046875,
-0.007495880126953125,
-0.00806427001953125,
0.01032257080078125,
0.01459503173828125,
-0.0006103515625,
-0.0207061767578125,
-0.024749755859375,
0.0080413818359375,
0.00891876220703125,
0.007015228271484375,
0.0200958251953125,
0.046417236328125,
-0.0138702392578125,
-0.00251007080078125,
0.0335693359375,
0.0093994140625,
0.0080718994140625,
-0.0594482421875,
-0.024566650390625,
0.00168609619140625,
0.049163818359375,
-0.0227203369140625,
0.0023021697998046875,
0.05413818359375,
-0.006130218505859375,
-0.0062255859375,
-0.041107177734375,
-0.04962158203125,
-0.04559326171875,
0.0163726806640625,
-0.02752685546875,
0.049652099609375,
0.0012044906616210938,
0.0165252685546875,
0.01001739501953125,
-0.0008873939514160156,
-0.01509857177734375,
-0.0010671615600585938,
0.004863739013671875,
-0.0343017578125,
0.0033321380615234375,
-0.0008821487426757812,
-0.002658843994140625,
0.003490447998046875,
0.034149169921875,
-0.01322174072265625,
-0.00861358642578125,
-0.00299835205078125,
0.0293121337890625,
-0.05029296875,
-0.058685302734375,
-0.025482177734375,
-0.0016469955444335938,
-0.00487518310546875,
0.024658203125,
-0.00211334228515625,
0.00232696533203125,
-0.046478271484375,
0.038787841796875,
-0.0188446044921875,
-0.0217437744140625,
0.04278564453125,
-0.040863037109375,
-0.01013946533203125,
0.055419921875,
-0.032012939453125,
0.0196533203125,
-0.027252197265625,
-0.025634765625,
-0.034210205078125,
-0.002056121826171875,
-0.03912353515625,
0.0236663818359375,
0.0034351348876953125,
0.0177459716796875,
-0.010009765625,
0.0240020751953125,
0.01050567626953125,
-0.013916015625,
0.00724029541015625,
0.02349853515625,
-0.034881591796875,
-0.036895751953125,
-0.0012378692626953125,
-0.05810546875,
-0.007495880126953125,
-0.017425537109375,
-0.054901123046875,
0.00646209716796875,
0.0019311904907226562,
0.02099609375,
0.042938232421875,
-0.029388427734375,
0.005336761474609375,
-0.022979736328125,
-0.041961669921875,
0.0063934326171875,
-0.0193634033203125,
-0.023468017578125,
-0.0125579833984375,
-0.01357269287109375,
0.051513671875,
-0.0098876953125,
0.0309295654296875,
-0.0011472702026367188,
0.08428955078125,
0.0167388916015625,
-0.021759033203125,
-0.017181396484375,
0.0101470947265625,
0.03594970703125,
0.062225341796875,
-0.00598907470703125,
-0.0111236572265625,
-0.03106689453125,
0.023406982421875,
0.03753662109375,
0.0261077880859375,
-0.034820556640625,
0.05145263671875,
-0.01165008544921875,
-0.01611328125,
0.0316162109375,
-0.0100860595703125,
0.0093231201171875,
0.0222320556640625,
0.006618499755859375,
-0.02587890625,
0.0278472900390625,
0.031646728515625,
-0.018035888671875,
0.003265380859375,
-0.01480865478515625,
-0.0140228271484375,
-0.00040602684020996094,
0.05999755859375,
-0.010955810546875,
0.00669097900390625,
0.0173492431640625,
-0.045806884765625,
-0.01806640625,
-0.0089874267578125,
-0.006107330322265625,
0.00815582275390625,
-0.006923675537109375,
0.0238494873046875,
-0.0187530517578125,
-0.011627197265625,
-0.0141143798828125,
-0.0091094970703125,
-0.00617218017578125,
-0.004047393798828125,
-0.03826904296875,
-0.0106658935546875,
0.005107879638671875,
0.06781005859375,
0.0202789306640625,
0.01026153564453125,
0.022125244140625,
0.005382537841796875,
-0.017578125,
0.003337860107421875,
0.0017337799072265625,
-0.0193328857421875,
-0.05712890625,
-0.021484375,
-0.01320648193359375,
-0.0182037353515625,
0.02996826171875,
-0.0014333724975585938,
0.005268096923828125,
-0.00036525726318359375,
-0.0123748779296875,
-0.016326904296875,
-0.0002294778823852539,
0.017059326171875,
0.022216796875,
0.038116455078125,
-0.0127105712890625,
0.01322174072265625,
0.035980224609375,
-0.033599853515625,
-0.03179931640625,
0.0092620849609375,
0.055908203125,
-0.01073455810546875,
-0.0214080810546875,
0.0121002197265625,
-0.03570556640625,
-0.009735107421875,
-0.005092620849609375,
-0.0095062255859375,
-0.03271484375,
-0.0035572052001953125,
0.04498291015625,
0.0253753662109375,
0.00650787353515625,
-0.0277862548828125,
0.0150909423828125,
-0.010406494140625,
0.033782958984375,
0.01641845703125,
-0.02764892578125,
0.0246429443359375,
0.01097869873046875,
-0.009857177734375,
-0.02618408203125,
-0.018798828125,
-0.0579833984375,
0.0069122314453125,
-0.0169525146484375,
-0.0074920654296875,
0.038970947265625,
-0.046539306640625,
0.01922607421875,
0.0063323974609375,
-0.0089111328125,
-0.013397216796875,
0.0311279296875,
0.0244598388671875,
0.011810302734375,
-0.0200653076171875,
-0.0258026123046875,
-0.057464599609375,
-0.03985595703125,
-0.03875732421875,
-0.005523681640625,
-0.0276947021484375,
0.0036640167236328125,
0.0058441162109375,
0.020172119140625,
-0.00644683837890625,
-0.0224761962890625,
-0.0153961181640625,
0.035125732421875,
0.0157012939453125,
0.058502197265625,
-0.00829315185546875,
0.04595947265625,
-0.0229034423828125,
0.0848388671875,
-0.0030994415283203125,
0.00958251953125,
-0.0116119384765625,
-0.0284423828125,
0.0241851806640625,
-0.07061767578125,
-0.043701171875,
-0.0052642822265625,
-0.059356689453125,
0.0435791015625,
0.00946044921875,
-0.00257110595703125,
0.033538818359375,
0.005588531494140625,
0.0159759521484375,
-0.0036563873291015625,
0.0167236328125,
0.0135040283203125,
-0.0012359619140625,
0.078857421875,
-0.007320404052734375,
0.0214996337890625,
-0.00726318359375,
-0.01519775390625,
0.0164794921875,
0.004878997802734375,
0.0247802734375,
-0.0083465576171875,
0.01221466064453125,
-0.0033664703369140625,
-0.006740570068359375,
-0.011444091796875,
0.0208740234375,
-0.006420135498046875,
0.0251007080078125,
0.0109405517578125,
0.00910186767578125,
-0.003742218017578125,
-0.0213165283203125,
0.040435791015625,
0.00885772705078125,
-0.016632080078125,
0.05389404296875,
-0.0205078125,
0.00006878376007080078,
0.04852294921875,
0.05841064453125,
-0.0455322265625,
-0.01309967041015625,
-0.0024242401123046875,
-0.0247802734375,
0.0194244384765625,
-0.0102996826171875,
0.0026988983154296875,
-0.041259765625,
0.0645751953125,
0.005733489990234375,
0.004734039306640625,
0.025604248046875,
-0.005794525146484375,
0.0015192031860351562,
-0.0276336669921875,
0.041015625,
0.004352569580078125,
-0.047576904296875,
0.015838623046875,
0.0162353515625,
-0.0166015625,
-0.0289459228515625,
-0.01143646240234375,
0.005496978759765625,
-0.04071044921875,
-0.07080078125,
-0.008270263671875,
-0.00411224365234375,
-0.0042266845703125,
0.0283203125,
-0.022979736328125,
-0.00783538818359375,
0.053314208984375,
-0.0570068359375,
0.05096435546875,
0.021942138671875,
-0.037384033203125,
0.004833221435546875,
-0.0171966552734375,
0.0293731689453125,
0.0261077880859375,
-0.03692626953125,
0.01922607421875,
-0.00951385498046875,
-0.0154266357421875,
-0.0003561973571777344,
-0.0178680419921875,
0.00829315185546875,
0.005161285400390625,
-0.0161590576171875,
0.040252685546875,
0.0124053955078125,
-0.01236724853515625,
-0.0345458984375,
-0.046417236328125,
-0.043609619140625,
0.001552581787109375,
-0.04827880859375,
-0.041229248046875,
0.045928955078125,
-0.059906005859375,
-0.068603515625,
0.11212158203125,
0.040374755859375,
0.0007610321044921875,
-0.0240020751953125,
0.06353759765625,
-0.0467529296875,
0.029022216796875,
-0.039215087890625,
0.0214385986328125,
-0.004093170166015625,
0.0012760162353515625,
-0.053863525390625,
-0.01119232177734375,
-0.0147247314453125,
0.03631591796875,
0.01535797119140625,
-0.01480865478515625,
-0.0188751220703125,
0.023223876953125,
0.07159423828125,
0.03173828125,
0.005992889404296875,
0.0164642333984375,
0.01129150390625,
-0.02947998046875,
-0.01995849609375,
0.0038204193115234375,
0.0325927734375,
-0.07342529296875,
-0.00710296630859375,
0.0231475830078125,
0.007686614990234375,
-0.0005245208740234375,
-0.022735595703125,
-0.028533935546875,
0.023193359375,
-0.022857666015625,
-0.0291595458984375,
0.00439453125,
0.006526947021484375,
0.03924560546875,
0.059844970703125,
-0.10528564453125,
-0.08514404296875,
-0.02508544921875,
0.0350341796875,
0.002742767333984375,
0.0277862548828125,
-0.001178741455078125,
0.003993988037109375,
-0.01447296142578125,
0.0245208740234375,
0.019805908203125,
0.04461669921875,
-0.0102996826171875,
0.00980377197265625,
-0.032958984375,
-0.01190948486328125,
-0.084716796875,
-0.01221466064453125,
0.0640869140625,
0.033355712890625,
-0.01043701171875,
-0.006748199462890625,
0.007152557373046875,
-0.01708984375,
-0.031829833984375,
-0.0352783203125,
-0.03045654296875,
-0.0294952392578125,
-0.0026416778564453125,
0.00914764404296875,
-0.033843994140625,
-0.0019626617431640625,
0.0128936767578125,
0.01342010498046875,
0.04571533203125,
0.01690673828125,
-0.0438232421875,
-0.038177490234375,
0.01971435546875,
0.01392364501953125,
0.003742218017578125,
-0.0284576416015625,
0.037872314453125,
0.0246124267578125,
0.01285552978515625,
-0.0322265625,
0.034759521484375,
0.056610107421875,
0.00878143310546875,
-0.02325439453125,
0.0270843505859375,
0.015411376953125,
0.0199127197265625,
0.0084381103515625,
0.007076263427734375,
0.039398193359375,
0.0203704833984375,
-0.0498046875,
-0.0167694091796875,
-0.004566192626953125,
-0.02752685546875,
-0.0229034423828125,
-0.051666259765625,
-0.01078033447265625,
0.0275421142578125,
0.00337982177734375,
0.0435791015625,
-0.03277587890625,
0.060272216796875,
-0.0203399658203125,
0.004482269287109375,
0.002655029296875,
-0.0254974365234375,
0.031951904296875,
-0.0046844482421875,
0.000026285648345947266,
0.007049560546875,
-0.047149658203125,
-0.004238128662109375,
-0.0517578125,
-0.0469970703125,
0.0299530029296875,
0.03759765625,
-0.00849151611328125,
0.004024505615234375,
0.00010579824447631836,
-0.0017004013061523438,
-0.01529693603515625,
-0.00315093994140625,
0.004913330078125,
0.007076263427734375,
0.023590087890625,
0.0027370452880859375,
-0.07220458984375,
-0.04351806640625,
-0.032257080078125,
0.03070068359375,
0.00666046142578125,
0.1148681640625,
-0.0263824462890625,
0.0202789306640625,
-0.006603240966796875,
0.067138671875,
-0.052215576171875,
-0.0247650146484375,
0.037445068359375,
0.027679443359375,
0.0261993408203125,
-0.0236968994140625,
-0.053314208984375,
0.0221099853515625,
0.0092315673828125,
-0.0074310302734375,
0.0269012451171875,
-0.02197265625,
0.00550079345703125,
-0.0066680908203125,
0.050445556640625,
0.0016927719116210938,
-0.052764892578125,
-0.0654296875,
-0.014739990234375,
0.03900146484375,
0.059478759765625,
0.007244110107421875,
0.03948974609375,
-0.01348114013671875,
-0.0264129638671875,
0.01030731201171875,
-0.059661865234375,
0.00885772705078125,
0.0308074951171875,
0.0016641616821289062,
-0.041290283203125,
0.01702880859375,
-0.014862060546875,
-0.024078369140625,
0.0213470458984375,
0.0092620849609375,
0.0257568359375,
-0.0989990234375,
0.0022563934326171875,
0.01081085205078125,
0.0726318359375,
0.0009431838989257812,
0.0386962890625,
-0.02093505859375,
0.00855255126953125,
0.01016998291015625,
0.0227813720703125,
-0.03173828125,
-0.02325439453125,
-0.007427215576171875,
0.0170745849609375,
-0.015777587890625,
-0.0335693359375,
-0.11572265625,
-0.0035495758056640625,
0.037445068359375,
0.0020084381103515625,
-0.0257110595703125,
0.001857757568359375,
-0.0162353515625,
0.01849365234375,
0.02447509765625,
-0.01073455810546875,
-0.00908660888671875,
-0.0063323974609375,
-0.041778564453125,
-0.0384521484375,
-0.05938720703125,
0.0291595458984375,
-0.04937744140625,
0.02642822265625,
0.028289794921875,
-0.01351165771484375,
0.0211944580078125,
0.02349853515625,
0.01244354248046875,
0.078857421875,
-0.0112152099609375,
-0.005062103271484375,
0.027740478515625,
-0.0081634521484375,
-0.00522613525390625,
-0.059967041015625,
-0.018707275390625,
-0.023101806640625,
0.0206451416015625,
-0.01026153564453125,
-0.00395965576171875,
-0.0007867813110351562,
-0.07928466796875,
-0.167724609375,
0.00446319580078125,
-0.0251922607421875,
-0.060546875,
0.020050048828125,
-0.0195159912109375,
-0.0309600830078125,
-0.0148773193359375,
-0.013763427734375,
0.003536224365234375,
0.0201568603515625,
0.03045654296875,
-0.007114410400390625,
0.06494140625,
-0.002597808837890625,
-0.0032978057861328125,
-0.005290985107421875,
0.00045418739318847656,
-0.01406097412109375,
-0.0202178955078125,
0.02178955078125,
-0.01483917236328125,
0.0014495849609375,
0.041717529296875,
-0.024566650390625,
-0.078125,
-0.02947998046875,
-0.05780029296875,
0.0241241455078125,
-0.0312042236328125,
-0.021820068359375,
-0.0305023193359375,
0.00007158517837524414,
0.0146484375,
-0.0033664703369140625,
-0.0030670166015625,
-0.006633758544921875,
0.005084991455078125,
-0.0006880760192871094,
0.0199432373046875,
-0.005817413330078125,
-0.01206207275390625,
0.01087188720703125,
-0.0145416259765625,
0.0059814453125,
0.0029315948486328125,
-0.042755126953125,
-0.04229736328125,
-0.01261138916015625,
-0.04095458984375,
0.01432037353515625,
-0.0309906005859375,
-0.054351806640625,
0.043670654296875,
-0.024200439453125,
-0.03387451171875,
0.0259246826171875,
0.0164642333984375,
-0.0086669921875,
0.057647705078125,
0.016021728515625,
0.0248870849609375,
-0.050872802734375,
0.01099395751953125,
0.01204681396484375,
0.0014019012451171875,
-0.0243682861328125,
-0.019317626953125,
-0.0137176513671875,
-0.0019741058349609375,
0.0032749176025390625,
-0.009124755859375,
0.0008144378662109375,
-0.0027637481689453125,
-0.0066680908203125,
0.0312347412109375,
-0.036712646484375,
-0.034698486328125,
-0.0460205078125,
0.01398468017578125,
-0.051116943359375,
0.0333251953125,
-0.01214599609375,
-0.00852203369140625,
0.0180206298828125,
0.0087432861328125,
-0.0190887451171875,
-0.00208282470703125,
0.00870513916015625,
0.00836181640625,
-0.01678466796875,
0.006900787353515625
] |
fbe8a4ac4b27a0055e064953a9ae8d4f93835441
|
Wordpress Stackexchange
Q: Code to make a post sticky How is it possible to upgrade a post to make it sticky directly from code, not by admin area?
Is it possible through a code like:
update_post_meta($post_id, $meta_key, $meta_value, $prev_value);
In this case, the $post_id is known, but the $meta_key?
Thank you in advance for your answers
A: The sticky posts are saved as an array of post IDs in the wp_options table. Hence,
$stickies = get_option( 'sticky_posts' );
$stickies[] = $post_id;
update_option( 'sticky_posts', $stickies );
will make the post in question sticky.
EDIT:
Even better, the core provides functions to stick and unstick posts (had to have 'em).
stick_post( $post_id );
unstick_post( $post_id );
--> See source on trac
|
Q: Code to make a post sticky How is it possible to upgrade a post to make it sticky directly from code, not by admin area?
Is it possible through a code like:
update_post_meta($post_id, $meta_key, $meta_value, $prev_value);
In this case, the $post_id is known, but the $meta_key?
Thank you in advance for your answers
A: The sticky posts are saved as an array of post IDs in the wp_options table. Hence,
$stickies = get_option( 'sticky_posts' );
$stickies[] = $post_id;
update_option( 'sticky_posts', $stickies );
will make the post in question sticky.
EDIT:
Even better, the core provides functions to stick and unstick posts (had to have 'em).
stick_post( $post_id );
unstick_post( $post_id );
--> See source on trac
|
wordpress
|
{
"language": "en",
"length": 117,
"provenance": "stackexchange_00019.jsonl.gz:420501",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54051"
}
|
[
0.048095703125,
-0.0173797607421875,
0.022247314453125,
-0.00022077560424804688,
0.0134124755859375,
-0.031707763671875,
0.072021484375,
-0.048553466796875,
0.01447296142578125,
0.0360107421875,
-0.0093231201171875,
-0.02825927734375,
0.01163482666015625,
-0.0165252685546875,
-0.0377197265625,
-0.0204925537109375,
0.0596923828125,
0.0010900497436523438,
0.08416748046875,
-0.01275634765625,
0.056671142578125,
0.0123748779296875,
0.0792236328125,
0.10888671875,
0.027008056640625,
-0.0360107421875,
0.056427001953125,
-0.045074462890625,
0.02783203125,
-0.0192108154296875,
0.02978515625,
-0.0015811920166015625,
0.01210784912109375,
0.023162841796875,
-0.039794921875,
-0.007293701171875,
0.04461669921875,
-0.0256195068359375,
-0.021942138671875,
0.053619384765625,
0.0215606689453125,
0.004047393798828125,
-0.0186614990234375,
0.05633544921875,
-0.031524658203125,
-0.05010986328125,
0.01450347900390625,
-0.041839599609375,
0.0433349609375,
-0.031158447265625,
0.00540924072265625,
0.040374755859375,
0.0201568603515625,
-0.040771484375,
-0.0037479400634765625,
0.00960540771484375,
-0.0218353271484375,
-0.004123687744140625,
0.053314208984375,
0.0128936767578125,
-0.0240478515625,
-0.058074951171875,
0.0193939208984375,
-0.0302734375,
0.0150299072265625,
-0.01361846923828125,
0.033599853515625,
-0.004608154296875,
-0.0478515625,
0.0156707763671875,
0.06640625,
-0.022552490234375,
-0.017425537109375,
-0.02001953125,
0.04595947265625,
-0.021240234375,
0.0257110595703125,
-0.01485443115234375,
-0.033294677734375,
0.052337646484375,
0.05096435546875,
0.01194000244140625,
0.0498046875,
-0.0307464599609375,
0.01617431640625,
-0.0175933837890625,
-0.005893707275390625,
-0.0236358642578125,
-0.0036029815673828125,
-0.0318603515625,
-0.01529693603515625,
0.006938934326171875,
-0.01381683349609375,
0.0203399658203125,
-0.042022705078125,
0.01065826416015625,
0.0113067626953125,
0.01059722900390625,
-0.0244140625,
-0.0005860328674316406,
-0.012725830078125,
-0.0274200439453125,
0.029266357421875,
-0.0237579345703125,
-0.0149688720703125,
-0.0250244140625,
0.006683349609375,
-0.0240631103515625,
0.0248870849609375,
0.034637451171875,
-0.038604736328125,
0.04107666015625,
-0.0010528564453125,
0.00846099853515625,
-0.046142578125,
0.004512786865234375,
-0.03375244140625,
0.0199127197265625,
-0.006397247314453125,
0.0311431884765625,
0.0228729248046875,
0.0303497314453125,
-0.0245361328125,
-0.037506103515625,
0.01227569580078125,
-0.0245208740234375,
-0.03240966796875,
0.00775146484375,
0.0300445556640625,
-0.02685546875,
-0.051300048828125,
0.016082763671875,
0.10418701171875,
0.0635986328125,
0.050201416015625,
-0.006320953369140625,
-0.007198333740234375,
-0.05889892578125,
-0.0236053466796875,
0.0469970703125,
-0.0115814208984375,
-0.07830810546875,
-0.007175445556640625,
-0.002918243408203125,
0.045745849609375,
0.01154327392578125,
0.00922393798828125,
0.032470703125,
-0.00848388671875,
-0.04339599609375,
0.06732177734375,
-0.028106689453125,
0.008392333984375,
0.00551605224609375,
0.00603485107421875,
-0.041717529296875,
0.038177490234375,
-0.0307159423828125,
0.0142669677734375,
-0.047607421875,
0.006237030029296875,
0.0144500732421875,
0.03729248046875,
0.0255279541015625,
-0.005199432373046875,
-0.016998291015625,
-0.04486083984375,
-0.005084991455078125,
0.016021728515625,
0.026214599609375,
0.053924560546875,
0.02239990234375,
0.006488800048828125,
-0.0180816650390625,
-0.0104522705078125,
-0.039703369140625,
-0.0160064697265625,
-0.0283660888671875,
0.03466796875,
0.0007271766662597656,
-0.0173492431640625,
-0.0102386474609375,
0.0224761962890625,
-0.0006079673767089844,
0.00004178285598754883,
-0.0191802978515625,
0.0128173828125,
0.025177001953125,
0.008575439453125,
0.0257720947265625,
-0.00722503662109375,
0.0045013427734375,
-0.0022220611572265625,
0.0158538818359375,
-0.02777099609375,
-0.011810302734375,
-0.039581298828125,
0.01056671142578125,
-0.0185546875,
0.0084075927734375,
-0.048797607421875,
0.0183868408203125,
-0.0153350830078125,
0.030426025390625,
-0.0193939208984375,
0.01496124267578125,
-0.0084381103515625,
0.0400390625,
-0.004100799560546875,
0.00850677490234375,
0.026092529296875,
-0.0174713134765625,
-0.0184478759765625,
0.0016927719116210938,
-0.022186279296875,
0.0015659332275390625,
-0.006450653076171875,
0.00922393798828125,
-0.00533294677734375,
0.0306243896484375,
0.0093994140625,
-0.002605438232421875,
-0.004001617431640625,
0.005748748779296875,
0.050689697265625,
0.0008339881896972656,
-0.0034027099609375,
-0.00661468505859375,
0.0045166015625,
0.0244598388671875,
-0.087646484375,
0.0171051025390625,
-0.0011892318725585938,
-0.0308990478515625,
-0.04119873046875,
0.0028209686279296875,
-0.005222320556640625,
-0.058563232421875,
-0.00466156005859375,
0.06048583984375,
0.04620361328125,
0.0006289482116699219,
0.0198974609375,
0.027740478515625,
0.039093017578125,
-0.005401611328125,
0.034759521484375,
-0.0205535888671875,
0.007015228271484375,
0.03997802734375,
0.0027256011962890625,
0.024566650390625,
-0.0004775524139404297,
-0.018280029296875,
0.04400634765625,
0.0199127197265625,
0.02825927734375,
0.0288848876953125,
-0.0333251953125,
0.032440185546875,
-0.0239715576171875,
-0.012359619140625,
0.021575927734375,
-0.0214996337890625,
0.04290771484375,
-0.003765106201171875,
0.0305633544921875,
0.0201416015625,
-0.036376953125,
0.01523590087890625,
0.01194000244140625,
0.0034809112548828125,
0.006633758544921875,
0.025146484375,
0.00592041015625,
0.00785064697265625,
-0.036102294921875,
-0.006206512451171875,
0.04974365234375,
0.0130462646484375,
-0.02001953125,
0.033294677734375,
0.04888916015625,
-0.009124755859375,
-0.00539398193359375,
0.005039215087890625,
0.033050537109375,
-0.03009033203125,
-0.03265380859375,
-0.0166015625,
-0.0040283203125,
0.02679443359375,
-0.0029392242431640625,
-0.00962066650390625,
0.0523681640625,
0.002716064453125,
0.0157623291015625,
-0.0265350341796875,
0.0233001708984375,
-0.017425537109375,
0.02099609375,
0.048919677734375,
-0.0014905929565429688,
0.0107879638671875,
0.00780487060546875,
0.04071044921875,
0.025787353515625,
0.0183563232421875,
0.004138946533203125,
-0.01934814453125,
0.00852203369140625,
0.01216888427734375,
0.034332275390625,
0.0577392578125,
-0.0109710693359375,
-0.04425048828125,
-0.0022525787353515625,
0.042572021484375,
-0.08502197265625,
-0.0767822265625,
-0.01459503173828125,
-0.0670166015625,
0.0204620361328125,
-0.0136566162109375,
-0.040496826171875,
-0.005596160888671875,
0.00817108154296875,
0.0199432373046875,
-0.0154571533203125,
-0.004627227783203125,
-0.0162200927734375,
-0.00670623779296875,
-0.03680419921875,
0.016571044921875,
0.0095062255859375,
0.024749755859375,
0.00568389892578125,
0.031524658203125,
-0.01262664794921875,
-0.050079345703125,
-0.05523681640625,
0.045257568359375,
-0.0207977294921875,
-0.044189453125,
-0.00582122802734375,
0.005916595458984375,
0.023956298828125,
0.004482269287109375,
0.010101318359375,
0.020355224609375,
-0.0169677734375,
-0.01666259765625,
-0.00701141357421875,
-0.01561737060546875,
0.0209503173828125,
0.0003364086151123047,
0.0002677440643310547,
0.042388916015625,
0.023956298828125,
-0.0210723876953125,
0.00557708740234375,
0.007343292236328125,
-0.0204620361328125,
-0.051788330078125,
0.0012636184692382812,
-0.01062774658203125,
-0.0330810546875,
0.0027618408203125,
0.008697509765625,
0.0009355545043945312,
0.02569580078125,
-0.000514984130859375,
-0.003875732421875,
-0.006923675537109375,
0.01174163818359375,
-0.0307464599609375,
-0.04547119140625,
-0.0357666015625,
0.021087646484375,
-0.035675048828125,
-0.000050187110900878906,
-0.04656982421875,
0.046234130859375,
-0.04815673828125,
-0.0869140625,
0.06396484375,
-0.033477783203125,
0.0129547119140625,
-0.06890869140625,
-0.036407470703125,
-0.038604736328125,
0.10125732421875,
-0.0618896484375,
-0.03216552734375,
-0.00283050537109375,
0.0224456787109375,
0.0162353515625,
-0.034820556640625,
0.0260162353515625,
-0.039154052734375,
-0.06524658203125,
-0.01377105712890625,
-0.00714874267578125,
-0.0210113525390625,
-0.041839599609375,
0.0711669921875,
-0.05841064453125,
-0.0229034423828125,
0.0175323486328125,
0.031463623046875,
-0.0185546875,
0.0018825531005859375,
-0.01904296875,
0.01015472412109375,
-0.01189422607421875,
0.0037479400634765625,
-0.050384521484375,
-0.01247406005859375,
0.004364013671875,
0.03277587890625,
-0.0159912109375,
0.0013027191162109375,
-0.01297760009765625,
0.0294036865234375,
-0.01198577880859375,
0.001953125,
-0.0113525390625,
0.033538818359375,
-0.02581787109375,
-0.05767822265625,
-0.02288818359375,
-0.04034423828125,
0.0084075927734375,
-0.01898193359375,
0.0033779144287109375,
0.006237030029296875,
-0.051055908203125,
-0.005947113037109375,
-0.03497314453125,
-0.01052093505859375,
-0.053070068359375,
-0.051513671875,
-0.0268707275390625,
0.0134429931640625,
-0.0172119140625,
0.0140380859375,
-0.052215576171875,
-0.045684814453125,
0.0555419921875,
0.007061004638671875,
-0.00461578369140625,
0.001651763916015625,
0.0703125,
0.00380706787109375,
-0.0303497314453125,
-0.050506591796875,
-0.0007872581481933594,
0.0238189697265625,
-0.005645751953125,
0.018829345703125,
0.0109405517578125,
-0.00716400146484375,
0.0297088623046875,
-0.01250457763671875,
0.00885772705078125,
-0.050201416015625,
0.034881591796875,
-0.00812530517578125,
-0.007091522216796875,
0.023834228515625,
-0.0169219970703125,
0.04949951171875,
-0.01200103759765625,
-0.031768798828125,
0.0192108154296875,
-0.05657958984375,
0.01555633544921875,
0.036865234375,
-0.004787445068359375,
-0.05316162109375,
-0.054046630859375,
0.0150146484375,
-0.0246124267578125,
-0.020172119140625,
0.004222869873046875,
-0.00797271728515625,
0.004730224609375,
0.00020384788513183594,
0.03729248046875,
-0.0132904052734375,
0.033477783203125,
-0.0287933349609375,
0.03521728515625,
0.03302001953125,
0.006908416748046875,
-0.0274505615234375,
-0.00930023193359375,
0.0313720703125,
0.066162109375,
-0.01904296875,
-0.014373779296875,
0.0063629150390625,
0.022552490234375,
-0.038909912109375,
0.00995635986328125,
0.043121337890625,
-0.0170440673828125,
-0.032012939453125,
-0.01174163818359375,
-0.0180511474609375,
-0.031280517578125,
-0.052886962890625,
0.006168365478515625,
0.0223846435546875,
-0.00775146484375,
0.0289154052734375,
0.043182373046875,
0.0174407958984375,
0.030120849609375,
-0.035003662109375,
0.04559326171875,
0.0509033203125,
0.010162353515625,
-0.00016295909881591797,
0.0173492431640625,
0.0035610198974609375,
-0.01413726806640625,
0.0137939453125,
-0.01139068603515625,
0.060150146484375,
0.0080413818359375,
0.0377197265625,
0.0029163360595703125,
-0.03509521484375,
0.0229949951171875,
-0.0721435546875,
-0.0169830322265625,
0.0161285400390625,
0.00930023193359375,
-0.057952880859375,
-0.0009517669677734375,
0.04840087890625,
0.01113128662109375,
-0.0210418701171875,
0.018798828125,
-0.008697509765625,
-0.05157470703125,
0.0089111328125,
-0.0310211181640625,
0.05682373046875,
-0.062347412109375,
-0.076904296875,
-0.00655364990234375,
-0.0203704833984375,
-0.0261688232421875,
-0.0287017822265625,
-0.0307769775390625,
0.00922393798828125,
-0.0021114349365234375,
0.0161285400390625,
-0.00930023193359375,
0.01401519775390625,
-0.021484375,
0.0002923011779785156,
0.0268096923828125,
-0.002758026123046875,
0.044219970703125,
-0.01053619384765625,
-0.03204345703125,
0.00521087646484375,
-0.069091796875,
-0.01401519775390625,
-0.026824951171875,
-0.035064697265625,
-0.056488037109375,
-0.0012111663818359375,
0.04425048828125,
0.0222015380859375,
-0.006557464599609375,
-0.07061767578125,
0.0023136138916015625,
-0.006175994873046875,
0.029296875,
0.0016927719116210938,
0.03143310546875,
0.030670166015625,
-0.01143646240234375,
0.038665771484375,
0.036529541015625,
0.0300750732421875,
-0.01519775390625,
-0.046875,
-0.0203857421875,
-0.0283660888671875,
0.025482177734375,
0.0161590576171875,
0.004459381103515625,
-0.0229339599609375,
0.01273345947265625,
0.0084228515625,
0.028045654296875,
-0.020660400390625,
0.00493621826171875,
-0.0322265625,
-0.00013446807861328125,
-0.043365478515625,
-0.006191253662109375,
0.01317596435546875,
-0.0244598388671875,
-0.01120758056640625,
-0.0185089111328125,
0.01479339599609375,
0.006290435791015625,
-0.03216552734375,
0.005809783935546875,
0.01519775390625,
-0.03839111328125,
0.039154052734375,
0.1024169921875,
0.0294189453125,
0.03924560546875,
0.02374267578125,
0.00865936279296875,
0.0143585205078125,
0.007404327392578125,
0.017913818359375,
0.0183868408203125,
0.06256103515625,
0.00186920166015625,
-0.013031005859375,
0.031524658203125,
-0.039825439453125,
0.030059814453125,
0.020721435546875,
0.05780029296875,
-0.06060791015625,
0.03668212890625,
0.0328369140625,
0.0196990966796875,
0.06494140625,
0.0186767578125,
-0.0257720947265625,
-0.03424072265625,
0.03680419921875,
-0.03033447265625,
-0.01096343994140625,
0.0142364501953125,
-0.0015516281127929688,
-0.0269775390625,
-0.01873779296875,
0.024871826171875,
0.022857666015625,
-0.007511138916015625,
0.030975341796875,
-0.0117340087890625,
0.0203399658203125,
-0.0290985107421875,
-0.006961822509765625,
-0.0207672119140625,
-0.0207672119140625,
-0.060302734375,
-0.01092529296875,
-0.033538818359375,
0.01381683349609375,
-0.02874755859375,
-0.0182647705078125,
0.035736083984375,
0.036651611328125,
-0.00782012939453125,
-0.023406982421875,
0.026947021484375,
-0.00411224365234375,
-0.0251007080078125,
-0.0178985595703125,
0.033721923828125,
0.0203857421875,
0.000028312206268310547,
0.01885986328125,
0.0013971328735351562,
-0.0399169921875,
-0.03094482421875,
-0.037322998046875,
0.11065673828125,
-0.031982421875,
-0.0266876220703125,
-0.0008716583251953125,
0.0401611328125,
-0.0031147003173828125,
-0.0012035369873046875,
-0.0010433197021484375,
-0.02301025390625,
-0.0089263916015625,
-0.01003265380859375,
-0.0390625,
-0.022430419921875,
-0.03826904296875,
-0.06536865234375,
0.06402587890625,
0.0144805908203125,
0.00872039794921875,
-0.0171356201171875,
0.0214996337890625,
-0.021759033203125,
-0.0090179443359375,
-0.053985595703125,
0.07666015625,
0.006893157958984375,
0.0565185546875,
-0.05548095703125,
-0.0012998580932617188,
0.0188751220703125,
0.0164642333984375,
0.057891845703125,
0.0139617919921875,
-0.048370361328125,
-0.004741668701171875,
0.046905517578125,
0.050018310546875,
0.0200958251953125,
0.040313720703125,
-0.03564453125,
0.0350341796875,
0.03143310546875,
-0.042205810546875,
0.040008544921875,
-0.034210205078125,
-0.045654296875,
-0.020263671875,
0.01340484619140625,
-0.0034198760986328125,
-0.020416259765625,
-0.0271148681640625,
-0.054168701171875,
0.0007810592651367188,
0.02313232421875,
0.03839111328125,
-0.00778961181640625,
0.02581787109375,
-0.00812530517578125,
0.01282501220703125,
0.0223541259765625,
-0.0304718017578125,
0.032379150390625,
-0.0027637481689453125,
0.0158233642578125,
0.004375457763671875,
0.0199432373046875,
-0.0204010009765625,
0.0186004638671875,
0.01568603515625,
0.041534423828125,
-0.0340576171875,
0.043487548828125,
0.033111572265625,
0.0201263427734375,
-0.029876708984375,
-0.01560211181640625,
0.051116943359375,
0.06256103515625,
-0.03082275390625,
0.0343017578125,
-0.0014657974243164062,
-0.01849365234375,
-0.004024505615234375,
-0.0968017578125,
-0.0202178955078125,
-0.0256805419921875,
-0.066650390625,
-0.06207275390625,
0.0215606689453125,
0.03704833984375,
0.05255126953125,
0.0051116943359375,
0.046234130859375,
-0.107666015625,
-0.01641845703125,
-0.02545166015625,
0.0008182525634765625,
0.00022780895233154297,
0.02667236328125,
0.014434814453125,
0.021881103515625,
0.01111602783203125,
0.0037994384765625,
0.0008454322814941406,
0.0330810546875,
-0.003017425537109375,
0.004032135009765625,
-0.0036716461181640625,
-0.044158935546875,
-0.00316619873046875,
0.01363372802734375,
0.04736328125,
0.042449951171875,
0.068359375,
0.0295257568359375,
-0.037261962890625,
0.0036640167236328125,
0.0115966796875,
-0.03021240234375,
0.0018520355224609375,
0.0006542205810546875,
-0.01486968994140625,
-0.00844573974609375,
-0.01045989990234375,
-0.0285797119140625,
0.0271453857421875,
0.004283905029296875,
-0.01023101806640625,
0.05084228515625,
0.0122528076171875,
0.01065826416015625,
0.058807373046875,
0.0189666748046875,
0.04071044921875,
0.0309600830078125,
-0.02783203125,
-0.0092010498046875,
-0.0006475448608398438,
-0.027587890625,
0.00489044189453125,
0.02313232421875,
-0.0271759033203125,
0.04425048828125,
-0.0304107666015625,
0.00856781005859375,
0.024169921875,
-0.038818359375,
0.015045166015625,
0.053497314453125,
0.0084381103515625,
0.023193359375,
-0.03515625,
-0.034423828125,
-0.01290130615234375,
0.0526123046875,
-0.00331878662109375,
0.036651611328125,
-0.01554107666015625,
0.024932861328125,
-0.051300048828125,
0.006870269775390625,
-0.035125732421875,
-0.0185699462890625,
-0.036041259765625,
0.0127716064453125,
-0.0026760101318359375,
0.00788116455078125,
-0.0165557861328125,
0.0142364501953125,
0.035614013671875,
-0.03497314453125,
-0.0007405281066894531,
-0.0059967041015625,
0.02069091796875,
-0.034912109375,
-0.01464080810546875,
-0.024078369140625,
0.0029010772705078125,
-0.0208587646484375,
-0.032012939453125,
0.03460693359375,
0.00382232666015625,
0.00848388671875,
0.0372314453125,
0.01824951171875,
0.0160064697265625,
0.009521484375,
-0.0014934539794921875,
0.01514434814453125,
0.03057861328125,
-0.0168304443359375,
-0.000576019287109375,
0.01361083984375,
-0.0247650146484375,
0.0259857177734375,
0.006427764892578125,
0.0182037353515625,
0.0180511474609375,
-0.02972412109375,
0.0094757080078125,
0.0270843505859375,
0.048980712890625,
-0.01270294189453125,
0.01052093505859375,
0.0023212432861328125,
-0.01142120361328125,
0.004913330078125,
-0.0034160614013671875,
-0.0137786865234375,
-0.034637451171875,
-0.0211639404296875,
0.0048370361328125,
-0.0374755859375,
-0.046966552734375,
-0.038665771484375,
-0.0189971923828125,
0.04052734375,
0.0153045654296875,
-0.03948974609375,
0.0005536079406738281,
0.0083770751953125,
0.01202392578125,
0.022705078125,
0.0183868408203125,
-0.009033203125,
0.019683837890625,
-0.035369873046875,
-0.026611328125,
-0.0236358642578125,
0.045013427734375,
-0.0185699462890625,
0.020538330078125,
0.02581787109375,
-0.0297393798828125,
0.03289794921875,
0.0238800048828125,
0.050689697265625,
0.054779052734375,
0.030120849609375,
-0.01168060302734375,
0.0672607421875,
-0.022369384765625,
-0.023681640625,
-0.07867431640625,
-0.0010576248168945312,
-0.079833984375,
0.024627685546875,
-0.0478515625,
0.0169219970703125,
0.01690673828125,
-0.0275421142578125,
-0.05096435546875,
-0.0186614990234375,
-0.01212310791015625,
-0.0391845703125,
-0.07965087890625,
-0.0086212158203125,
-0.01122283935546875,
0.06207275390625,
-0.014190673828125,
-0.0190277099609375,
-0.040924072265625,
0.04473876953125,
-0.0005574226379394531,
0.006710052490234375,
0.0248260498046875,
-0.0279388427734375,
-0.030029296875,
-0.00916290283203125,
-0.0002416372299194336,
0.00957489013671875,
0.005207061767578125,
-0.00975799560546875,
0.056549072265625,
0.054046630859375,
-0.0181884765625,
0.06292724609375,
0.0176239013671875,
-0.0294952392578125,
-0.006473541259765625,
-0.019775390625,
-0.055633544921875,
-0.031494140625,
0.0672607421875,
0.03125,
0.0308685302734375,
-0.019927978515625,
0.00286865234375,
-0.0135345458984375,
-0.035736083984375,
-0.00621795654296875,
0.016754150390625,
-0.055816650390625,
-0.01418304443359375,
0.006500244140625,
-0.00803375244140625,
0.0174560546875,
-0.0023670196533203125,
-0.0030002593994140625,
-0.0018711090087890625,
0.028594970703125,
-0.021240234375,
-0.0223388671875,
-0.02734375,
0.054840087890625,
-0.0227203369140625,
0.0205841064453125,
-0.004302978515625,
0.0252532958984375,
0.0413818359375,
0.036895751953125,
0.02032470703125,
-0.051666259765625,
0.0237274169921875,
0.0168914794921875,
0.01288604736328125,
0.0228118896484375,
0.012420654296875,
-0.05291748046875,
-0.01450347900390625,
0.036285400390625,
0.01274871826171875,
0.0280303955078125,
-0.02911376953125,
0.048919677734375,
0.018463134765625,
0.07147216796875,
-0.0241241455078125,
0.0099334716796875,
0.0018749237060546875,
0.006214141845703125,
-0.029144287109375,
0.0157928466796875,
0.0203704833984375,
-0.039306640625,
0.0177459716796875,
-0.008880615234375,
0.04559326171875,
0.032073974609375,
0.00027441978454589844,
-0.033599853515625,
-0.033721923828125,
0.01617431640625
] |
54efe2d9e2e0276eb7badbd979b1dbbb311cda99
|
Wordpress Stackexchange
Q: Can local WordPress installs share /wp-content/ folder and database? On my local machine, I have multiple wordpress versions installed so I can test the themes and plugins I develop.
I was wondering if I could somehow create a central wp-content folder and database, which are linked to each version of wordpress, so I don't have to continually copy my projects between the them?
A: For wp-content folder you need to add WP_CONTENT_DIR with path to this folder to each wp-config.php file of each your sites. All of these WP_CONTENT_DIR constants should have the same path to one folder. Read more about it here: http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content
To share the same database, you just need to setup the same database settings in each wp-config.php files. Read about it here: http://codex.wordpress.org/Editing_wp-config.php#Set_Database_Name
UPDATE: To make your urls work correctly define WP_SITEURL and WP_HOME constants which will override options settings. Read about it here: http://codex.wordpress.org/Editing_wp-config.php#WordPress_address_.28URL.29
|
Q: Can local WordPress installs share /wp-content/ folder and database? On my local machine, I have multiple wordpress versions installed so I can test the themes and plugins I develop.
I was wondering if I could somehow create a central wp-content folder and database, which are linked to each version of wordpress, so I don't have to continually copy my projects between the them?
A: For wp-content folder you need to add WP_CONTENT_DIR with path to this folder to each wp-config.php file of each your sites. All of these WP_CONTENT_DIR constants should have the same path to one folder. Read more about it here: http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content
To share the same database, you just need to setup the same database settings in each wp-config.php files. Read about it here: http://codex.wordpress.org/Editing_wp-config.php#Set_Database_Name
UPDATE: To make your urls work correctly define WP_SITEURL and WP_HOME constants which will override options settings. Read about it here: http://codex.wordpress.org/Editing_wp-config.php#WordPress_address_.28URL.29
A: Have you considered a WordPress Multisite Network setup? Have you considered WordPress (Multisite) Network setup? Take a look at this: http://codex.wordpress.org/Create_A_Network
A multisite network is a collection of sites that all share the same
WordPress installation. They can also share plugins and themes.
The individual sites in the network are virtual sites in the sense that
they do not have their own directories on your server, although they
do have separate directories for media uploads within the shared
installation, and they do have separate tables in the database.
|
wordpress
|
{
"language": "en",
"length": 239,
"provenance": "stackexchange_00019.jsonl.gz:420506",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54063"
}
|
[
0.0293731689453125,
-0.033477783203125,
-0.00832366943359375,
-0.047943115234375,
-0.0083160400390625,
-0.042755126953125,
0.0506591796875,
0.0200958251953125,
0.0297698974609375,
0.01629638671875,
-0.033477783203125,
-0.00986480712890625,
0.0027637481689453125,
-0.01548004150390625,
-0.0286102294921875,
-0.0234527587890625,
0.035003662109375,
-0.027984619140625,
-0.0033855438232421875,
-0.01407623291015625,
-0.0026149749755859375,
0.021697998046875,
-0.00016438961029052734,
0.037078857421875,
0.01849365234375,
-0.0230255126953125,
0.062103271484375,
0.014739990234375,
0.0137939453125,
-0.0074462890625,
0.0309906005859375,
-0.0188140869140625,
0.0161590576171875,
0.0156402587890625,
-0.0312042236328125,
-0.01143646240234375,
-0.0015354156494140625,
0.007232666015625,
-0.0184173583984375,
0.027099609375,
0.006618499755859375,
-0.0090789794921875,
0.07257080078125,
0.048858642578125,
0.01076507568359375,
-0.041595458984375,
0.036102294921875,
-0.04083251953125,
-0.0074462890625,
-0.0186614990234375,
-0.005084991455078125,
0.0114898681640625,
0.01457977294921875,
-0.055572509765625,
0.005046844482421875,
-0.0080413818359375,
0.030364990234375,
-0.006946563720703125,
0.043182373046875,
-0.058380126953125,
-0.0546875,
-0.0036411285400390625,
0.032989501953125,
0.0184173583984375,
-0.0279998779296875,
-0.004634857177734375,
0.05242919921875,
-0.004459381103515625,
-0.061370849609375,
-0.0206146240234375,
0.044097900390625,
-0.01373291015625,
0.00506591796875,
-0.056671142578125,
0.0109710693359375,
0.0277557373046875,
-0.0191497802734375,
-0.017974853515625,
0.010101318359375,
-0.00411224365234375,
0.012054443359375,
-0.01554107666015625,
-0.0250244140625,
-0.039703369140625,
0.0301971435546875,
0.003917694091796875,
0.0066986083984375,
-0.0119781494140625,
0.006839752197265625,
0.01311492919921875,
0.0021495819091796875,
-0.03875732421875,
-0.006771087646484375,
0.047119140625,
0.009552001953125,
-0.03387451171875,
0.0154876708984375,
0.042205810546875,
-0.0170745849609375,
0.0010499954223632812,
0.0183563232421875,
-0.03094482421875,
0.0225372314453125,
-0.034027099609375,
0.00223541259765625,
0.041473388671875,
-0.01256561279296875,
-0.0202484130859375,
0.03729248046875,
0.0205841064453125,
0.01300811767578125,
0.005031585693359375,
-0.0166168212890625,
-0.032958984375,
-0.0016546249389648438,
0.051727294921875,
-0.0255279541015625,
0.0158538818359375,
0.005657196044921875,
0.0174407958984375,
-0.006641387939453125,
0.01001739501953125,
-0.049560546875,
0.013214111328125,
0.00801849365234375,
-0.007740020751953125,
0.0179443359375,
-0.00011771917343139648,
-0.06903076171875,
0.0340576171875,
-0.043304443359375,
0.0022373199462890625,
0.109375,
0.07171630859375,
0.025054931640625,
-0.027923583984375,
0.0107574462890625,
0.0211639404296875,
-0.0060882568359375,
0.038482666015625,
-0.030059814453125,
-0.0103302001953125,
0.034759521484375,
-0.04522705078125,
0.008087158203125,
0.0198211669921875,
0.0296173095703125,
0.010650634765625,
-0.027130126953125,
-0.015045166015625,
-0.041259765625,
0.041717529296875,
0.0264434814453125,
0.00893402099609375,
0.0020809173583984375,
-0.04254150390625,
0.0103302001953125,
-0.043212890625,
0.022979736328125,
-0.034820556640625,
0.00434112548828125,
-0.0168609619140625,
-0.0038814544677734375,
-0.0259857177734375,
-0.02093505859375,
0.011871337890625,
-0.01512908935546875,
0.01123046875,
0.0175628662109375,
-0.009490966796875,
0.004100799560546875,
-0.02001953125,
-0.0012989044189453125,
-0.01090240478515625,
0.0010881423950195312,
0.01483154296875,
0.0038242340087890625,
-0.0118865966796875,
0.0186920166015625,
0.08587646484375,
0.020355224609375,
-0.0113983154296875,
0.039520263671875,
-0.005336761474609375,
-0.0338134765625,
0.0132904052734375,
0.01531219482421875,
0.024139404296875,
0.00818634033203125,
0.01702880859375,
0.052215576171875,
0.018402099609375,
-0.0298614501953125,
0.042816162109375,
-0.04254150390625,
-0.0215911865234375,
-0.005462646484375,
0.0282135009765625,
-0.022064208984375,
-0.01322174072265625,
0.0189971923828125,
0.0008292198181152344,
0.020599365234375,
0.03558349609375,
-0.013641357421875,
0.01465606689453125,
-0.0088958740234375,
-0.00653076171875,
-0.00595855712890625,
-0.0256805419921875,
0.01556396484375,
-0.00981903076171875,
0.0191497802734375,
-0.076904296875,
-0.050933837890625,
0.0198822021484375,
-0.046051025390625,
0.02874755859375,
-0.01020050048828125,
0.0631103515625,
-0.0167083740234375,
-0.0236053466796875,
-0.0121307373046875,
-0.020843505859375,
0.02557373046875,
-0.0184173583984375,
-0.0156707763671875,
-0.0155029296875,
-0.005367279052734375,
-0.003631591796875,
-0.036956787109375,
0.0452880859375,
0.0135345458984375,
-0.006137847900390625,
-0.0192413330078125,
0.0079498291015625,
-0.004268646240234375,
-0.058441162109375,
0.0015611648559570312,
0.04876708984375,
0.041473388671875,
0.02740478515625,
-0.0194244384765625,
-0.0178985595703125,
0.038116455078125,
-0.06292724609375,
0.01141357421875,
-0.0136260986328125,
0.0207672119140625,
0.05987548828125,
-0.0169677734375,
-0.006214141845703125,
0.01434326171875,
-0.05926513671875,
-0.0020580291748046875,
0.042633056640625,
-0.042877197265625,
-0.0174102783203125,
0.01389312744140625,
-0.004505157470703125,
0.009002685546875,
-0.0010280609130859375,
0.0023899078369140625,
-0.0078582763671875,
0.004520416259765625,
0.025909423828125,
0.053924560546875,
0.051910400390625,
-0.0020389556884765625,
-0.002124786376953125,
0.0007710456848144531,
0.00691986083984375,
0.0113677978515625,
0.036407470703125,
-0.03240966796875,
0.004032135009765625,
-0.0196380615234375,
0.006694793701171875,
0.002193450927734375,
0.0159454345703125,
-0.011932373046875,
0.01299285888671875,
-0.03411865234375,
-0.004932403564453125,
-0.0033588409423828125,
-0.052490234375,
-0.0029697418212890625,
0.020172119140625,
-0.01812744140625,
-0.038970947265625,
0.008026123046875,
-0.007442474365234375,
-0.06622314453125,
0.042877197265625,
0.0099334716796875,
-0.0462646484375,
0.0711669921875,
-0.00547027587890625,
0.0057220458984375,
0.003993988037109375,
0.06610107421875,
0.053070068359375,
0.00693511962890625,
-0.0121612548828125,
0.002933502197265625,
0.0295562744140625,
0.034759521484375,
-0.0230255126953125,
-0.023284912109375,
0.004322052001953125,
-0.0728759765625,
-0.046295166015625,
0.0221099853515625,
-0.023651123046875,
0.018951416015625,
-0.00626373291015625,
-0.023345947265625,
-0.006153106689453125,
-0.0843505859375,
-0.058013916015625,
-0.0210723876953125,
0.0031948089599609375,
0.0030841827392578125,
0.01425933837890625,
0.004596710205078125,
-0.0224151611328125,
0.0244293212890625,
0.012847900390625,
0.0078582763671875,
-0.0472412109375,
-0.03948974609375,
-0.053741455078125,
-0.06134033203125,
-0.01541900634765625,
0.004825592041015625,
0.013946533203125,
0.0028820037841796875,
0.0203399658203125,
-0.005199432373046875,
-0.0274200439453125,
-0.002223968505859375,
0.02349853515625,
0.00261688232421875,
-0.0230255126953125,
-0.0024967193603515625,
-0.02471923828125,
0.062408447265625,
-0.0154571533203125,
0.06988525390625,
0.041595458984375,
-0.01560211181640625,
-0.027313232421875,
0.02581787109375,
0.0159912109375,
0.052154541015625,
-0.0199432373046875,
-0.0394287109375,
0.0207061767578125,
0.0086669921875,
-0.0506591796875,
-0.01140594482421875,
0.01654052734375,
-0.0232086181640625,
-0.01035308837890625,
0.0225677490234375,
-0.0364990234375,
-0.0024929046630859375,
-0.008392333984375,
0.033721923828125,
0.0209808349609375,
0.0433349609375,
-0.003917694091796875,
0.001560211181640625,
-0.0157470703125,
-0.00891876220703125,
-0.034637451171875,
0.01082611083984375,
-0.0270538330078125,
0.026397705078125,
0.01397705078125,
-0.01183319091796875,
-0.009185791015625,
-0.0023899078369140625,
-0.032806396484375,
-0.060546875,
0.05255126953125,
-0.0248565673828125,
0.04425048828125,
-0.0767822265625,
-0.03887939453125,
-0.024261474609375,
0.11669921875,
-0.07513427734375,
-0.0112457275390625,
0.02606201171875,
0.023468017578125,
-0.0222320556640625,
-0.045013427734375,
-0.066650390625,
-0.014312744140625,
0.0011415481567382812,
-0.009796142578125,
-0.028076171875,
-0.021728515625,
-0.0102996826171875,
-0.043701171875,
0.007350921630859375,
-0.02313232421875,
0.0264129638671875,
-0.00923919677734375,
0.04107666015625,
0.00377655029296875,
0.01331329345703125,
-0.001251220703125,
-0.026885986328125,
-0.017333984375,
-0.10272216796875,
-0.0276031494140625,
-0.00617218017578125,
0.06317138671875,
0.00885009765625,
0.00678253173828125,
-0.0372314453125,
0.051605224609375,
-0.047149658203125,
0.051788330078125,
-0.01145172119140625,
0.042999267578125,
-0.0252227783203125,
-0.0012216567993164062,
0.01309967041015625,
-0.0235443115234375,
0.01027679443359375,
-0.041107177734375,
-0.03533935546875,
-0.03515625,
-0.054107666015625,
0.024200439453125,
-0.045745849609375,
-0.00821685791015625,
-0.0172271728515625,
-0.0236968994140625,
-0.0298919677734375,
0.02569580078125,
-0.0251922607421875,
0.00372314453125,
-0.0191497802734375,
-0.047760009765625,
0.043853759765625,
-0.0015554428100585938,
-0.028167724609375,
0.0005140304565429688,
0.05029296875,
0.01287841796875,
-0.0221710205078125,
-0.0572509765625,
0.017791748046875,
0.051544189453125,
0.036865234375,
0.046356201171875,
0.0382080078125,
-0.0166015625,
0.029296875,
0.049102783203125,
-0.007587432861328125,
0.0010232925415039062,
0.053558349609375,
0.01458740234375,
-0.01357269287109375,
0.0124664306640625,
0.01503753662109375,
-0.01018524169921875,
0.03363037109375,
-0.0101318359375,
-0.012451171875,
-0.0009851455688476562,
0.0212249755859375,
-0.0193939208984375,
0.00897216796875,
-0.03436279296875,
-0.058380126953125,
0.01885986328125,
-0.0279083251953125,
0.0281829833984375,
0.005908966064453125,
-0.0017385482788085938,
0.0565185546875,
0.017120361328125,
-0.0190277099609375,
0.058013916015625,
0.034942626953125,
0.0256805419921875,
0.01326751708984375,
0.0369873046875,
-0.0264434814453125,
-0.0027980804443359375,
-0.0232086181640625,
0.07891845703125,
0.0218505859375,
-0.060882568359375,
0.04742431640625,
-0.007122039794921875,
0.038421630859375,
0.0189971923828125,
0.00836181640625,
0.033111572265625,
0.007656097412109375,
-0.005096435546875,
-0.0241546630859375,
-0.02081298828125,
-0.0008282661437988281,
-0.0467529296875,
-0.0168304443359375,
-0.0177459716796875,
-0.01248931884765625,
0.03826904296875,
0.0017528533935546875,
-0.047821044921875,
0.011749267578125,
-0.0037174224853515625,
0.041412353515625,
0.05743408203125,
0.006374359130859375,
0.01129150390625,
-0.0011730194091796875,
0.010009765625,
-0.02850341796875,
0.00907135009765625,
-0.035125732421875,
0.007465362548828125,
0.0200347900390625,
0.06884765625,
-0.0191650390625,
-0.04931640625,
0.0278472900390625,
-0.0654296875,
-0.0037708282470703125,
-0.01508331298828125,
-0.0423583984375,
-0.035003662109375,
0.010528564453125,
0.032806396484375,
0.0120391845703125,
-0.025360107421875,
-0.0195770263671875,
-0.01184844970703125,
-0.059051513671875,
-0.027374267578125,
0.061981201171875,
-0.0406494140625,
-0.011444091796875,
-0.016082763671875,
-0.0007114410400390625,
-0.027191162109375,
-0.00034499168395996094,
0.009033203125,
0.03204345703125,
-0.03472900390625,
-0.0193328857421875,
0.06158447265625,
-0.0129852294921875,
0.0179443359375,
-0.00792694091796875,
-0.0140380859375,
-0.00762939453125,
-0.00237274169921875,
0.049468994140625,
0.031219482421875,
-0.0298309326171875,
-0.0000095367431640625,
-0.0347900390625,
-0.0006093978881835938,
-0.00049591064453125,
-0.04638671875,
-0.02862548828125,
-0.002166748046875,
0.021881103515625,
-0.01381683349609375,
-0.0096282958984375,
-0.035186767578125,
-0.022491455078125,
0.0352783203125,
0.043975830078125,
-0.01459503173828125,
-0.0167999267578125,
0.0675048828125,
-0.0213470458984375,
0.049530029296875,
-0.0027027130126953125,
0.0176544189453125,
-0.019866943359375,
-0.00638580322265625,
0.005413055419921875,
-0.04571533203125,
-0.0229339599609375,
-0.0133056640625,
-0.019256591796875,
0.0535888671875,
0.050048828125,
0.0047149658203125,
0.0093841552734375,
-0.0266876220703125,
-0.00872802734375,
-0.0222625732421875,
0.059051513671875,
-0.0303497314453125,
0.014556884765625,
-0.00739288330078125,
-0.037200927734375,
0.0098876953125,
-0.0103302001953125,
-0.00878143310546875,
0.03936767578125,
-0.0298004150390625,
0.021240234375,
0.0310821533203125,
-0.02716064453125,
0.04620361328125,
0.10174560546875,
0.0106201171875,
0.08026123046875,
0.031463623046875,
0.0214080810546875,
0.049560546875,
-0.0076446533203125,
-0.0218963623046875,
-0.0347900390625,
0.0184173583984375,
0.0117645263671875,
0.0135650634765625,
0.048065185546875,
-0.005054473876953125,
0.0193939208984375,
0.035125732421875,
0.05889892578125,
-0.031219482421875,
0.0020198822021484375,
0.006072998046875,
-0.04583740234375,
-0.00496673583984375,
0.0031642913818359375,
0.00446319580078125,
0.010009765625,
-0.00263214111328125,
0.004108428955078125,
-0.0197906494140625,
-0.0081329345703125,
-0.00823211669921875,
-0.007659912109375,
0.01361083984375,
0.003482818603515625,
0.00428009033203125,
0.00412750244140625,
-0.0241851806640625,
0.00959014892578125,
0.015625,
-0.004535675048828125,
0.007068634033203125,
-0.0106658935546875,
-0.0282440185546875,
-0.06744384765625,
-0.0222625732421875,
0.00899505615234375,
-0.04217529296875,
-0.03033447265625,
-0.0217132568359375,
0.01041412353515625,
0.04486083984375,
-0.0260467529296875,
0.0171661376953125,
0.0158233642578125,
0.004901885986328125,
-0.00449371337890625,
0.0181732177734375,
0.0020465850830078125,
0.01337432861328125,
-0.04107666015625,
0.0029354095458984375,
-0.063720703125,
0.01934814453125,
-0.0033931732177734375,
-0.003871917724609375,
0.052947998046875,
-0.06744384765625,
0.01100921630859375,
0.0318603515625,
0.037628173828125,
-0.0051727294921875,
0.011138916015625,
0.028106689453125,
-0.083251953125,
-0.1005859375,
0.028564453125,
-0.08905029296875,
-0.030670166015625,
-0.00878143310546875,
-0.019805908203125,
0.0931396484375,
-0.04718017578125,
-0.0178985595703125,
0.045074462890625,
0.04522705078125,
-0.04302978515625,
0.0252532958984375,
-0.02777099609375,
0.053558349609375,
0.02117919921875,
0.00655364990234375,
-0.060638427734375,
-0.00794219970703125,
-0.00769805908203125,
0.038604736328125,
0.04931640625,
0.0216522216796875,
-0.05023193359375,
-0.0297088623046875,
0.00919342041015625,
0.022369384765625,
-0.0139007568359375,
0.0555419921875,
0.0015544891357421875,
0.034912109375,
0.0108489990234375,
-0.0313720703125,
0.028350830078125,
-0.01085662841796875,
-0.03448486328125,
0.0298919677734375,
0.03167724609375,
0.03155517578125,
-0.02252197265625,
0.05865478515625,
-0.02386474609375,
-0.0005102157592773438,
0.037139892578125,
0.00395965576171875,
-0.010650634765625,
-0.0007767677307128906,
-0.0081787109375,
-0.0209808349609375,
0.015838623046875,
-0.02459716796875,
0.031829833984375,
0.0077056884765625,
0.0046844482421875,
0.009918212890625,
0.01561737060546875,
0.0276641845703125,
0.033538818359375,
-0.00884246826171875,
0.04547119140625,
0.0036220550537109375,
0.06280517578125,
0.042449951171875,
0.0169677734375,
-0.038055419921875,
-0.0007047653198242188,
0.02532958984375,
0.071533203125,
-0.054046630859375,
-0.0157928466796875,
0.00787353515625,
-0.00563812255859375,
-0.0281524658203125,
-0.00563812255859375,
-0.017791748046875,
0.01526641845703125,
0.01934814453125,
-0.046112060546875,
-0.00211334228515625,
0.0268096923828125,
-0.01776123046875,
-0.006900787353515625,
0.016021728515625,
0.0097503662109375,
0.0169219970703125,
-0.00624847412109375,
0.00574493408203125,
0.0187530517578125,
0.0024261474609375,
-0.015838623046875,
0.04376220703125,
0.00626373291015625,
0.00835418701171875,
-0.01377105712890625,
0.044525146484375,
0.012298583984375,
-0.0030059814453125,
-0.06658935546875,
-0.0916748046875,
0.061370849609375,
0.04669189453125,
0.0177001953125,
0.014373779296875,
0.024383544921875,
0.048736572265625,
0.00640106201171875,
-0.011566162109375,
0.042327880859375,
-0.0059661865234375,
0.02685546875,
-0.03033447265625,
0.04034423828125,
0.013641357421875,
-0.00592041015625,
-0.036285400390625,
0.0215911865234375,
0.031890869140625,
-0.01806640625,
0.037384033203125,
0.0018033981323242188,
-0.017333984375,
0.006458282470703125,
-0.0160675048828125,
0.0129852294921875,
-0.004695892333984375,
-0.04095458984375,
-0.0300750732421875,
0.011749267578125,
0.00830078125,
0.0009946823120117188,
0.03729248046875,
0.033233642578125,
-0.01104736328125,
-0.016510009765625,
0.00785064697265625,
-0.024139404296875,
0.0005955696105957031,
0.00086212158203125,
-0.01016998291015625,
0.01507568359375,
-0.005779266357421875,
-0.040008544921875,
-0.0238800048828125,
-0.0281982421875,
0.060699462890625,
-0.01220703125,
0.1324462890625,
-0.0548095703125,
0.0178375244140625,
0.0279541015625,
0.0169830322265625,
-0.0006890296936035156,
0.019775390625,
-0.0064544677734375,
0.0011205673217773438,
0.039093017578125,
-0.00806427001953125,
-0.026031494140625,
-0.030517578125,
0.03485107421875,
-0.06939697265625,
-0.02386474609375,
-0.03564453125,
0.034149169921875,
-0.005863189697265625,
0.01378631591796875,
-0.037506103515625,
-0.01519012451171875,
-0.0275115966796875,
-0.0104217529296875,
0.0221405029296875,
-0.00628662109375,
-0.005405426025390625,
0.035125732421875,
0.01006317138671875,
-0.01262664794921875,
0.0257110595703125,
-0.0205230712890625,
0.03118896484375,
0.03662109375,
-0.0157928466796875,
-0.072021484375,
0.0131378173828125,
-0.0020885467529296875,
-0.01003265380859375,
0.01428985595703125,
0.0621337890625,
0.00968170166015625,
-0.01312255859375,
-0.022674560546875,
0.0653076171875,
0.048583984375,
0.0222930908203125,
0.03961181640625,
0.0108489990234375,
-0.037261962890625,
0.013031005859375,
-0.035430908203125,
-0.0227508544921875,
-0.0190887451171875,
-0.007595062255859375,
0.017730712890625,
-0.01154327392578125,
-0.04669189453125,
-0.05902099609375,
0.012420654296875,
0.05157470703125,
0.003814697265625,
-0.05108642578125,
0.02996826171875,
-0.0328369140625,
0.0517578125,
0.007282257080078125,
-0.00727081298828125,
-0.0245513916015625,
-0.005626678466796875,
-0.0007910728454589844,
-0.044769287109375,
-0.04443359375,
0.0516357421875,
-0.01155853271484375,
0.01329803466796875,
0.02154541015625,
-0.0181121826171875,
-0.0003910064697265625,
0.0321044921875,
0.0290069580078125,
0.067626953125,
0.01059722900390625,
-0.02117919921875,
0.017242431640625,
-0.032470703125,
-0.0010395050048828125,
-0.0244903564453125,
0.0008654594421386719,
-0.06378173828125,
-0.01509857177734375,
-0.04345703125,
0.0207977294921875,
0.01103973388671875,
-0.04071044921875,
-0.043609619140625,
-0.0308990478515625,
0.00485992431640625,
-0.0278167724609375,
-0.045379638671875,
0.00847625732421875,
-0.014190673828125,
-0.01125335693359375,
-0.01050567626953125,
-0.016937255859375,
-0.00736236572265625,
0.04815673828125,
-0.0023288726806640625,
0.028167724609375,
-0.00916290283203125,
0.0225982666015625,
0.0157928466796875,
0.0428466796875,
0.031646728515625,
-0.040374755859375,
0.07061767578125,
-0.024810791015625,
0.04339599609375,
0.06390380859375,
-0.02874755859375,
-0.0111846923828125,
-0.037628173828125,
-0.0794677734375,
-0.0295257568359375,
-0.022216796875,
-0.0089569091796875,
-0.005519866943359375,
0.047698974609375,
0.0787353515625,
0.0109100341796875,
-0.036651611328125,
-0.04168701171875,
-0.029266357421875,
-0.0028228759765625,
-0.00670623779296875,
0.01444244384765625,
-0.0595703125,
0.0177764892578125,
0.01117706298828125,
-0.0310821533203125,
0.00203704833984375,
0.01261138916015625,
-0.0313720703125,
0.004119873046875,
0.003147125244140625,
-0.0259857177734375,
-0.02703857421875,
-0.01165008544921875,
0.04266357421875,
-0.0211944580078125,
0.01776123046875,
0.0048980712890625,
0.01021575927734375,
0.03607177734375,
0.0246429443359375,
0.01445770263671875,
-0.000041544437408447266,
-0.0211944580078125,
0.01178741455078125,
0.00777435302734375,
0.03326416015625,
-0.036102294921875,
-0.0242767333984375,
-0.0098419189453125,
0.0200042724609375,
-0.0089263916015625,
0.021728515625,
0.0298004150390625,
0.006198883056640625,
-0.00673675537109375,
0.052886962890625,
-0.007686614990234375,
-0.01482391357421875,
-0.0243682861328125,
0.0305328369140625,
-0.061553955078125,
0.014312744140625,
-0.0309906005859375,
-0.0261077880859375,
0.010101318359375,
-0.0301055908203125,
0.0299072265625,
-0.0545654296875,
0.0118408203125,
-0.041534423828125,
-0.0081024169921875,
0.0263824462890625
] |
062f2c0c1dca5b0bf59080820b6827a7071619d6
|
Wordpress Stackexchange
Q: How do I get the $handle for all enqueued scripts? Is there some way to get the $handle for each script that has been enqueued?
Is there some array that holds all the handles so that I can loop through it and do something using each $handle?
A:
Is there some way to get the $handle for each script that has been enqueued?
You could try inspecting $wp_scripts->queue at a specific hook but it won't give you a list of all handles used by WordPress, believe it or not.
For example, you could hook into wp_head, which runs the wp_print_scripts action, to get a list of $handles for the stock Twenty Seventeen theme in WP v4.7.5:
function get_enqueued_scripts () {
$scripts = wp_scripts();
var_dump( array_keys( $scripts->groups ) );
}
add_action( 'wp_head', 'get_enqueued_scripts' );
And the list of $handles from $wp_scripts->groups will output:
At this point, if you were to compare what exists in $wp_scripts->queue you will only see a subset of the above.
Therefore, even wp_print_scripts will not provide a full list of handles as shown above, if that's what you're after. And it's not possible to always rely on grouped dependencies to get them either.
|
Q: How do I get the $handle for all enqueued scripts? Is there some way to get the $handle for each script that has been enqueued?
Is there some array that holds all the handles so that I can loop through it and do something using each $handle?
A:
Is there some way to get the $handle for each script that has been enqueued?
You could try inspecting $wp_scripts->queue at a specific hook but it won't give you a list of all handles used by WordPress, believe it or not.
For example, you could hook into wp_head, which runs the wp_print_scripts action, to get a list of $handles for the stock Twenty Seventeen theme in WP v4.7.5:
function get_enqueued_scripts () {
$scripts = wp_scripts();
var_dump( array_keys( $scripts->groups ) );
}
add_action( 'wp_head', 'get_enqueued_scripts' );
And the list of $handles from $wp_scripts->groups will output:
At this point, if you were to compare what exists in $wp_scripts->queue you will only see a subset of the above.
Therefore, even wp_print_scripts will not provide a full list of handles as shown above, if that's what you're after. And it's not possible to always rely on grouped dependencies to get them either.
A: the $wp_scripts global holds all the script data:
function wpa54064_inspect_scripts() {
global $wp_scripts;
foreach( $wp_scripts->queue as $handle ) :
echo $handle;
endforeach;
}
add_action( 'wp_print_scripts', 'wpa54064_inspect_scripts' );
|
wordpress
|
{
"language": "en",
"length": 225,
"provenance": "stackexchange_00019.jsonl.gz:420507",
"question_score": "25",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54064"
}
|
[
-0.007640838623046875,
-0.01410675048828125,
-0.0675048828125,
-0.03338623046875,
0.002811431884765625,
-0.044158935546875,
0.0232696533203125,
0.060791015625,
-0.0191802978515625,
0.0181121826171875,
-0.00933837890625,
-0.0093536376953125,
-0.0305633544921875,
-0.0191497802734375,
-0.0176849365234375,
-0.056793212890625,
0.054779052734375,
-0.0804443359375,
-0.00920867919921875,
0.004833221435546875,
0.016937255859375,
0.033843994140625,
0.0172119140625,
0.03924560546875,
0.0286102294921875,
-0.045135498046875,
0.0726318359375,
-0.002655029296875,
0.03350830078125,
-0.0181884765625,
0.020416259765625,
-0.016571044921875,
-0.022216796875,
0.047271728515625,
0.017669677734375,
0.0114898681640625,
0.041778564453125,
0.025787353515625,
0.05615234375,
0.00945281982421875,
0.005374908447265625,
0.01171875,
0.0017194747924804688,
0.0096282958984375,
-0.02783203125,
-0.0205841064453125,
-0.004364013671875,
-0.00881195068359375,
0.01296234130859375,
0.0706787109375,
-0.01436614990234375,
-0.00580596923828125,
-0.0268096923828125,
0.06585693359375,
-0.00482940673828125,
-0.0158538818359375,
0.0007715225219726562,
-0.0445556640625,
0.004482269287109375,
0.04913330078125,
0.01531982421875,
0.0137481689453125,
-0.0035648345947265625,
-0.0562744140625,
-0.044647216796875,
-0.004108428955078125,
0.023193359375,
-0.004840850830078125,
0.0261688232421875,
-0.03814697265625,
-0.0005979537963867188,
0.041900634765625,
0.010833740234375,
-0.0305938720703125,
0.0272674560546875,
-0.0032176971435546875,
-0.015899658203125,
-0.0021820068359375,
0.0067901611328125,
0.0164947509765625,
-0.0152740478515625,
-0.0701904296875,
-0.071533203125,
0.034332275390625,
-0.015625,
0.055633544921875,
-0.00257110595703125,
-0.0164642333984375,
0.00960540771484375,
0.02490234375,
-0.0092315673828125,
-0.0032215118408203125,
0.06378173828125,
0.01361846923828125,
-0.02655029296875,
-0.00717926025390625,
0.046630859375,
0.0156402587890625,
0.002277374267578125,
-0.028656005859375,
0.0162811279296875,
-0.054656982421875,
0.0120086669921875,
-0.00974273681640625,
-0.00959014892578125,
0.016937255859375,
0.01250457763671875,
-0.0261993408203125,
-0.00173187255859375,
0.01245880126953125,
-0.00557708740234375,
-0.0011281967163085938,
0.0185699462890625,
0.0022716522216796875,
-0.0178680419921875,
0.0006990432739257812,
-0.0123291015625,
0.00852203369140625,
-0.01439666748046875,
0.006763458251953125,
0.0016002655029296875,
0.02288818359375,
-0.013092041015625,
-0.01082611083984375,
-0.0246734619140625,
-0.0268402099609375,
-0.00557708740234375,
-0.0245361328125,
0.04522705078125,
0.0214385986328125,
-0.0212249755859375,
-0.01050567626953125,
0.014678955078125,
-0.005382537841796875,
0.00522613525390625,
-0.0264739990234375,
0.0125885009765625,
0.00577545166015625,
-0.0149078369140625,
0.0210418701171875,
-0.048675537109375,
-0.045928955078125,
0.020355224609375,
-0.0303955078125,
-0.028350830078125,
-0.005462646484375,
0.0225982666015625,
0.01070404052734375,
-0.02288818359375,
-0.005672454833984375,
-0.02703857421875,
0.016143798828125,
0.018341064453125,
0.00909423828125,
0.0016031265258789062,
-0.0000871419906616211,
0.0233154296875,
-0.010528564453125,
-0.014739990234375,
-0.0189666748046875,
-0.0021305084228515625,
0.0180206298828125,
-0.019561767578125,
-0.0143890380859375,
-0.0002262592315673828,
-0.04742431640625,
0.0246124267578125,
0.0192413330078125,
0.0225830078125,
0.031829833984375,
-0.051239013671875,
-0.035400390625,
0.03338623046875,
0.00907135009765625,
-0.0100555419921875,
0.043365478515625,
0.0024261474609375,
0.027862548828125,
0.04534912109375,
-0.0306396484375,
-0.0308685302734375,
-0.059234619140625,
0.06982421875,
-0.0174102783203125,
-0.030914306640625,
-0.0264434814453125,
0.00818634033203125,
-0.0169677734375,
0.0214691162109375,
-0.0184326171875,
0.0780029296875,
0.0041656494140625,
-0.0389404296875,
0.022369384765625,
-0.004817962646484375,
0.01021575927734375,
0.0268707275390625,
0.0509033203125,
-0.000018537044525146484,
-0.0458984375,
0.043426513671875,
-0.0133056640625,
0.03558349609375,
-0.028472900390625,
-0.036163330078125,
-0.00018012523651123047,
-0.018768310546875,
0.0265350341796875,
-0.0165252685546875,
0.01190185546875,
0.018768310546875,
-0.0034923553466796875,
-0.03582763671875,
0.0204315185546875,
0.008544921875,
0.040008544921875,
-0.0006742477416992188,
0.09295654296875,
0.0081024169921875,
0.03314208984375,
0.0230865478515625,
-0.054351806640625,
0.0509033203125,
0.0194549560546875,
0.01485443115234375,
0.005077362060546875,
-0.020172119140625,
-0.0004887580871582031,
0.02142333984375,
0.002777099609375,
0.036590576171875,
0.032958984375,
0.0244293212890625,
0.04974365234375,
0.005268096923828125,
-0.00601959228515625,
0.0172576904296875,
-0.054840087890625,
0.009368896484375,
0.0307464599609375,
0.043731689453125,
0.054290771484375,
0.010711669921875,
-0.01468658447265625,
-0.004512786865234375,
-0.04510498046875,
0.041839599609375,
-0.0487060546875,
0.004100799560546875,
0.04345703125,
-0.0169525146484375,
0.024017333984375,
0.003032684326171875,
0.03814697265625,
-0.016571044921875,
0.0380859375,
0.0237884521484375,
0.004058837890625,
-0.0165252685546875,
0.032196044921875,
0.0096893310546875,
0.0054473876953125,
-0.020599365234375,
0.00970458984375,
0.040191650390625,
-0.0194091796875,
0.01873779296875,
0.0171966552734375,
-0.00426483154296875,
0.0015401840209960938,
0.0068206787109375,
-0.0396728515625,
-0.002223968505859375,
0.00537872314453125,
0.006244659423828125,
-0.0302276611328125,
-0.01702880859375,
0.00991058349609375,
-0.01203155517578125,
-0.00458526611328125,
-0.004291534423828125,
0.0283050537109375,
-0.00433349609375,
-0.00847625732421875,
-0.0304107666015625,
-0.05755615234375,
0.0077362060546875,
0.006473541259765625,
0.041229248046875,
0.04473876953125,
0.0305328369140625,
0.069091796875,
0.02264404296875,
0.0288238525390625,
0.01824951171875,
0.0134429931640625,
0.0660400390625,
-0.0250244140625,
0.04248046875,
-0.004764556884765625,
0.0265045166015625,
0.057098388671875,
-0.007518768310546875,
0.00925445556640625,
0.01250457763671875,
0.0295562744140625,
0.032989501953125,
0.002582550048828125,
0.006015777587890625,
-0.00447845458984375,
-0.05755615234375,
-0.0482177734375,
0.01151275634765625,
0.10528564453125,
-0.025787353515625,
-0.052642822265625,
0.00991058349609375,
0.036529541015625,
-0.094970703125,
-0.1280517578125,
0.0382080078125,
-0.06988525390625,
0.0167694091796875,
-0.050537109375,
-0.035675048828125,
-0.0250396728515625,
-0.0272064208984375,
-0.00620269775390625,
-0.0384521484375,
0.0275115966796875,
-0.041961669921875,
-0.0401611328125,
-0.0687255859375,
-0.0164642333984375,
-0.0204925537109375,
0.0408935546875,
0.0007619857788085938,
0.028106689453125,
-0.001651763916015625,
0.002124786376953125,
-0.01287841796875,
0.0017919540405273438,
-0.0138092041015625,
-0.062408447265625,
0.012176513671875,
-0.0355224609375,
-0.004360198974609375,
-0.0017833709716796875,
-0.0301055908203125,
0.004901885986328125,
0.02545166015625,
-0.012451171875,
0.0019321441650390625,
-0.048248291015625,
0.01727294921875,
0.0212249755859375,
-0.0257720947265625,
-0.02508544921875,
0.035400390625,
-0.0487060546875,
-0.033416748046875,
-0.004665374755859375,
-0.035247802734375,
-0.00009000301361083984,
0.048583984375,
-0.0220184326171875,
-0.03448486328125,
0.00041294097900390625,
0.039306640625,
0.0113525390625,
-0.058929443359375,
0.027862548828125,
0.040771484375,
0.01505279541015625,
0.04290771484375,
0.01132965087890625,
0.00830841064453125,
-0.0195770263671875,
0.039337158203125,
-0.00437164306640625,
0.014801025390625,
-0.0291595458984375,
0.0201263427734375,
-0.0501708984375,
0.0064239501953125,
0.0174407958984375,
-0.007305145263671875,
0.0244293212890625,
-0.004364013671875,
-0.0014123916625976562,
0.0081787109375,
0.05462646484375,
0.0013599395751953125,
-0.01224517822265625,
-0.0038318634033203125,
0.0169219970703125,
-0.06427001953125,
-0.048614501953125,
-0.02801513671875,
-0.009796142578125,
-0.1048583984375,
0.00914764404296875,
-0.0144805908203125,
-0.02484130859375,
0.0041351318359375,
-0.0382080078125,
-0.04345703125,
-0.040863037109375,
0.05169677734375,
-0.02960205078125,
0.04656982421875,
-0.01558685302734375,
0.06695556640625,
-0.0406494140625,
-0.00888824462890625,
-0.02813720703125,
-0.051513671875,
-0.0125274658203125,
-0.03692626953125,
0.0665283203125,
0.057098388671875,
-0.06884765625,
0.00927734375,
0.04296875,
-0.01708984375,
0.0006728172302246094,
0.0276641845703125,
0.039337158203125,
-0.0100555419921875,
-0.01471710205078125,
-0.000835418701171875,
-0.048126220703125,
-0.004726409912109375,
0.0005850791931152344,
-0.07183837890625,
-0.0215911865234375,
-0.0017652511596679688,
-0.0189666748046875,
0.05914306640625,
-0.051727294921875,
-0.050384521484375,
-0.0215301513671875,
0.01666259765625,
0.0244140625,
0.004608154296875,
-0.00830078125,
-0.0261688232421875,
-0.03759765625,
0.003971099853515625,
0.0035266876220703125,
-0.00859832763671875,
0.0036983489990234375,
0.034698486328125,
0.02227783203125,
-0.0250701904296875,
-0.0182952880859375,
-0.004230499267578125,
0.0013341903686523438,
0.00592041015625,
0.041412353515625,
0.022674560546875,
0.035614013671875,
-0.042572021484375,
-0.0312347412109375,
-0.035797119140625,
-0.00649261474609375,
0.039337158203125,
0.0187835693359375,
0.00717926025390625,
-0.0255889892578125,
-0.00554656982421875,
0.033447265625,
0.03021240234375,
-0.00888824462890625,
-0.00783538818359375,
0.017425537109375,
0.036285400390625,
-0.034759521484375,
0.0252838134765625,
-0.0235443115234375,
-0.03662109375,
0.0017042160034179688,
0.00997161865234375,
0.03851318359375,
-0.0008502006530761719,
0.01129150390625,
0.0225372314453125,
0.05377197265625,
0.0003285408020019531,
-0.01023101806640625,
-0.01409149169921875,
0.03875732421875,
0.03314208984375,
0.01316070556640625,
0.0274810791015625,
-0.034271240234375,
0.006725311279296875,
-0.0112152099609375,
-0.0246429443359375,
-0.06842041015625,
-0.01117706298828125,
0.01025390625,
0.0894775390625,
0.035491943359375,
0.02288818359375,
0.061553955078125,
0.060333251953125,
-0.011077880859375,
-0.04193115234375,
-0.026824951171875,
0.047576904296875,
-0.061798095703125,
-0.016845703125,
-0.03729248046875,
0.0063629150390625,
-0.0157318115234375,
0.05487060546875,
-0.048675537109375,
0.04986572265625,
-0.0007967948913574219,
0.01232147216796875,
-0.01465606689453125,
0.0118408203125,
0.014739990234375,
0.032196044921875,
0.0175323486328125,
-0.00026798248291015625,
0.01446533203125,
-0.0218048095703125,
-0.0025634765625,
0.050018310546875,
0.01251983642578125,
0.0474853515625,
0.012359619140625,
-0.02911376953125,
0.0172576904296875,
-0.03326416015625,
0.04718017578125,
0.0290374755859375,
-0.019439697265625,
-0.0290374755859375,
-0.037841796875,
0.0222930908203125,
0.006439208984375,
0.0084991455078125,
-0.035369873046875,
-0.026397705078125,
-0.0257720947265625,
-0.0106048583984375,
-0.02532958984375,
-0.01410675048828125,
-0.010162353515625,
-0.0188140869140625,
0.0074005126953125,
0.01323699951171875,
-0.09161376953125,
-0.061492919921875,
0.006092071533203125,
0.0060272216796875,
0.04400634765625,
0.01708984375,
0.058868408203125,
-0.04583740234375,
-0.04901123046875,
-0.060089111328125,
-0.01424407958984375,
0.07763671875,
0.060791015625,
0.007564544677734375,
-0.036956787109375,
-0.04278564453125,
-0.005649566650390625,
0.010345458984375,
-0.054412841796875,
0.0241851806640625,
-0.003398895263671875,
-0.0276336669921875,
-0.007511138916015625,
-0.0303497314453125,
-0.0068359375,
0.0118408203125,
0.06982421875,
0.0076904296875,
0.058868408203125,
-0.02978515625,
0.0369873046875,
0.0243377685546875,
-0.01171875,
0.00811004638671875,
0.0386962890625,
0.036590576171875,
-0.017120361328125,
0.00601959228515625,
-0.045654296875,
0.0179443359375,
-0.01959228515625,
0.0404052734375,
0.01366424560546875,
0.00018310546875,
0.009735107421875,
0.00749969482421875,
0.0048065185546875,
0.01385498046875,
-0.0065155029296875,
0.021453857421875,
0.01419830322265625,
-0.0255584716796875,
0.0919189453125,
-0.01324462890625,
0.002056121826171875,
-0.0089569091796875,
0.0183868408203125,
0.0009984970092773438,
-0.0098876953125,
0.0033168792724609375,
-0.00959014892578125,
-0.08221435546875,
0.06341552734375,
0.078857421875,
0.0178375244140625,
0.0252532958984375,
-0.0095062255859375,
-0.0113677978515625,
-0.01287078857421875,
0.00429534912109375,
0.004974365234375,
-0.01255035400390625,
0.003246307373046875,
-0.015533447265625,
0.01477813720703125,
-0.00994873046875,
-0.0019006729125976562,
-0.01849365234375,
0.012298583984375,
0.02288818359375,
-0.01045989990234375,
-0.0010061264038085938,
0.0193939208984375,
-0.034759521484375,
-0.06292724609375,
-0.01114654541015625,
0.01385498046875,
0.0009350776672363281,
0.043304443359375,
0.0255584716796875,
-0.00789642333984375,
0.0254058837890625,
-0.0142822265625,
-0.00655364990234375,
-0.04473876953125,
-0.0140838623046875,
-0.0203399658203125,
0.0103759765625,
-0.005634307861328125,
0.0005979537963867188,
-0.00884246826171875,
-0.0369873046875,
-0.0179290771484375,
0.0178070068359375,
-0.0264739990234375,
-0.0355224609375,
0.0295257568359375,
-0.035797119140625,
0.0245208740234375,
-0.00952911376953125,
0.0219573974609375,
0.0189361572265625,
0.0133056640625,
0.0015192031860351562,
-0.001415252685546875,
-0.01788330078125,
0.0189361572265625,
-0.001483917236328125,
-0.01654052734375,
0.00502777099609375,
0.0447998046875,
-0.034088134765625,
0.021148681640625,
-0.00251007080078125,
0.01177215576171875,
-0.01145172119140625,
-0.024169921875,
0.008056640625,
-0.01427459716796875,
-0.0215301513671875,
0.008209228515625,
0.022186279296875,
0.0278472900390625,
-0.000652313232421875,
0.0338134765625,
-0.087646484375,
-0.0845947265625,
0.0255584716796875,
-0.102294921875,
-0.03765869140625,
-0.0234222412109375,
-0.0428466796875,
0.0677490234375,
-0.035308837890625,
0.033477783203125,
0.060150146484375,
0.005153656005859375,
-0.0270843505859375,
-0.0215606689453125,
-0.04278564453125,
0.052093505859375,
-0.00939178466796875,
0.07061767578125,
-0.02459716796875,
-0.0059051513671875,
0.043914794921875,
0.0181732177734375,
-0.01824951171875,
-0.0158538818359375,
0.0007524490356445312,
-0.0113067626953125,
0.038726806640625,
0.059661865234375,
0.0254974365234375,
-0.01428985595703125,
-0.0011539459228515625,
0.0244293212890625,
-0.001110076904296875,
-0.0552978515625,
0.011871337890625,
-0.044219970703125,
0.0018405914306640625,
0.0290679931640625,
0.0001499652862548828,
-0.006427764892578125,
-0.01337432861328125,
-0.021392822265625,
-0.030548095703125,
0.0095977783203125,
-0.00585174560546875,
0.0274200439453125,
0.0008702278137207031,
0.019866943359375,
0.00791168212890625,
-0.0246429443359375,
-0.037811279296875,
-0.0092315673828125,
0.0175323486328125,
-0.005401611328125,
-0.00800323486328125,
0.0151519775390625,
0.0095977783203125,
-0.000392913818359375,
0.0030193328857421875,
-0.0027065277099609375,
0.02569580078125,
-0.0167083740234375,
0.0258636474609375,
0.01605224609375,
0.0147857666015625,
-0.0201568603515625,
0.053985595703125,
0.002056121826171875,
0.01137542724609375,
-0.046630859375,
-0.018646240234375,
0.01348114013671875,
0.032012939453125,
0.0156707763671875,
0.00449371337890625,
0.051971435546875,
-0.032501220703125,
0.006870269775390625,
-0.0141754150390625,
-0.0213623046875,
0.00662994384765625,
0.01493072509765625,
0.00720977783203125,
0.03399658203125,
-0.005954742431640625,
-0.0234375,
-0.0276031494140625,
0.03131103515625,
-0.01403045654296875,
0.059051513671875,
-0.0113372802734375,
0.0682373046875,
-0.07745361328125,
-0.0201873779296875,
-0.0195465087890625,
0.0113067626953125,
0.00397491455078125,
0.023773193359375,
-0.0301513671875,
-0.0020656585693359375,
0.007091522216796875,
0.048309326171875,
0.05126953125,
-0.031463623046875,
0.016998291015625,
-0.0171051025390625,
-0.052154541015625,
0.007415771484375,
0.0154571533203125,
-0.024566650390625,
0.03936767578125,
0.010711669921875,
-0.0190582275390625,
-0.032745361328125,
-0.03631591796875,
-0.0106353759765625,
0.050567626953125,
-0.00457000732421875,
-0.04461669921875,
0.039886474609375,
-0.00047326087951660156,
-0.039825439453125,
0.0063934326171875,
0.007602691650390625,
0.056304931640625,
-0.00982666015625,
-0.026458740234375,
-0.005626678466796875,
-0.023468017578125,
0.0264129638671875,
0.0045928955078125,
0.0023136138916015625,
0.007358551025390625,
0.0352783203125,
0.06817626953125,
0.00018155574798583984,
-0.00856781005859375,
0.047821044921875,
-0.024871826171875,
-0.0274505615234375,
0.0777587890625,
0.0026378631591796875,
-0.034423828125,
-0.0293731689453125,
-0.010223388671875,
0.03131103515625,
0.0198211669921875,
-0.0278778076171875,
0.0272674560546875,
0.0148468017578125,
0.0386962890625,
-0.0097198486328125,
0.00965118408203125,
0.02203369140625,
-0.0250091552734375,
-0.022308349609375,
0.01335906982421875,
-0.01015472412109375,
-0.0626220703125,
0.006473541259765625,
0.0196075439453125,
-0.01654052734375,
0.00750732421875,
-0.01727294921875,
0.017974853515625,
-0.0252685546875,
0.0022792816162109375,
-0.0196685791015625,
-0.0201263427734375,
0.01155853271484375,
-0.0110626220703125,
0.01306915283203125,
0.0268402099609375,
0.027008056640625,
-0.028594970703125,
0.0302581787109375,
-0.036224365234375,
0.0321044921875,
0.01690673828125,
0.0291290283203125,
0.0144500732421875,
0.03814697265625,
0.046630859375,
-0.024200439453125,
-0.0196990966796875,
0.03924560546875,
0.0002942085266113281,
-0.01470947265625,
-0.001041412353515625,
0.044342041015625,
-0.039947509765625,
0.00650787353515625,
0.045135498046875,
0.0207061767578125,
0.029083251953125,
-0.0435791015625,
-0.004100799560546875,
-0.017669677734375,
-0.054351806640625,
-0.006744384765625,
-0.036590576171875,
-0.014373779296875,
0.0089569091796875,
-0.018157958984375,
-0.0100250244140625,
0.03155517578125,
-0.0186767578125,
0.034027099609375,
0.0266876220703125,
-0.03857421875,
0.0299072265625,
-0.019989013671875,
-0.026275634765625,
0.015472412109375,
0.03375244140625,
-0.00981903076171875,
-0.033660888671875,
-0.0518798828125,
-0.0213470458984375,
-0.024810791015625,
0.04791259765625,
-0.0034389495849609375,
0.0025081634521484375,
0.0163726806640625,
-0.01497650146484375,
0.01151275634765625,
0.01346588134765625,
0.0171051025390625,
0.0721435546875,
-0.01404571533203125,
-0.04205322265625,
-0.02459716796875,
0.0136260986328125,
0.02496337890625,
-0.0404052734375,
0.00487518310546875,
-0.0589599609375,
-0.003772735595703125,
-0.0286407470703125,
0.00408172607421875,
0.0172882080078125,
-0.034149169921875,
-0.07794189453125,
0.0152130126953125,
-0.021392822265625,
-0.038848876953125,
-0.07769775390625,
0.00765228271484375,
0.026214599609375,
-0.0284271240234375,
-0.0299224853515625,
-0.011962890625,
-0.056549072265625,
0.0156402587890625,
0.0016126632690429688,
0.00702667236328125,
0.052642822265625,
-0.050567626953125,
-0.003376007080078125,
-0.006221771240234375,
0.0121917724609375,
0.00641632080078125,
-0.0213775634765625,
0.00629425048828125,
0.0170745849609375,
0.052459716796875,
-0.007625579833984375,
0.00904083251953125,
0.005138397216796875,
-0.03179931640625,
0.0187835693359375,
-0.008941650390625,
-0.043304443359375,
0.0024623870849609375,
0.06500244140625,
0.021392822265625,
0.025726318359375,
-0.03875732421875,
-0.01065826416015625,
-0.0302734375,
-0.01287078857421875,
0.01113128662109375,
0.0031833648681640625,
-0.01462554931640625,
0.0250396728515625,
-0.0007772445678710938,
-0.02215576171875,
-0.0262603759765625,
-0.053680419921875,
-0.05572509765625,
-0.014068603515625,
-0.059661865234375,
0.0021076202392578125,
0.0185089111328125,
-0.0286102294921875,
0.08563232421875,
-0.03448486328125,
0.01358795166015625,
0.0010538101196289062,
0.03851318359375,
0.050628662109375,
-0.00716400146484375,
-0.034515380859375,
0.01270294189453125,
-0.0215301513671875,
0.033172607421875,
-0.01338958740234375,
0.01248931884765625,
-0.0304718017578125,
0.0262451171875,
-0.0014734268188476562,
-0.00682830810546875,
0.006134033203125,
-0.0276031494140625,
-0.0293731689453125,
-0.018280029296875,
-0.0261688232421875,
0.0491943359375,
-0.03570556640625,
0.0162353515625,
0.00054931640625,
0.027679443359375,
0.00019359588623046875,
-0.0069732666015625,
0.0775146484375,
-0.09027099609375,
0.003536224365234375,
0.0401611328125,
-0.0185699462890625,
-0.032806396484375,
0.0106201171875,
0.04107666015625,
0.020294189453125,
0.008209228515625
] |
7e43184405ac63573de5f23f3bd323dff33fc046
|
Wordpress Stackexchange
Q: Add mass action to wp-admin/users.php I'm heavelly modified my Wordpress, it's amazing what you can do with wordpress hooks, actions.. But i'm not able to find how can i add mass action for users. Let's say i select 5 users and i want to asign them some user_meta value.
A: Unfortunately this isn't possible. Custom actions cannot be added to the bulk actions dropdown (see trac tickets: http://core.trac.wordpress.org/ticket/12732 and http://core.trac.wordpress.org/ticket/16031).
For posts you can use the restrict_manage_posts hook to create another drop-down / add buttons to trigger your custom action. But there is no restrict_manage_* hook available for the user table.
So the only (and not particularly pretty) workaround is to use javascript to insert extra options into the drop-down menu.
However, there is no (supported) way of handling the action - so this would also have to be handled yourself by hooking into the load-* or admin_action_* hook. (See the core files here).
You would then need to check the posted data (the user IDs, the action identifier, nonce, etc) inside that hook and then you would need to check the nonce and the current user's capability to perform that action.
See related question: Custom bulk_action
|
Q: Add mass action to wp-admin/users.php I'm heavelly modified my Wordpress, it's amazing what you can do with wordpress hooks, actions.. But i'm not able to find how can i add mass action for users. Let's say i select 5 users and i want to asign them some user_meta value.
A: Unfortunately this isn't possible. Custom actions cannot be added to the bulk actions dropdown (see trac tickets: http://core.trac.wordpress.org/ticket/12732 and http://core.trac.wordpress.org/ticket/16031).
For posts you can use the restrict_manage_posts hook to create another drop-down / add buttons to trigger your custom action. But there is no restrict_manage_* hook available for the user table.
So the only (and not particularly pretty) workaround is to use javascript to insert extra options into the drop-down menu.
However, there is no (supported) way of handling the action - so this would also have to be handled yourself by hooking into the load-* or admin_action_* hook. (See the core files here).
You would then need to check the posted data (the user IDs, the action identifier, nonce, etc) inside that hook and then you would need to check the nonce and the current user's capability to perform that action.
See related question: Custom bulk_action
A: It's possible by using jQuery to add the item to the drop down or adding another field and then use Ajax to intercept the click and perform your bulk action that way.
|
wordpress
|
{
"language": "en",
"length": 231,
"provenance": "stackexchange_00019.jsonl.gz:420529",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54146"
}
|
[
0.088623046875,
-0.0053558349609375,
0.005191802978515625,
-0.0325927734375,
0.0210113525390625,
-0.04608154296875,
0.0626220703125,
-0.0099334716796875,
0.005596160888671875,
0.03857421875,
-0.026336669921875,
0.0141448974609375,
0.0288848876953125,
-0.01280975341796875,
-0.011871337890625,
-0.0121002197265625,
0.038116455078125,
-0.0250244140625,
0.0265655517578125,
-0.01108551025390625,
0.005611419677734375,
0.00629425048828125,
0.04132080078125,
0.006351470947265625,
0.016387939453125,
-0.019256591796875,
0.057037353515625,
-0.046112060546875,
0.0313720703125,
-0.0163726806640625,
0.01522064208984375,
-0.00672149658203125,
0.01251983642578125,
0.02178955078125,
-0.01238250732421875,
0.0138092041015625,
0.0167236328125,
-0.004268646240234375,
-0.0006680488586425781,
0.027587890625,
0.036376953125,
-0.0180511474609375,
0.004573822021484375,
0.0316162109375,
-0.018890380859375,
-0.04974365234375,
0.0701904296875,
-0.00823211669921875,
0.02471923828125,
-0.0141754150390625,
-0.004077911376953125,
0.0479736328125,
0.0087738037109375,
-0.054107666015625,
0.00905609130859375,
0.01047515869140625,
-0.0772705078125,
0.037384033203125,
0.0266571044921875,
0.04620361328125,
0.006656646728515625,
-0.0256805419921875,
-0.006366729736328125,
-0.037506103515625,
0.0076446533203125,
-0.030181884765625,
-0.0022678375244140625,
0.025360107421875,
-0.017333984375,
-0.008148193359375,
0.0125274658203125,
0.00229644775390625,
-0.0357666015625,
0.006969451904296875,
-0.023468017578125,
-0.009033203125,
0.00788116455078125,
-0.0433349609375,
0.01116943359375,
0.0419921875,
-0.025543212890625,
-0.01312255859375,
-0.001415252685546875,
0.0182952880859375,
-0.0308990478515625,
0.027008056640625,
-0.0400390625,
0.00018668174743652344,
-0.00017070770263671875,
-0.0226593017578125,
-0.004974365234375,
-0.0784912109375,
0.016357421875,
0.0305633544921875,
-0.01611328125,
-0.0189208984375,
0.01499176025390625,
0.018463134765625,
0.0021114349365234375,
-0.0116424560546875,
0.0291748046875,
-0.04254150390625,
0.022003173828125,
-0.0180511474609375,
-0.0083465576171875,
0.027191162109375,
0.04083251953125,
0.0207366943359375,
-0.014617919921875,
0.00042700767517089844,
-0.0295867919921875,
-0.0228118896484375,
0.0191192626953125,
0.0238494873046875,
-0.0217437744140625,
-0.060211181640625,
-0.054412841796875,
0.030303955078125,
-0.0210113525390625,
0.0062408447265625,
0.01290130615234375,
0.0203704833984375,
0.006641387939453125,
0.0014801025390625,
-0.007755279541015625,
-0.005565643310546875,
-0.013275146484375,
-0.038787841796875,
0.017791748046875,
0.0166778564453125,
-0.022308349609375,
0.02117919921875,
0.0439453125,
-0.0019121170043945312,
-0.025146484375,
-0.009521484375,
0.03155517578125,
0.003856658935546875,
-0.013702392578125,
0.0229644775390625,
0.006900787353515625,
-0.03240966796875,
-0.035888671875,
0.0103912353515625,
0.00675201416015625,
0.034210205078125,
0.008880615234375,
-0.017913818359375,
0.019195556640625,
-0.0037097930908203125,
-0.050994873046875,
-0.0188446044921875,
0.049072265625,
0.004611968994140625,
-0.0297698974609375,
0.0357666015625,
0.032928466796875,
0.0002865791320800781,
-0.070068359375,
-0.0228271484375,
0.0038166046142578125,
0.0035152435302734375,
0.0247344970703125,
-0.016510009765625,
-0.035858154296875,
-0.00739288330078125,
-0.02294921875,
-0.007373809814453125,
0.0288848876953125,
-0.018829345703125,
0.0245208740234375,
0.0263824462890625,
0.0797119140625,
0.005153656005859375,
-0.005886077880859375,
0.0022029876708984375,
0.02081298828125,
0.065185546875,
0.01421356201171875,
0.004673004150390625,
-0.00391387939453125,
-0.033660888671875,
0.10498046875,
-0.050201416015625,
-0.0643310546875,
0.0567626953125,
0.008514404296875,
0.11370849609375,
0.0303955078125,
0.035736083984375,
-0.0043182373046875,
0.0167388916015625,
0.01198577880859375,
-0.02667236328125,
0.02728271484375,
-0.03466796875,
0.0016231536865234375,
-0.036865234375,
0.0130462646484375,
0.031829833984375,
0.039337158203125,
-0.0267333984375,
0.031036376953125,
-0.0193328857421875,
-0.043670654296875,
0.01300048828125,
-0.0283355712890625,
0.02545166015625,
0.01522064208984375,
0.02069091796875,
-0.00021088123321533203,
-0.006954193115234375,
-0.0099639892578125,
-0.00460052490234375,
-0.0201263427734375,
-0.0062255859375,
-0.02777099609375,
0.05657958984375,
0.0063629150390625,
0.051605224609375,
0.031982421875,
-0.06512451171875,
0.02337646484375,
-0.005619049072265625,
0.0261077880859375,
-0.0250701904296875,
-0.0162200927734375,
-0.01486968994140625,
-0.007293701171875,
0.01294708251953125,
-0.025146484375,
0.033599853515625,
0.048248291015625,
0.018402099609375,
-0.04986572265625,
-0.0184173583984375,
-0.04119873046875,
-0.05950927734375,
-0.0142059326171875,
0.06524658203125,
0.031585693359375,
0.036102294921875,
0.017578125,
0.036407470703125,
0.0347900390625,
-0.0097503662109375,
0.039398193359375,
-0.00079345703125,
-0.047698974609375,
0.001491546630859375,
0.024444580078125,
0.03704833984375,
-0.007152557373046875,
-0.0224456787109375,
0.011383056640625,
0.00864410400390625,
-0.0096435546875,
-0.0284271240234375,
-0.0018148422241210938,
-0.0301361083984375,
0.032135009765625,
-0.05181884765625,
-0.058502197265625,
0.0034923553466796875,
0.0102996826171875,
-0.03125,
-0.004459381103515625,
-0.0237274169921875,
-0.0116119384765625,
-0.0009446144104003906,
0.0248870849609375,
-0.059356689453125,
0.00673675537109375,
-0.01580810546875,
-0.0134429931640625,
0.0014905929565429688,
-0.0006999969482421875,
0.0149688720703125,
-0.00009691715240478516,
-0.02978515625,
-0.009063720703125,
0.0106201171875,
-0.0177459716796875,
-0.00925445556640625,
0.03131103515625,
-0.04193115234375,
-0.00830841064453125,
-0.031890869140625,
-0.023468017578125,
-0.047515869140625,
-0.023651123046875,
0.054962158203125,
-0.0267486572265625,
0.052001953125,
0.0183563232421875,
-0.0203704833984375,
0.0011806488037109375,
-0.024658203125,
0.02447509765625,
-0.01873779296875,
0.0423583984375,
0.0811767578125,
-0.0103302001953125,
0.029327392578125,
0.0021877288818359375,
-0.004917144775390625,
-0.037261962890625,
0.052337646484375,
0.010711669921875,
-0.06878662109375,
0.0266876220703125,
0.024932861328125,
0.00835418701171875,
0.0276336669921875,
-0.00911712646484375,
-0.031219482421875,
-0.019073486328125,
0.019134521484375,
0.0031261444091796875,
0.00829315185546875,
0.0526123046875,
-0.047119140625,
0.0380859375,
-0.026214599609375,
-0.025146484375,
-0.040496826171875,
0.01021575927734375,
0.0005049705505371094,
-0.045196533203125,
0.0163421630859375,
0.0450439453125,
0.0007376670837402344,
0.005496978759765625,
0.00856781005859375,
0.028472900390625,
-0.0012063980102539062,
-0.01143646240234375,
0.0828857421875,
-0.00699615478515625,
-0.08544921875,
-0.03875732421875,
-0.022735595703125,
-0.01824951171875,
0.0044097900390625,
0.01611328125,
-0.002819061279296875,
0.0299530029296875,
-0.00115966796875,
-0.0258941650390625,
0.0318603515625,
-0.032196044921875,
-0.02392578125,
0.0138092041015625,
-0.051788330078125,
0.0212249755859375,
0.0120391845703125,
-0.032257080078125,
-0.005527496337890625,
0.04473876953125,
-0.044097900390625,
0.00243377685546875,
0.0021648406982421875,
-0.01959228515625,
-0.0192413330078125,
-0.01081085205078125,
-0.02239990234375,
-0.0034465789794921875,
0.01416778564453125,
0.039093017578125,
0.040740966796875,
0.0083160400390625,
0.056854248046875,
-0.0631103515625,
-0.0214385986328125,
0.005550384521484375,
-0.00984954833984375,
-0.005077362060546875,
-0.01288604736328125,
0.0245361328125,
-0.00653839111328125,
0.0176239013671875,
-0.0294342041015625,
0.048126220703125,
-0.056365966796875,
-0.040191650390625,
0.03515625,
-0.011749267578125,
0.0274505615234375,
-0.035858154296875,
-0.0169219970703125,
0.003803253173828125,
0.08380126953125,
-0.05914306640625,
-0.0259857177734375,
0.006679534912109375,
0.0276641845703125,
-0.0033359527587890625,
-0.0258331298828125,
0.004650115966796875,
-0.024871826171875,
-0.060546875,
0.01459503173828125,
-0.005680084228515625,
-0.017852783203125,
-0.00571441650390625,
0.0153350830078125,
-0.017669677734375,
-0.034332275390625,
0.0269622802734375,
-0.0167694091796875,
0.0269775390625,
0.0033130645751953125,
-0.0005116462707519531,
-0.006038665771484375,
-0.0012722015380859375,
-0.0176544189453125,
-0.08526611328125,
-0.01114654541015625,
-0.0689697265625,
0.05975341796875,
0.057373046875,
-0.02191162109375,
0.0019893646240234375,
0.036224365234375,
0.0168304443359375,
0.0102081298828125,
0.003021240234375,
-0.003993988037109375,
0.001708984375,
-0.03778076171875,
-0.0017566680908203125,
-0.0390625,
-0.0140228271484375,
-0.01922607421875,
0.003818511962890625,
0.006015777587890625,
-0.056304931640625,
-0.00016760826110839844,
-0.031402587890625,
-0.00850677490234375,
-0.09771728515625,
-0.0689697265625,
-0.0178985595703125,
-0.0020427703857421875,
-0.0260009765625,
0.0205841064453125,
-0.054412841796875,
-0.06927490234375,
0.02410888671875,
-0.03399658203125,
0.028900146484375,
0.005794525146484375,
0.07080078125,
0.0108489990234375,
-0.00023937225341796875,
-0.00606536865234375,
0.006572723388671875,
0.0140533447265625,
-0.01287078857421875,
0.015716552734375,
0.0046539306640625,
0.0041656494140625,
-0.0024433135986328125,
-0.028228759765625,
0.01296234130859375,
-0.04107666015625,
0.05157470703125,
0.01108551025390625,
0.01342010498046875,
-0.00986480712890625,
0.004665374755859375,
0.014251708984375,
0.0139007568359375,
-0.004878997802734375,
-0.03375244140625,
0.006122589111328125,
0.05072021484375,
-0.00797271728515625,
0.0194244384765625,
-0.02935791015625,
-0.019744873046875,
0.002429962158203125,
-0.0819091796875,
0.0118255615234375,
0.01528167724609375,
0.007610321044921875,
0.0000978708267211914,
0.0112457275390625,
-0.005889892578125,
-0.00907135009765625,
-0.0303802490234375,
-0.0008716583251953125,
0.029693603515625,
-0.025360107421875,
0.0032711029052734375,
0.005702972412109375,
-0.004993438720703125,
0.049774169921875,
-0.021575927734375,
-0.049468994140625,
-0.035552978515625,
-0.0071258544921875,
0.049407958984375,
0.04559326171875,
0.031463623046875,
0.061767578125,
0.0090484619140625,
-0.01274871826171875,
-0.0032444000244140625,
-0.0036220550537109375,
0.00665283203125,
-0.054107666015625,
-0.0196685791015625,
-0.00606536865234375,
0.004276275634765625,
-0.01300811767578125,
0.07208251953125,
0.0096435546875,
0.03704833984375,
-0.0283966064453125,
0.0770263671875,
0.0950927734375,
-0.028167724609375,
0.0021533966064453125,
0.06201171875,
-0.05401611328125,
0.00859832763671875,
-0.018280029296875,
-0.0147552490234375,
0.0178070068359375,
0.0223846435546875,
0.054931640625,
0.043365478515625,
-0.0048980712890625,
-0.031341552734375,
-0.046966552734375,
-0.0379638671875,
0.036224365234375,
0.0312347412109375,
-0.041717529296875,
-0.040313720703125,
-0.0051422119140625,
0.002044677734375,
0.00861358642578125,
-0.0141754150390625,
0.0270538330078125,
-0.0023021697998046875,
0.03314208984375,
0.011505126953125,
0.0035858154296875,
-0.00304412841796875,
-0.0129547119140625,
-0.0311126708984375,
0.005168914794921875,
0.025543212890625,
-0.00804901123046875,
-0.0166015625,
-0.0174560546875,
-0.031280517578125,
0.04180908203125,
-0.00449371337890625,
0.00418853759765625,
-0.03497314453125,
0.011810302734375,
-0.06732177734375,
0.0142059326171875,
0.0128936767578125,
0.007640838623046875,
0.0203399658203125,
-0.019744873046875,
-0.01287841796875,
-0.040435791015625,
0.0041351318359375,
0.0097503662109375,
-0.006069183349609375,
-0.0052490234375,
0.005992889404296875,
0.0251312255859375,
0.0028095245361328125,
-0.011932373046875,
-0.0186309814453125,
0.0112457275390625,
0.01158905029296875,
0.054351806640625,
-0.046844482421875,
0.0546875,
0.00844573974609375,
0.040130615234375,
-0.01166534423828125,
0.024078369140625,
0.022735595703125,
-0.006282806396484375,
0.0027523040771484375,
-0.04266357421875,
-0.01119232177734375,
0.00873565673828125,
-0.024169921875,
0.026641845703125,
0.0341796875,
-0.0028820037841796875,
0.01471710205078125,
0.014984130859375,
0.0066986083984375,
-0.0179290771484375,
-0.02569580078125,
0.01922607421875,
0.00983428955078125,
0.01255035400390625,
-0.04827880859375,
-0.033050537109375,
0.01788330078125,
-0.007198333740234375,
0.04351806640625,
-0.034820556640625,
0.014434814453125,
0.03155517578125,
-0.056732177734375,
0.056671142578125,
0.05426025390625,
-0.0011205673217773438,
0.036102294921875,
0.0149078369140625,
0.01094818115234375,
0.0270233154296875,
0.0322265625,
-0.035125732421875,
-0.020721435546875,
0.042327880859375,
-0.0014972686767578125,
-0.051239013671875,
0.0092620849609375,
-0.0182342529296875,
0.0181884765625,
0.0556640625,
0.07000732421875,
-0.07757568359375,
0.01117706298828125,
-0.000659942626953125,
-0.004634857177734375,
0.042388916015625,
-0.0169830322265625,
0.0161590576171875,
0.01003265380859375,
0.019378662109375,
0.00945281982421875,
-0.0257110595703125,
0.0089569091796875,
-0.0149688720703125,
-0.0079498291015625,
-0.004886627197265625,
-0.0279998779296875,
-0.0293426513671875,
0.04541015625,
-0.02154541015625,
-0.033905029296875,
0.0265350341796875,
-0.0136566162109375,
-0.006023406982421875,
-0.00666046142578125,
-0.0389404296875,
-0.049560546875,
-0.0306854248046875,
-0.0213775634765625,
-0.020751953125,
0.01241302490234375,
-0.02569580078125,
0.07666015625,
0.00998687744140625,
0.01418304443359375,
-0.04052734375,
-0.02398681640625,
0.01245880126953125,
-0.0322265625,
-0.004573822021484375,
-0.021270751953125,
-0.01480865478515625,
0.0299072265625,
0.00732421875,
-0.0250396728515625,
-0.0188751220703125,
0.01026153564453125,
0.00272369384765625,
0.035308837890625,
-0.038726806640625,
-0.0188140869140625,
0.043365478515625,
-0.04449462890625,
-0.01242828369140625,
0.02288818359375,
0.01372528076171875,
-0.0235137939453125,
-0.0239715576171875,
0.0261688232421875,
-0.06121826171875,
-0.0181121826171875,
0.0294647216796875,
-0.04425048828125,
0.09991455078125,
-0.00868988037109375,
-0.017608642578125,
-0.0286712646484375,
0.0618896484375,
-0.0135498046875,
0.0469970703125,
-0.0535888671875,
0.06610107421875,
0.0089111328125,
0.05645751953125,
-0.07080078125,
-0.0156097412109375,
0.0273590087890625,
0.0229339599609375,
0.01438140869140625,
0.0233001708984375,
-0.016204833984375,
-0.023895263671875,
0.002002716064453125,
0.00010246038436889648,
-0.0166473388671875,
0.033599853515625,
-0.028289794921875,
-0.022369384765625,
0.023101806640625,
0.019561767578125,
0.022613525390625,
0.0386962890625,
-0.055023193359375,
0.005168914794921875,
-0.007305145263671875,
-0.01203155517578125,
-0.0292510986328125,
0.0889892578125,
-0.019134521484375,
-0.0218505859375,
0.00954437255859375,
-0.0017099380493164062,
-0.03564453125,
0.031219482421875,
0.0008959770202636719,
-0.040313720703125,
-0.0224456787109375,
-0.0360107421875,
0.031768798828125,
0.0131683349609375,
-0.0120849609375,
0.01885986328125,
-0.0030269622802734375,
0.005031585693359375,
0.040863037109375,
-0.001941680908203125,
0.036834716796875,
0.0114593505859375,
0.07305908203125,
0.04815673828125,
0.02703857421875,
-0.00791168212890625,
0.0194091796875,
0.050567626953125,
0.0869140625,
-0.05712890625,
-0.043121337890625,
-0.0092620849609375,
0.01654052734375,
0.030303955078125,
0.004360198974609375,
0.00984954833984375,
0.02044677734375,
0.045501708984375,
-0.0197296142578125,
-0.00800323486328125,
0.004611968994140625,
0.019195556640625,
0.0030384063720703125,
0.047027587890625,
-0.0218963623046875,
-0.0240478515625,
-0.034088134765625,
0.0028400421142578125,
-0.00717926025390625,
0.0211639404296875,
0.0210113525390625,
0.023345947265625,
0.02545166015625,
0.004398345947265625,
0.0027332305908203125,
-0.031494140625,
-0.01317596435546875,
-0.0127410888671875,
-0.042236328125,
-0.039031982421875,
0.007320404052734375,
0.055633544921875,
-0.0193023681640625,
0.035247802734375,
0.027008056640625,
0.035675048828125,
-0.021148681640625,
-0.01629638671875,
0.053802490234375,
-0.0259246826171875,
-0.00000852346420288086,
-0.02508544921875,
-0.0236968994140625,
-0.0112457275390625,
-0.016265869140625,
-0.01149749755859375,
0.0016613006591796875,
0.0297393798828125,
-0.02587890625,
0.04864501953125,
-0.00933837890625,
-0.0186920166015625,
0.0002567768096923828,
-0.00395965576171875,
0.050018310546875,
0.0062255859375,
-0.039093017578125,
-0.005657196044921875,
-0.0183258056640625,
-0.0413818359375,
0.001926422119140625,
0.0300750732421875,
-0.036865234375,
0.035614013671875,
0.004852294921875,
-0.0180511474609375,
0.03192138671875,
0.00878143310546875,
0.0032939910888671875,
0.047698974609375,
0.028167724609375,
0.01279449462890625,
-0.0114593505859375,
0.003787994384765625,
0.029510498046875,
0.0198974609375,
-0.0163116455078125,
0.0538330078125,
-0.0274200439453125,
0.005321502685546875,
-0.0289459228515625,
0.0005254745483398438,
-0.010223388671875,
-0.00910186767578125,
0.0328369140625,
0.0438232421875,
-0.01491546630859375,
-0.0232086181640625,
0.011871337890625,
0.0216522216796875,
0.0247344970703125,
-0.0609130859375,
-0.0211029052734375,
0.013641357421875,
0.0084228515625,
-0.005626678466796875,
0.0513916015625,
-0.0249786376953125,
-0.03533935546875,
-0.048919677734375,
-0.022369384765625,
0.0236053466796875,
0.02996826171875,
-0.0015707015991210938,
-0.0020046234130859375,
-0.03515625,
0.0006165504455566406,
-0.031005859375,
0.049713134765625,
-0.06121826171875,
0.0146331787109375,
-0.03302001953125,
0.045562744140625,
0.0306854248046875,
-0.01096343994140625,
0.0265960693359375,
0.035308837890625,
-0.04962158203125,
0.058563232421875,
-0.0330810546875,
0.001926422119140625,
0.00008827447891235352,
0.063232421875,
0.029876708984375,
0.014068603515625,
-0.0199127197265625,
-0.0007786750793457031,
-0.022491455078125,
-0.028564453125,
-0.02587890625,
-0.01934814453125,
-0.0035419464111328125,
0.0202178955078125,
-0.012542724609375,
-0.019744873046875,
-0.061920166015625,
0.0013418197631835938,
0.00316619873046875,
0.0152587890625,
-0.07672119140625,
0.059051513671875,
0.0013303756713867188,
0.0253143310546875,
-0.043548583984375,
-0.01367950439453125,
-0.0008482933044433594,
-0.0183868408203125,
-0.05230712890625,
-0.01346588134765625,
-0.038848876953125,
-0.0005173683166503906,
-0.020721435546875,
-0.0228729248046875,
0.01136016845703125,
-0.0016469955444335938,
-0.059722900390625,
-0.0201568603515625,
-0.0093536376953125,
0.013153076171875,
0.022918701171875,
-0.022216796875,
0.01519012451171875,
-0.006542205810546875,
-0.0113677978515625,
-0.02423095703125,
0.0014123916625976562,
-0.03424072265625,
-0.006866455078125,
-0.0030117034912109375,
-0.01132965087890625,
0.02667236328125,
-0.05255126953125,
-0.1263427734375,
0.054107666015625,
-0.0242462158203125,
-0.056182861328125,
-0.05426025390625,
0.0254364013671875,
0.0214080810546875,
-0.044403076171875,
-0.0308990478515625,
-0.004482269287109375,
-0.0465087890625,
0.006931304931640625,
0.0206756591796875,
-0.016937255859375,
0.02301025390625,
0.0212249755859375,
-0.06781005859375,
0.0173492431640625,
0.014434814453125,
-0.002048492431640625,
0.0288848876953125,
-0.019744873046875,
0.049285888671875,
0.0533447265625,
-0.0209197998046875,
0.01003265380859375,
-0.0140533447265625,
-0.058074951171875,
-0.0103302001953125,
-0.030517578125,
-0.038787841796875,
-0.0217437744140625,
0.072021484375,
0.052825927734375,
0.0168609619140625,
-0.0221405029296875,
0.0095367431640625,
-0.0015077590942382812,
-0.005809783935546875,
0.0181427001953125,
-0.0015535354614257812,
-0.004962921142578125,
0.007640838623046875,
0.008270263671875,
-0.03289794921875,
-0.032867431640625,
0.02227783203125,
-0.061614990234375,
0.01358795166015625,
0.03973388671875,
0.0186767578125,
-0.05902099609375,
-0.01375579833984375,
0.06072998046875,
-0.052337646484375,
-0.055450439453125,
0.0298614501953125,
0.0061798095703125,
-0.01172637939453125,
-0.00704193115234375,
-0.0159912109375,
-0.030548095703125,
-0.0157318115234375,
0.041412353515625,
-0.0180206298828125,
0.0404052734375,
-0.049224853515625,
-0.01047515869140625,
-0.006420135498046875,
0.0230560302734375,
-0.01055145263671875,
0.03936767578125,
0.0074462890625,
0.033050537109375,
-0.004608154296875,
0.055633544921875,
-0.03143310546875,
0.0184783935546875,
-0.02203369140625,
0.0212554931640625,
0.024261474609375,
-0.0044403076171875,
0.08172607421875,
-0.0215301513671875,
0.010101318359375,
0.0249176025390625,
0.0277252197265625,
-0.01629638671875,
0.03887939453125,
0.0609130859375,
0.0018758773803710938,
0.0143585205078125
] |
d36f63cb5870c74fd4b0f4e5f52b3004dfe7272e
|
Wordpress Stackexchange
Q: Get number of widgets in sidebar How can I get the number of widgets that are active on a specific sidebar? Is there a core function for this?
I want to add a class to each widget on a sidebar based on how many of them are displayed.
Thanks.
A: After some research and based on the answer from Eugene Manuilov I made a function that adds custom classes to widgets in a specific sidebar ('sidebar-bottom' in my case) based on the number of widgets set in that sidebar. This will suit perfectly in horizontal sidebars and themes based on twitter bootstrap that need spanX class to adjust the element's width.
function cosmos_bottom_sidebar_params($params) {
$sidebar_id = $params[0]['id'];
if ( $sidebar_id == 'sidebar-bottom' ) {
$total_widgets = wp_get_sidebars_widgets();
$sidebar_widgets = count($total_widgets[$sidebar_id]);
$params[0]['before_widget'] = str_replace('class="', 'class="span' . floor(12 / $sidebar_widgets) . ' ', $params[0]['before_widget']);
}
return $params;
}
add_filter('dynamic_sidebar_params','cosmos_bottom_sidebar_params');
|
Q: Get number of widgets in sidebar How can I get the number of widgets that are active on a specific sidebar? Is there a core function for this?
I want to add a class to each widget on a sidebar based on how many of them are displayed.
Thanks.
A: After some research and based on the answer from Eugene Manuilov I made a function that adds custom classes to widgets in a specific sidebar ('sidebar-bottom' in my case) based on the number of widgets set in that sidebar. This will suit perfectly in horizontal sidebars and themes based on twitter bootstrap that need spanX class to adjust the element's width.
function cosmos_bottom_sidebar_params($params) {
$sidebar_id = $params[0]['id'];
if ( $sidebar_id == 'sidebar-bottom' ) {
$total_widgets = wp_get_sidebars_widgets();
$sidebar_widgets = count($total_widgets[$sidebar_id]);
$params[0]['before_widget'] = str_replace('class="', 'class="span' . floor(12 / $sidebar_widgets) . ' ', $params[0]['before_widget']);
}
return $params;
}
add_filter('dynamic_sidebar_params','cosmos_bottom_sidebar_params');
A: Also, if you're looking to do things to the first and last widget, you can use the code below. I took nautilus7's code and combined it with MathSmath + durin's code over at http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets to target a specific sidebar, add span classes based on the number of widgets in the sidebar, and then add a custom class to the first and last widget of the groups.
function cur_target_sidebar_add_classes_to_params($params) {
global $my_widget_num; // Global a counter array
$sidebar_id = $params[0]['id'];
if ( $sidebar_id == 'sidebar' ) {
$registered_widgets = wp_get_sidebars_widgets();
if(!isset($registered_widgets[$sidebar_id]) || !is_array($registered_widgets[$sidebar_id])) { // Check if the current sidebar has no widgets
return $params; // No widgets in this sidebar... bail early.
}
$number_of_widgets = count($registered_widgets[$sidebar_id]);
$rounded_number_of_widgets = floor(12 / $number_of_widgets); //Rounds number of widgets down to a whole number
if(!$my_widget_num) {// If the counter array doesn't exist, create it
$my_widget_num = array();
}
if(isset($my_widget_num[$sidebar_id])) { // See if the counter array has an entry for this sidebar
$my_widget_num[$sidebar_id] ++;
} else { // If not, create it starting with 1
$my_widget_num[$sidebar_id] = 1;
}
$classes = 'span' . $rounded_number_of_widgets;
if($my_widget_num[$sidebar_id] == 1) { // If this is the first widget
$classes .= ' first-widget ';
} elseif($my_widget_num[$sidebar_id] == count($registered_widgets[$sidebar_id])) { // If this is the last widget
$classes .= ' last-widget ';
}
$params[0]['before_widget'] = preg_replace('/class=\"/', 'class="' . $classes . ' ', $params[0]['before_widget'], 1);
}
return $params;
}
add_filter('dynamic_sidebar_params','cur_target_sidebar_add_classes_to_params');
A: function wpse_54162_get_widgets_count( $sidebar_index ) {
global $wp_registered_sidebars;
$index = "sidebar-{$sidebar_index}";
$sidebars_widgets = wp_get_sidebars_widgets();
if ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) )
return 0;
return count( (array) $sidebars_widgets[$index] );
}
A: Lets try with below code
function sidebar_widget_init()
{
global $_wp_sidebars_widgets;
if ( empty( $_wp_sidebars_widgets ) ) :
$_wp_sidebars_widgets = get_option( 'sidebars_widgets', array() );
endif;
$sidebars_widgets_count = $_wp_sidebars_widgets;
$sidebar_count = count( $sidebars_widgets_count[ 'sidebar3' ] );
if($sidebar_count == 2){
$sidebar_class = 'class_name1';
} elseif($sidebar_count == 3){
$sidebar_class = 'class_name2';
} elseif($sidebar_count == 4){
$sidebar_class = 'class_name3';
}
register_sidebar(array( 'name' => __( 'Sidebar Footer', 'templatemesh' ),
'id' => 'sidebar3',
'description' => __( 'Widgets in this area will be shown on footer Sidebar.', 'templatemesh' ),
'before_title' => '<h3 class="widget_title">',
'after_title' => '</h3>',
'before_widget' => '<div class="'.$sidebar_class.'"><div id="%1$s" class="widget %2$s" >',
'after_widget' => '</div></div>'
)
);
}
add_action('widgets_init','sidebar_widget_init');
|
wordpress
|
{
"language": "en",
"length": 516,
"provenance": "stackexchange_00019.jsonl.gz:420533",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54162"
}
|
[
0.035430908203125,
0.0155181884765625,
0.004673004150390625,
-0.054290771484375,
0.03424072265625,
-0.0208587646484375,
0.03570556640625,
-0.01284027099609375,
0.01351165771484375,
0.00887298583984375,
-0.016845703125,
-0.0215301513671875,
-0.04461669921875,
-0.0225982666015625,
-0.0293121337890625,
-0.044525146484375,
0.0361328125,
0.027374267578125,
0.044891357421875,
0.0023822784423828125,
-0.019134521484375,
0.038543701171875,
0.00536346435546875,
0.07708740234375,
-0.0035400390625,
-0.01824951171875,
0.0675048828125,
-0.044830322265625,
-0.0032215118408203125,
-0.03936767578125,
0.01245880126953125,
0.0218505859375,
0.0260772705078125,
-0.03155517578125,
0.0704345703125,
0.053863525390625,
-0.00876617431640625,
-0.006526947021484375,
0.0484619140625,
-0.038787841796875,
0.040252685546875,
-0.044036865234375,
0.0233154296875,
-0.034942626953125,
0.0011692047119140625,
0.036956787109375,
0.01343536376953125,
-0.017791748046875,
0.041015625,
-0.024017333984375,
0.02386474609375,
-0.0013494491577148438,
0.035369873046875,
-0.054779052734375,
-0.0277862548828125,
0.0197906494140625,
-0.0006732940673828125,
-0.021453857421875,
0.045318603515625,
-0.01435089111328125,
-0.0282440185546875,
-0.0333251953125,
0.03924560546875,
-0.00634002685546875,
-0.039031982421875,
-0.00531005859375,
-0.005588531494140625,
0.006183624267578125,
-0.006435394287109375,
-0.051483154296875,
0.01248931884765625,
-0.004241943359375,
-0.024322509765625,
-0.003543853759765625,
-0.02288818359375,
-0.020721435546875,
0.0025806427001953125,
-0.0290985107421875,
-0.00487518310546875,
0.0285797119140625,
0.03411865234375,
0.0231781005859375,
-0.0272979736328125,
-0.0007753372192382812,
0.01371002197265625,
0.02178955078125,
-0.0186309814453125,
-0.02838134765625,
-0.0205078125,
0.006099700927734375,
-0.00919342041015625,
-0.064453125,
0.038848876953125,
-0.0118408203125,
0.021636962890625,
-0.0654296875,
-0.0167694091796875,
0.050933837890625,
-0.028594970703125,
0.020843505859375,
-0.01617431640625,
-0.00951385498046875,
0.0211334228515625,
-0.07171630859375,
0.03021240234375,
0.03729248046875,
-0.027191162109375,
0.0640869140625,
0.085205078125,
0.037384033203125,
0.03350830078125,
0.0030231475830078125,
-0.006275177001953125,
-0.0125732421875,
-0.0357666015625,
-0.00418853759765625,
-0.0309600830078125,
-0.018951416015625,
0.0009584426879882812,
-0.0227203369140625,
0.003021240234375,
0.0158233642578125,
0.0198211669921875,
-0.0119171142578125,
0.0248260498046875,
0.0065460205078125,
-0.014617919921875,
-0.0279541015625,
0.0254364013671875,
-0.00775909423828125,
-0.0302276611328125,
0.0241851806640625,
0.035247802734375,
0.0088043212890625,
0.006237030029296875,
0.0016956329345703125,
0.05218505859375,
-0.0235137939453125,
-0.0249786376953125,
0.040679931640625,
0.00360107421875,
-0.059234619140625,
-0.05706787109375,
-0.0223541259765625,
0.038116455078125,
-0.0018453598022460938,
0.03875732421875,
-0.00447845458984375,
-0.018310546875,
-0.0102691650390625,
0.00998687744140625,
0.0036163330078125,
0.043914794921875,
0.0264739990234375,
-0.07891845703125,
0.03741455078125,
-0.0140533447265625,
0.0111541748046875,
-0.0704345703125,
-0.03887939453125,
-0.0197296142578125,
-0.0178070068359375,
-0.0214691162109375,
-0.03643798828125,
-0.0171661376953125,
0.00830078125,
0.030029296875,
0.018707275390625,
0.0228729248046875,
0.022186279296875,
-0.01552581787109375,
-0.0213623046875,
0.037139892578125,
0.043304443359375,
0.0003762245178222656,
0.058563232421875,
0.00847625732421875,
0.019195556640625,
0.028961181640625,
-0.0379638671875,
-0.0504150390625,
-0.037933349609375,
0.10308837890625,
-0.03656005859375,
-0.0206146240234375,
-0.0230255126953125,
0.0169525146484375,
0.01517486572265625,
0.0186614990234375,
0.01062774658203125,
0.0187225341796875,
-0.0122833251953125,
-0.06939697265625,
-0.02423095703125,
-0.00826263427734375,
-0.0007753372192382812,
0.004070281982421875,
-0.0198974609375,
0.005218505859375,
0.0523681640625,
0.021209716796875,
-0.0010471343994140625,
0.0028839111328125,
-0.01287078857421875,
-0.037811279296875,
0.0134429931640625,
-0.00775909423828125,
0.0303955078125,
-0.0295562744140625,
0.052703857421875,
0.0244293212890625,
0.02191162109375,
-0.034149169921875,
0.022430419921875,
0.006328582763671875,
-0.05303955078125,
0.0098419189453125,
0.0501708984375,
-0.01151275634765625,
0.0120086669921875,
-0.0188751220703125,
-0.0372314453125,
-0.0007987022399902344,
0.037200927734375,
0.07598876953125,
-0.0212554931640625,
0.006591796875,
-0.037445068359375,
0.0653076171875,
0.0079193115234375,
-0.0567626953125,
0.0228118896484375,
0.00832366943359375,
-0.0024356842041015625,
-0.05230712890625,
0.0034503936767578125,
-0.014678955078125,
0.0191802978515625,
-0.004741668701171875,
0.0176239013671875,
0.04913330078125,
0.00882720947265625,
-0.0020351409912109375,
-0.01335906982421875,
0.0283966064453125,
-0.04327392578125,
0.00911712646484375,
-0.0364990234375,
-0.020416259765625,
0.0273284912109375,
-0.02520751953125,
0.0134735107421875,
0.01129150390625,
-0.0236053466796875,
-0.00038886070251464844,
0.0301666259765625,
-0.01000213623046875,
0.005218505859375,
-0.037322998046875,
0.01465606689453125,
0.01511383056640625,
-0.0291290283203125,
-0.035736083984375,
-0.007694244384765625,
0.033966064453125,
0.0021457672119140625,
0.04608154296875,
0.0273895263671875,
0.0034637451171875,
-0.009613037109375,
0.00799560546875,
-0.0321044921875,
-0.00799560546875,
-0.0235748291015625,
0.0025997161865234375,
-0.029052734375,
-0.0296783447265625,
0.0192413330078125,
-0.005947113037109375,
-0.042816162109375,
0.0080413818359375,
0.054351806640625,
-0.00959014892578125,
-0.0084991455078125,
-0.040191650390625,
-0.0460205078125,
0.01806640625,
0.055908203125,
0.04888916015625,
0.00588226318359375,
0.0155792236328125,
0.0170440673828125,
-0.00010842084884643555,
0.039337158203125,
0.047393798828125,
-0.036834716796875,
0.02532958984375,
-0.0222625732421875,
0.01137542724609375,
-0.018310546875,
0.03814697265625,
0.03912353515625,
-0.0029430389404296875,
-0.0263824462890625,
0.0003616809844970703,
0.049713134765625,
-0.006679534912109375,
0.002597808837890625,
0.00064849853515625,
-0.01534271240234375,
-0.005344390869140625,
0.0234527587890625,
0.01277923583984375,
0.036163330078125,
0.007656097412109375,
-0.0207672119140625,
-0.0012760162353515625,
0.0026912689208984375,
-0.0213775634765625,
-0.02178955078125,
0.06903076171875,
-0.03973388671875,
-0.04620361328125,
-0.0070953369140625,
-0.06903076171875,
-0.0005121231079101562,
0.00809478759765625,
-0.0162506103515625,
-0.038787841796875,
-0.002109527587890625,
-0.03228759765625,
-0.0255279541015625,
-0.0369873046875,
0.04412841796875,
-0.01153564453125,
0.020416259765625,
-0.00122833251953125,
0.04022216796875,
-0.0256195068359375,
-0.032135009765625,
-0.0194244384765625,
-0.01110076904296875,
-0.01293182373046875,
-0.025665283203125,
0.002227783203125,
-0.05572509765625,
-0.01148223876953125,
-0.03265380859375,
0.0596923828125,
0.0259552001953125,
-0.0174560546875,
0.0556640625,
0.0185394287109375,
0.00315093994140625,
0.0208282470703125,
-0.0030059814453125,
-0.0009741783142089844,
0.0218353271484375,
0.0232391357421875,
-0.019195556640625,
-0.027618408203125,
0.00478363037109375,
-0.0290069580078125,
-0.016845703125,
0.0219879150390625,
-0.0266876220703125,
-0.01010894775390625,
0.00897216796875,
-0.00499725341796875,
-0.0078582763671875,
0.0177154541015625,
-0.03509521484375,
0.037841796875,
-0.0025806427001953125,
0.0201568603515625,
-0.0181427001953125,
-0.043792724609375,
-0.056671142578125,
0.0238800048828125,
-0.0222320556640625,
-0.01303863525390625,
-0.0115814208984375,
0.0477294921875,
0.004169464111328125,
0.015869140625,
0.040771484375,
0.0302276611328125,
0.029541015625,
-0.000008881092071533203,
-0.035430908203125,
-0.0207366943359375,
0.048370361328125,
-0.0313720703125,
-0.0156097412109375,
0.0030918121337890625,
0.00916290283203125,
-0.038818359375,
-0.0163421630859375,
-0.03143310546875,
0.004573822021484375,
-0.1082763671875,
0.0034122467041015625,
-0.01523590087890625,
-0.040374755859375,
-0.0046234130859375,
-0.0230712890625,
-0.05682373046875,
-0.0479736328125,
0.0472412109375,
-0.0667724609375,
0.01558685302734375,
-0.017578125,
-0.010467529296875,
-0.04791259765625,
-0.0260009765625,
-0.0216522216796875,
-0.03802490234375,
-0.005802154541015625,
-0.0307464599609375,
0.05560302734375,
0.022308349609375,
-0.01476287841796875,
0.003108978271484375,
0.04437255859375,
0.0142669677734375,
-0.0252227783203125,
0.052490234375,
0.02777099609375,
0.002971649169921875,
-0.005214691162109375,
0.037750244140625,
-0.04071044921875,
-0.01654052734375,
0.005367279052734375,
-0.0263214111328125,
0.018310546875,
-0.041839599609375,
-0.035858154296875,
0.005786895751953125,
-0.036590576171875,
-0.0193939208984375,
-0.039215087890625,
-0.011199951171875,
0.0174560546875,
-0.038818359375,
0.036895751953125,
-0.03839111328125,
-0.0211944580078125,
0.0032825469970703125,
-0.0201416015625,
-0.0078887939453125,
0.0234222412109375,
0.063720703125,
0.0214691162109375,
-0.01238250732421875,
-0.0250244140625,
-0.03790283203125,
0.0191802978515625,
0.029388427734375,
-0.0029926300048828125,
0.00962066650390625,
-0.0274200439453125,
0.016326904296875,
0.0096435546875,
-0.0213165283203125,
0.0306854248046875,
0.04168701171875,
0.0185546875,
0.004364013671875,
-0.01525115966796875,
0.0147247314453125,
-0.038818359375,
0.006168365478515625,
-0.0362548828125,
0.016204833984375,
0.0236053466796875,
0.0264739990234375,
-0.031402587890625,
0.0018825531005859375,
-0.01107025146484375,
0.00522613525390625,
0.00244140625,
-0.03411865234375,
0.045989990234375,
0.01517486572265625,
0.01470947265625,
-0.01320648193359375,
0.01080322265625,
0.025390625,
0.04473876953125,
0.0137939453125,
-0.01030731201171875,
0.03326416015625,
0.0293426513671875,
0.0028972625732421875,
0.04498291015625,
-0.001628875732421875,
0.03717041015625,
0.0094757080078125,
-0.029754638671875,
-0.0007944107055664062,
0.000051081180572509766,
-0.0144805908203125,
0.01334381103515625,
0.0276031494140625,
0.0430908203125,
0.00679779052734375,
-0.046142578125,
-0.040191650390625,
-0.00605010986328125,
0.00197601318359375,
-0.055877685546875,
0.00518798828125,
-0.002017974853515625,
-0.0108642578125,
0.0007081031799316406,
0.0125579833984375,
0.0016088485717773438,
0.00250244140625,
-0.008697509765625,
0.0114898681640625,
0.00391387939453125,
0.008941650390625,
0.02264404296875,
-0.0018091201782226562,
0.0212554931640625,
-0.0230865478515625,
0.0250244140625,
-0.0278167724609375,
-0.01482391357421875,
0.025115966796875,
0.0321044921875,
0.0008344650268554688,
-0.00344085693359375,
0.004222869873046875,
0.00849151611328125,
-0.028656005859375,
0.040374755859375,
0.041351318359375,
0.02215576171875,
-0.04193115234375,
-0.0224609375,
0.048614501953125,
0.02923583984375,
0.00037932395935058594,
-0.03167724609375,
-0.032958984375,
0.0007634162902832031,
0.0005702972412109375,
-0.007144927978515625,
-0.00603485107421875,
-0.022308349609375,
-0.058074951171875,
-0.005462646484375,
0.00203704833984375,
-0.10369873046875,
-0.056549072265625,
0.022064208984375,
-0.0151214599609375,
-0.0008692741394042969,
-0.025115966796875,
0.0355224609375,
-0.0099029541015625,
-0.01026153564453125,
-0.0189361572265625,
0.026580810546875,
-0.01763916015625,
-0.00753021240234375,
0.01441192626953125,
-0.00865936279296875,
-0.0310211181640625,
-0.03424072265625,
-0.022857666015625,
-0.03521728515625,
-0.0169525146484375,
-0.0229644775390625,
0.0081939697265625,
0.03314208984375,
-0.00016379356384277344,
-0.0161895751953125,
-0.012908935546875,
-0.017730712890625,
0.00666046142578125,
0.02410888671875,
-0.033782958984375,
0.043731689453125,
0.0031032562255859375,
0.01532745361328125,
-0.00833892822265625,
-0.00934600830078125,
-0.02044677734375,
0.00417327880859375,
0.0063323974609375,
-0.016693115234375,
-0.01023101806640625,
-0.0012235641479492188,
-0.023651123046875,
-0.0523681640625,
0.01255035400390625,
-0.016571044921875,
0.057708740234375,
-0.0176544189453125,
-0.003490447998046875,
0.01006317138671875,
-0.00919342041015625,
0.0115966796875,
0.030426025390625,
0.08172607421875,
-0.024658203125,
-0.0261993408203125,
-0.01296234130859375,
-0.01953125,
0.041107177734375,
-0.004543304443359375,
0.0123138427734375,
0.0139923095703125,
-0.08563232421875,
0.0816650390625,
0.053863525390625,
0.0294647216796875,
0.051513671875,
-0.01531219482421875,
0.034088134765625,
0.01468658447265625,
-0.0191192626953125,
0.02581787109375,
0.033721923828125,
0.0531005859375,
-0.014862060546875,
-0.006633758544921875,
0.0167236328125,
-0.0274505615234375,
-0.00229644775390625,
-0.0266876220703125,
0.00540924072265625,
0.007732391357421875,
0.007472991943359375,
-0.01117706298828125,
-0.0283660888671875,
0.0231170654296875,
0.027130126953125,
-0.026885986328125,
-0.043701171875,
0.0660400390625,
-0.011871337890625,
0.005626678466796875,
0.0523681640625,
0.006389617919921875,
0.00394439697265625,
-0.0172271728515625,
-0.01275634765625,
-0.01255035400390625,
0.04498291015625,
-0.02197265625,
-0.038177490234375,
0.0185546875,
-0.0019044876098632812,
-0.03399658203125,
0.034820556640625,
-0.0404052734375,
-0.0716552734375,
-0.0031185150146484375,
-0.07904052734375,
0.0005655288696289062,
0.03448486328125,
-0.023956298828125,
0.052520751953125,
0.01331329345703125,
0.00748443603515625,
-0.01197052001953125,
-0.013946533203125,
-0.0038776397705078125,
-0.0301361083984375,
-0.0218353271484375,
0.01352691650390625,
-0.00865936279296875,
-0.0298309326171875,
0.0299072265625,
-0.02178955078125,
-0.058380126953125,
-0.03167724609375,
-0.0142364501953125,
0.09149169921875,
-0.03656005859375,
-0.007434844970703125,
0.038970947265625,
0.052032470703125,
-0.03350830078125,
-0.02276611328125,
0.05181884765625,
-0.09698486328125,
-0.0633544921875,
0.0201416015625,
-0.036376953125,
-0.030914306640625,
-0.0193634033203125,
0.0004611015319824219,
0.08270263671875,
-0.01116943359375,
-0.03656005859375,
0.033905029296875,
0.047088623046875,
-0.03564453125,
0.033172607421875,
-0.017822265625,
0.003955841064453125,
-0.0352783203125,
0.0001043081283569336,
-0.01119232177734375,
0.0182647705078125,
-0.01169586181640625,
0.004638671875,
0.0173797607421875,
-0.00007474422454833984,
0.0207366943359375,
-0.00830841064453125,
0.015655517578125,
0.05169677734375,
0.00238800048828125,
-0.00943756103515625,
0.0229034423828125,
0.003200531005859375,
-0.0201263427734375,
0.010345458984375,
0.03521728515625,
-0.05706787109375,
-0.01934814453125,
0.06488037109375,
-0.0013408660888671875,
0.006732940673828125,
-0.03582763671875,
0.01190948486328125,
0.05181884765625,
-0.04803466796875,
-0.0281829833984375,
-0.05059814453125,
-0.0220489501953125,
0.087646484375,
0.0250091552734375,
-0.007843017578125,
-0.0247802734375,
-0.04412841796875,
0.04840087890625,
-0.01342010498046875,
0.023712158203125,
0.0162811279296875,
0.0270843505859375,
0.01056671142578125,
0.0232086181640625,
0.0280303955078125,
0.052520751953125,
-0.038177490234375,
0.06329345703125,
0.029296875,
0.0266571044921875,
-0.0323486328125,
0.01134490966796875,
0.00952911376953125,
0.06640625,
-0.049530029296875,
-0.06561279296875,
0.01081085205078125,
0.0185546875,
0.01250457763671875,
0.0338134765625,
0.0255889892578125,
-0.044189453125,
0.0239410400390625,
-0.0278472900390625,
-0.0099639892578125,
0.01666259765625,
0.0261383056640625,
-0.0056915283203125,
-0.032135009765625,
-0.006511688232421875,
-0.027587890625,
-0.019775390625,
-0.028900146484375,
0.031036376953125,
0.08160400390625,
0.0259246826171875,
0.03228759765625,
-0.0306549072265625,
-0.0382080078125,
-0.00682830810546875,
-0.0016031265258789062,
0.0078887939453125,
0.018463134765625,
-0.0003948211669921875,
0.0237579345703125,
-0.0113677978515625,
0.01010894775390625,
0.0400390625,
0.005706787109375,
0.006378173828125,
0.03436279296875,
0.05615234375,
0.01153564453125,
0.050811767578125,
0.0168914794921875,
0.0241241455078125,
-0.03662109375,
-0.002025604248046875,
-0.011932373046875,
-0.00009459257125854492,
-0.02642822265625,
0.00585174560546875,
0.0113983154296875,
0.0017881393432617188,
0.01593017578125,
0.0118408203125,
0.016265869140625,
0.049713134765625,
0.00815582275390625,
-0.00592803955078125,
0.0238037109375,
-0.0615234375,
0.0014142990112304688,
-0.0262603759765625,
-0.050872802734375,
0.0248260498046875,
0.033203125,
-0.051177978515625,
0.052215576171875,
-0.01215362548828125,
-0.0015277862548828125,
-0.0158843994140625,
-0.024322509765625,
0.062042236328125,
0.061614990234375,
-0.01342010498046875,
0.061309814453125,
-0.052459716796875,
-0.01113128662109375,
0.0041961669921875,
0.00772857666015625,
0.02337646484375,
0.02069091796875,
0.01812744140625,
0.022003173828125,
-0.02783203125,
-0.0179443359375,
0.01195526123046875,
-0.0238800048828125,
0.032623291015625,
0.0396728515625,
-0.0053253173828125,
-0.00945281982421875,
0.0010614395141601562,
0.0160369873046875,
0.036102294921875,
-0.0123443603515625,
0.009674072265625,
-0.039764404296875,
0.0215606689453125,
-0.007160186767578125,
0.00862884521484375,
-0.026458740234375,
-0.021148681640625,
-0.009979248046875,
-0.026153564453125,
0.0258636474609375,
0.015167236328125,
0.037384033203125,
0.014312744140625,
0.026458740234375,
-0.0019779205322265625,
0.02783203125,
0.01149749755859375,
0.011474609375,
0.0194091796875,
0.005645751953125,
0.0207977294921875,
0.0245819091796875,
-0.0143280029296875,
0.018524169921875,
0.0109100341796875,
0.00650787353515625,
0.01165771484375,
-0.002513885498046875,
0.0333251953125,
0.046783447265625,
0.036468505859375,
-0.04815673828125,
0.01007080078125,
0.077392578125,
-0.0180511474609375,
0.0165252685546875,
0.01073455810546875,
-0.0076446533203125,
-0.04461669921875,
-0.01450347900390625,
0.01451873779296875,
-0.0248260498046875,
0.0032253265380859375,
-0.01284027099609375,
-0.0152435302734375,
0.0266571044921875,
0.0152740478515625,
-0.04913330078125,
0.035308837890625,
-0.009490966796875,
-0.016876220703125,
0.0093841552734375,
0.00927734375,
0.0198974609375,
0.01343536376953125,
-0.06390380859375,
0.0244598388671875,
-0.03131103515625,
-0.0256500244140625,
-0.0019969940185546875,
-0.00026607513427734375,
-0.00803375244140625,
-0.01861572265625,
0.0308990478515625,
0.006984710693359375,
0.02313232421875,
0.0367431640625,
0.01107025146484375,
0.0089569091796875,
0.048126220703125,
-0.01045989990234375,
-0.03643798828125,
-0.056243896484375,
0.0239715576171875,
-0.049560546875,
-0.007404327392578125,
0.01071929931640625,
-0.04290771484375,
-0.049896240234375,
-0.05767822265625,
-0.0648193359375,
0.05035400390625,
-0.0005927085876464844,
-0.03125,
-0.042724609375,
0.004314422607421875,
-0.0281829833984375,
0.00975799560546875,
-0.0093536376953125,
-0.03729248046875,
-0.0004260540008544922,
0.057281494140625,
0.03631591796875,
-0.024810791015625,
0.0543212890625,
0.01546478271484375,
-0.09197998046875,
0.0013761520385742188,
-0.01142120361328125,
0.0418701171875,
-0.04620361328125,
0.01222991943359375,
-0.00778961181640625,
0.024871826171875,
-0.0189056396484375,
-0.030487060546875,
0.0277557373046875,
0.0214385986328125,
0.00820159912109375,
-0.08306884765625,
-0.035919189453125,
-0.032501220703125,
0.079345703125,
0.0012359619140625,
0.01392364501953125,
-0.0192718505859375,
-0.039459228515625,
-0.007587432861328125,
-0.05023193359375,
0.0245361328125,
0.0249786376953125,
-0.036529541015625,
0.0231170654296875,
-0.00531768798828125,
0.0291290283203125,
0.03179931640625,
-0.024871826171875,
0.015777587890625,
0.0020771026611328125,
0.0357666015625,
0.027099609375,
-0.04302978515625,
0.00316619873046875,
0.016876220703125,
-0.01015472412109375,
0.036834716796875,
-0.027801513671875,
0.0074615478515625,
0.029876708984375,
0.022796630859375,
-0.045166015625,
0.00591278076171875,
-0.04022216796875,
0.0226287841796875,
-0.0360107421875,
0.036376953125,
-0.052947998046875,
0.0204925537109375,
-0.0199432373046875,
-0.01013946533203125,
-0.0029144287109375,
-0.035491943359375,
0.0168914794921875,
0.03619384765625,
-0.0181121826171875,
0.08740234375,
-0.01277923583984375,
0.0963134765625,
0.009796142578125,
0.05731201171875,
0.031646728515625,
-0.040008544921875,
0.0718994140625,
-0.05267333984375,
-0.0237274169921875,
-0.00817108154296875,
-0.016754150390625,
-0.113525390625,
0.0386962890625,
0.048583984375,
0.03021240234375,
0.04437255859375
] |
2b7ce9f14baf344d01d9f4f62016c5c41a9c611c
|
Wordpress Stackexchange
Q: Per Post Type Revision Numbers In wp-config.php you're able to change how WordPress deals with post revisions. Specifically you're able to turn them off or specify a max number of revisions.
I'd like to be able to set a max number or revisions on a post type basis.
Is this possible?
A: This is possible but it's not as simple as changing the WP_POST_REVISIONS property in the wp-config.php. This is possible by adding a filter to the 'wp_insert_post_data'.
Adding a filter is done like this:
add_filter('wp_insert_post_data' , 'my_insert_post_data');
function my_insert_post_data($data , $postarr) {
// Check the revision stuff
return $data;
}
|
Q: Per Post Type Revision Numbers In wp-config.php you're able to change how WordPress deals with post revisions. Specifically you're able to turn them off or specify a max number of revisions.
I'd like to be able to set a max number or revisions on a post type basis.
Is this possible?
A: This is possible but it's not as simple as changing the WP_POST_REVISIONS property in the wp-config.php. This is possible by adding a filter to the 'wp_insert_post_data'.
Adding a filter is done like this:
add_filter('wp_insert_post_data' , 'my_insert_post_data');
function my_insert_post_data($data , $postarr) {
// Check the revision stuff
return $data;
}
A: *
*Remove the action 'wp_save_post_revision' from 'pre_post_update'. It is set per default in wp-includes/default-filters.php with the default priority (10).
*Add your own function to this hook. You get the $post_ID as parameter, so detecting the post type is easy.
*In your callback copy the code from wp_save_post_revision() but use the constant WP_POST_REVISIONS for the post type post only, and use different values for other post types. Not sure if it is possible to pass extra values in register_post_type() …
|
wordpress
|
{
"language": "en",
"length": 182,
"provenance": "stackexchange_00019.jsonl.gz:420541",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54199"
}
|
[
0.050201416015625,
-0.021209716796875,
-0.008697509765625,
-0.024871826171875,
0.005306243896484375,
-0.0435791015625,
0.057861328125,
0.00760650634765625,
-0.01433563232421875,
-0.005046844482421875,
-0.0357666015625,
-0.002338409423828125,
-0.04052734375,
-0.03143310546875,
0.0178680419921875,
-0.04547119140625,
0.03546142578125,
-0.0164642333984375,
0.00420379638671875,
-0.0241851806640625,
-0.000029861927032470703,
-0.01374053955078125,
0.032470703125,
0.08892822265625,
0.0261688232421875,
0.059295654296875,
0.025634765625,
-0.048065185546875,
0.00009554624557495117,
-0.0295257568359375,
0.0190887451171875,
0.0017261505126953125,
0.024169921875,
0.0178375244140625,
-0.00843048095703125,
0.007205963134765625,
0.0091705322265625,
0.000698089599609375,
0.022552490234375,
0.0015077590942382812,
0.019805908203125,
-0.00885772705078125,
0.0272064208984375,
-0.007076263427734375,
-0.01532745361328125,
-0.0101165771484375,
0.0228729248046875,
-0.0268402099609375,
0.025146484375,
-0.01039886474609375,
-0.0257568359375,
0.0223846435546875,
-0.0027484893798828125,
-0.040130615234375,
-0.035980224609375,
-0.044891357421875,
0.0001914501190185547,
-0.0198822021484375,
0.050262451171875,
-0.006015777587890625,
-0.049407958984375,
-0.04486083984375,
0.02490234375,
-0.03326416015625,
-0.044891357421875,
-0.007843017578125,
0.052215576171875,
-0.0031833648681640625,
-0.075927734375,
-0.04278564453125,
0.063232421875,
-0.00980377197265625,
0.00907135009765625,
-0.0238800048828125,
0.0025043487548828125,
-0.021881103515625,
0.0095062255859375,
-0.00598907470703125,
0.0087890625,
-0.0032787322998046875,
0.077880859375,
-0.04168701171875,
0.04986572265625,
0.003627777099609375,
0.01439666748046875,
0.006389617919921875,
0.02569580078125,
-0.0182952880859375,
-0.030975341796875,
-0.01288604736328125,
-0.0271759033203125,
-0.02496337890625,
-0.036834716796875,
-0.0005393028259277344,
0.004058837890625,
-0.031463623046875,
0.00370025634765625,
-0.0127410888671875,
-0.01136016845703125,
0.0060577392578125,
0.00572967529296875,
-0.0273284912109375,
0.022125244140625,
-0.01322174072265625,
0.01383209228515625,
0.017730712890625,
-0.0235137939453125,
-0.0234527587890625,
0.0447998046875,
0.0308380126953125,
0.00019931793212890625,
0.03363037109375,
-0.0068206787109375,
-0.028533935546875,
-0.0219573974609375,
0.00983428955078125,
-0.0377197265625,
0.019775390625,
0.01094818115234375,
0.0240936279296875,
0.020172119140625,
0.0679931640625,
-0.0220794677734375,
-0.052886962890625,
-0.004291534423828125,
-0.019500732421875,
0.00969696044921875,
-0.051116943359375,
-0.006046295166015625,
0.036865234375,
-0.0308380126953125,
-0.0018062591552734375,
0.0643310546875,
0.0272979736328125,
0.00551605224609375,
-0.0280609130859375,
0.0245361328125,
-0.024200439453125,
-0.0237274169921875,
0.04119873046875,
-0.06512451171875,
-0.0029735565185546875,
0.048583984375,
-0.05999755859375,
-0.00965118408203125,
0.0216522216796875,
0.027923583984375,
0.01020050048828125,
-0.00893402099609375,
-0.01947021484375,
-0.025848388671875,
0.0086517333984375,
0.0304718017578125,
-0.010162353515625,
0.0013628005981445312,
-0.06402587890625,
0.0003483295440673828,
-0.036407470703125,
0.0248565673828125,
-0.03662109375,
0.0313720703125,
-0.018157958984375,
0.007259368896484375,
-0.0179443359375,
-0.055206298828125,
0.047760009765625,
-0.050018310546875,
-0.020751953125,
0.0227203369140625,
-0.0110626220703125,
0.01360321044921875,
0.00124359130859375,
0.007633209228515625,
0.0081939697265625,
-0.0060882568359375,
-0.00018334388732910156,
-0.0107879638671875,
0.01537322998046875,
0.0017108917236328125,
0.051605224609375,
0.034271240234375,
-0.0210723876953125,
-0.003383636474609375,
0.0285491943359375,
-0.03497314453125,
-0.0006303787231445312,
0.0256500244140625,
0.05303955078125,
0.00689697265625,
0.0430908203125,
0.00763702392578125,
0.007427215576171875,
-0.016876220703125,
-0.04205322265625,
-0.0059051513671875,
-0.01145172119140625,
0.0081329345703125,
-0.0119781494140625,
-0.0091705322265625,
0.06378173828125,
-0.03125,
-0.0162353515625,
-0.00554656982421875,
-0.0022678375244140625,
-0.067138671875,
0.002231597900390625,
-0.023284912109375,
0.03271484375,
-0.023529052734375,
0.03369140625,
0.033172607421875,
0.0175018310546875,
-0.015045166015625,
-0.032562255859375,
-0.00983428955078125,
0.00911712646484375,
-0.024505615234375,
0.02587890625,
-0.025482177734375,
0.03814697265625,
-0.050750732421875,
-0.026885986328125,
-0.04644775390625,
-0.01107025146484375,
0.05352783203125,
0.0016880035400390625,
-0.0081024169921875,
-0.0190582275390625,
0.04315185546875,
0.0145263671875,
-0.03509521484375,
0.01336669921875,
-0.003448486328125,
0.00350189208984375,
-0.00452423095703125,
-0.01611328125,
-0.0175323486328125,
-0.10321044921875,
0.027679443359375,
0.07000732421875,
0.0323486328125,
-0.0122833251953125,
-0.00035691261291503906,
0.0310516357421875,
-0.01316070556640625,
-0.01983642578125,
0.038177490234375,
-0.01361846923828125,
-0.007709503173828125,
0.00775146484375,
0.0005922317504882812,
0.006641387939453125,
0.0318603515625,
-0.06591796875,
0.0245361328125,
0.04718017578125,
0.00566864013671875,
0.0278472900390625,
0.01413726806640625,
-0.01495361328125,
-0.0022563934326171875,
-0.032684326171875,
-0.0244293212890625,
-0.0135345458984375,
0.038055419921875,
0.0253448486328125,
0.06494140625,
0.044036865234375,
-0.0235443115234375,
0.0159149169921875,
-0.0008282661437988281,
-0.01849365234375,
0.010528564453125,
-0.027801513671875,
-0.02008056640625,
0.032196044921875,
-0.04779052734375,
0.036895751953125,
0.040069580078125,
-0.01715087890625,
-0.0341796875,
0.0174560546875,
0.001407623291015625,
-0.01230621337890625,
-0.00968170166015625,
-0.0418701171875,
0.005588531494140625,
-0.03131103515625,
-0.0469970703125,
-0.03497314453125,
0.004802703857421875,
0.006103515625,
-0.0439453125,
-0.004726409912109375,
0.006031036376953125,
-0.0184173583984375,
-0.01314544677734375,
-0.07977294921875,
0.07177734375,
-0.0650634765625,
0.056121826171875,
0.08056640625,
-0.030548095703125,
0.03741455078125,
-0.002384185791015625,
0.0027751922607421875,
0.0016431808471679688,
0.021728515625,
-0.0256805419921875,
-0.055816650390625,
-0.0328369140625,
-0.0177764892578125,
0.009429931640625,
-0.005828857421875,
0.0199737548828125,
-0.00901031494140625,
-0.00757598876953125,
0.01552581787109375,
-0.0082550048828125,
0.010894775390625,
0.029296875,
-0.03436279296875,
-0.0321044921875,
-0.017425537109375,
-0.01221466064453125,
-0.0156707763671875,
0.00009548664093017578,
-0.0128173828125,
0.0247802734375,
-0.023651123046875,
-0.01238250732421875,
-0.03369140625,
-0.05316162109375,
-0.045562744140625,
0.01259613037109375,
-0.00008791685104370117,
-0.01206207275390625,
0.10186767578125,
0.00998687744140625,
-0.06195068359375,
-0.0250244140625,
0.014129638671875,
-0.0131988525390625,
-0.0240631103515625,
0.02947998046875,
-0.02789306640625,
0.0169830322265625,
-0.0056304931640625,
-0.024383544921875,
0.04058837890625,
-0.0222015380859375,
-0.0087890625,
-0.005580902099609375,
-0.041107177734375,
0.0228729248046875,
0.031280517578125,
-0.0224456787109375,
0.01027679443359375,
0.061187744140625,
-0.0283050537109375,
-0.014739990234375,
0.0031070709228515625,
-0.0296478271484375,
-0.00991058349609375,
0.00502777099609375,
-0.01483154296875,
-0.0209503173828125,
0.0288848876953125,
0.00620269775390625,
0.01055908203125,
0.05670166015625,
-0.021026611328125,
0.0161590576171875,
-0.004901885986328125,
-0.01248931884765625,
-0.062744140625,
0.004726409912109375,
-0.0171966552734375,
0.057769775390625,
0.01227569580078125,
0.019805908203125,
-0.01120758056640625,
0.0194091796875,
-0.05902099609375,
-0.072265625,
0.0226898193359375,
-0.07135009765625,
0.004009246826171875,
-0.0675048828125,
-0.01001739501953125,
-0.022613525390625,
0.08807373046875,
-0.0222320556640625,
-0.00884246826171875,
-0.04364013671875,
0.0249481201171875,
-0.031494140625,
-0.10968017578125,
0.00661468505859375,
0.00041794776916503906,
-0.034027099609375,
0.04119873046875,
0.00708770751953125,
0.0011243820190429688,
-0.03558349609375,
0.034454345703125,
-0.030059814453125,
-0.01235198974609375,
0.040740966796875,
0.004306793212890625,
-0.0105743408203125,
0.0296783447265625,
0.0002982616424560547,
0.007114410400390625,
-0.044097900390625,
0.00878143310546875,
-0.09320068359375,
-0.0178985595703125,
-0.004123687744140625,
0.076416015625,
0.0252227783203125,
-0.056610107421875,
-0.0235137939453125,
0.03936767578125,
0.033203125,
0.022796630859375,
0.010833740234375,
0.003597259521484375,
-0.0231170654296875,
-0.0218353271484375,
0.018707275390625,
-0.030059814453125,
-0.03179931640625,
-0.041717529296875,
-0.004207611083984375,
-0.00457763671875,
-0.0212860107421875,
0.005035400390625,
-0.02301025390625,
0.00792694091796875,
-0.073974609375,
-0.033416748046875,
-0.0209808349609375,
0.027679443359375,
0.0015134811401367188,
0.0009064674377441406,
-0.067138671875,
-0.10308837890625,
0.035858154296875,
0.0009436607360839844,
0.0076751708984375,
0.0114593505859375,
0.09222412109375,
0.00714111328125,
-0.01094818115234375,
-0.0753173828125,
-0.0008335113525390625,
0.00994873046875,
-0.019134521484375,
0.04034423828125,
-0.00972747802734375,
0.0007386207580566406,
0.047576904296875,
-0.037200927734375,
-0.041015625,
0.01151275634765625,
0.00948333740234375,
0.02398681640625,
-0.0087738037109375,
-0.0093994140625,
-0.021331787109375,
0.05963134765625,
0.0289459228515625,
0.0021800994873046875,
-0.04510498046875,
0.01345062255859375,
0.07366943359375,
-0.036895751953125,
0.045135498046875,
-0.0222625732421875,
-0.0262298583984375,
0.0184326171875,
-0.0266265869140625,
0.01519775390625,
0.0303802490234375,
-0.0017452239990234375,
0.0172271728515625,
-0.01045989990234375,
0.018829345703125,
0.00936126708984375,
0.03326416015625,
-0.0081634521484375,
0.05926513671875,
0.0146026611328125,
0.0237274169921875,
-0.01342010498046875,
-0.0088653564453125,
0.017181396484375,
-0.014739990234375,
-0.057647705078125,
-0.00553131103515625,
-0.004100799560546875,
0.0265960693359375,
0.01384735107421875,
-0.016693115234375,
0.0189666748046875,
0.016754150390625,
-0.00225067138671875,
-0.009368896484375,
-0.023468017578125,
0.0135345458984375,
-0.035186767578125,
0.037628173828125,
0.025634765625,
-0.0183258056640625,
-0.0021152496337890625,
0.046966552734375,
0.05712890625,
-0.01123809814453125,
-0.0242919921875,
0.078125,
0.07440185546875,
-0.0175323486328125,
0.01029205322265625,
0.03839111328125,
-0.00473785400390625,
-0.055023193359375,
-0.01342010498046875,
-0.0263214111328125,
-0.04827880859375,
0.007068634033203125,
0.026031494140625,
-0.016845703125,
0.029510498046875,
0.02337646484375,
0.011016845703125,
-0.00725555419921875,
0.0223541259765625,
0.00792694091796875,
-0.042144775390625,
0.01349639892578125,
0.0158843994140625,
-0.0073089599609375,
-0.035125732421875,
0.01062774658203125,
-0.012542724609375,
-0.007541656494140625,
-0.00688934326171875,
0.01085662841796875,
-0.0208740234375,
-0.031982421875,
-0.024932861328125,
-0.06103515625,
-0.04168701171875,
0.01393890380859375,
-0.022613525390625,
0.005512237548828125,
-0.00701904296875,
-0.0107269287109375,
0.0090789794921875,
-0.00948333740234375,
0.0006260871887207031,
-0.01134490966796875,
0.00124359130859375,
0.01197052001953125,
0.01248931884765625,
0.0183258056640625,
-0.00970458984375,
0.0230560302734375,
-0.0274200439453125,
-0.05194091796875,
-0.036834716796875,
0.018218994140625,
0.003330230712890625,
-0.0284271240234375,
-0.0146636962890625,
0.015472412109375,
0.0129852294921875,
-0.0164337158203125,
-0.05718994140625,
-0.01447296142578125,
0.007770538330078125,
0.027069091796875,
0.025604248046875,
-0.0145721435546875,
0.032745361328125,
-0.00005882978439331055,
0.0190887451171875,
-0.007427215576171875,
-0.010009765625,
0.0016307830810546875,
-0.00617218017578125,
0.03125,
-0.03271484375,
-0.056121826171875,
-0.01422119140625,
-0.0172576904296875,
-0.008270263671875,
-0.007144927978515625,
-0.0191802978515625,
0.02569580078125,
-0.030792236328125,
0.01300048828125,
-0.0268707275390625,
0.01477813720703125,
-0.06988525390625,
-0.0116119384765625,
0.0254058837890625,
0.01065826416015625,
-0.0114593505859375,
-0.00449371337890625,
-0.0159149169921875,
0.013519287109375,
0.0142364501953125,
0.0017852783203125,
-0.036468505859375,
-0.007656097412109375,
-0.0018167495727539062,
0.0132904052734375,
0.023162841796875,
0.040283203125,
-0.0123443603515625,
0.040191650390625,
0.0302276611328125,
-0.00406646728515625,
-0.0203399658203125,
-0.004180908203125,
0.0279693603515625,
-0.0013561248779296875,
-0.006710052490234375,
0.01415252685546875,
-0.00925445556640625,
0.02166748046875,
0.0294952392578125,
0.06365966796875,
-0.07562255859375,
0.034332275390625,
0.0400390625,
0.016387939453125,
0.0577392578125,
0.01007843017578125,
-0.0008449554443359375,
0.00475311279296875,
0.0234832763671875,
-0.058380126953125,
-0.02215576171875,
0.0117034912109375,
-0.01629638671875,
-0.0145111083984375,
-0.0309295654296875,
0.0120697021484375,
0.01458740234375,
0.032806396484375,
0.00004082918167114258,
0.001262664794921875,
0.01389312744140625,
-0.0145416259765625,
0.038238525390625,
0.0162200927734375,
-0.03326416015625,
-0.0828857421875,
0.00475311279296875,
0.01175689697265625,
-0.044708251953125,
0.003314971923828125,
-0.01336669921875,
0.042999267578125,
0.0501708984375,
-0.00437164306640625,
-0.018707275390625,
0.037872314453125,
-0.019775390625,
-0.0657958984375,
-0.04229736328125,
0.01045989990234375,
0.01287078857421875,
-0.0109100341796875,
0.037628173828125,
-0.0237579345703125,
-0.05767822265625,
-0.004573822021484375,
-0.01025390625,
0.09429931640625,
-0.039093017578125,
-0.0210418701171875,
0.02752685546875,
-0.0278472900390625,
-0.005290985107421875,
-0.0025768280029296875,
-0.01512908935546875,
-0.03729248046875,
-0.035888671875,
-0.0146331787109375,
-0.0635986328125,
0.015869140625,
-0.00656890869140625,
-0.0379638671875,
0.1385498046875,
0.0014524459838867188,
0.0198822021484375,
0.02630615234375,
0.051971435546875,
-0.038604736328125,
0.044586181640625,
-0.038543701171875,
0.0545654296875,
0.0284271240234375,
0.020599365234375,
-0.048736572265625,
-0.0150299072265625,
-0.0094451904296875,
0.030670166015625,
0.0692138671875,
0.020111083984375,
-0.0168609619140625,
0.01279449462890625,
0.07733154296875,
0.01052093505859375,
-0.017547607421875,
0.047698974609375,
0.00466156005859375,
0.015045166015625,
0.06378173828125,
-0.03216552734375,
0.0242462158203125,
0.0240478515625,
0.004116058349609375,
0.02197265625,
0.02764892578125,
0.0141448974609375,
0.00540924072265625,
0.0157318115234375,
-0.033538818359375,
0.01137542724609375,
0.028594970703125,
0.03546142578125,
0.015289306640625,
0.0308380126953125,
0.05877685546875,
-0.028839111328125,
-0.01235198974609375,
-0.019775390625,
0.057891845703125,
0.0283355712890625,
-0.00940704345703125,
0.058258056640625,
0.0031719207763671875,
0.0303192138671875,
0.00586700439453125,
-0.00414276123046875,
-0.025543212890625,
0.0499267578125,
0.0113067626953125,
0.016204833984375,
0.00960540771484375,
-0.01273345947265625,
0.044891357421875,
0.042449951171875,
0.0139617919921875,
-0.0455322265625,
-0.041351318359375,
0.025115966796875,
0.03582763671875,
-0.0042724609375,
0.002593994140625,
0.022430419921875,
-0.0625,
0.01537322998046875,
0.018402099609375,
-0.0175628662109375,
0.0152587890625,
0.0170440673828125,
0.0257720947265625,
0.04473876953125,
-0.0318603515625,
-0.0181121826171875,
-0.06341552734375,
0.008758544921875,
0.02935791015625,
0.0596923828125,
0.031829833984375,
0.057464599609375,
0.0244140625,
-0.0264739990234375,
0.00572967529296875,
0.01512908935546875,
0.01441192626953125,
-0.0281219482421875,
-0.0182647705078125,
-0.045379638671875,
0.01995849609375,
0.024993896484375,
0.03314208984375,
-0.0084228515625,
0.05560302734375,
0.0380859375,
-0.046051025390625,
-0.01131439208984375,
0.0193939208984375,
-0.01385498046875,
-0.00876617431640625,
-0.0243377685546875,
0.0004115104675292969,
0.0041351318359375,
-0.014129638671875,
-0.0015745162963867188,
0.02667236328125,
0.0119781494140625,
0.037445068359375,
0.01541900634765625,
0.0189361572265625,
-0.0015077590942382812,
-0.0259246826171875,
0.0189361572265625,
-0.00383758544921875,
0.069580078125,
-0.03271484375,
-0.007381439208984375,
-0.0182037353515625,
-0.039215087890625,
0.0230560302734375,
0.0235595703125,
-0.038909912109375,
0.046295166015625,
-0.000354766845703125,
-0.034332275390625,
0.03326416015625,
-0.01345062255859375,
0.0252838134765625,
0.0108642578125,
-0.0093231201171875,
-0.00937652587890625,
-0.054351806640625,
-0.0206451416015625,
-0.044097900390625,
0.023468017578125,
0.009613037109375,
0.07000732421875,
-0.00797271728515625,
0.007556915283203125,
-0.0102691650390625,
0.034820556640625,
-0.03472900390625,
-0.01007080078125,
0.014984130859375,
-0.0009655952453613281,
0.00859832763671875,
0.004619598388671875,
-0.034576416015625,
0.00649261474609375,
0.026092529296875,
-0.03289794921875,
0.033447265625,
-0.05328369140625,
0.0200347900390625,
-0.04046630859375,
-0.00251007080078125,
-0.0264434814453125,
0.0006494522094726562,
-0.005420684814453125,
-0.0261993408203125,
0.0211639404296875,
0.00289154052734375,
0.0218658447265625,
0.01470947265625,
0.0029277801513671875,
-0.040313720703125,
0.0217132568359375,
-0.006816864013671875,
0.0267181396484375,
0.0238189697265625,
-0.0049591064453125,
0.0005450248718261719,
0.0038051605224609375,
-0.0157623291015625,
-0.00563812255859375,
0.0276947021484375,
-0.0101470947265625,
0.01393890380859375,
-0.035797119140625,
-0.0163116455078125,
0.0254974365234375,
0.03594970703125,
0.0131988525390625,
0.0217742919921875,
-0.029388427734375,
-0.0193634033203125,
-0.004619598388671875,
0.04150390625,
-0.0208740234375,
-0.0101318359375,
-0.01629638671875,
-0.01096343994140625,
-0.00386810302734375,
-0.045928955078125,
-0.035186767578125,
0.004535675048828125,
0.017059326171875,
0.01198577880859375,
-0.04736328125,
0.0634765625,
-0.036773681640625,
0.017730712890625,
-0.0203094482421875,
-0.07379150390625,
0.020751953125,
0.0235137939453125,
-0.0199432373046875,
-0.020965576171875,
-0.041015625,
0.0025787353515625,
-0.0308685302734375,
0.0170440673828125,
0.058502197265625,
-0.028717041015625,
-0.0401611328125,
-0.0027618408203125,
0.0019378662109375,
0.0361328125,
-0.00949859619140625,
0.0035552978515625,
0.026092529296875,
0.0225982666015625,
-0.0491943359375,
-0.11492919921875,
0.0011463165283203125,
-0.05169677734375,
0.022003173828125,
-0.03851318359375,
-0.001125335693359375,
-0.006389617919921875,
-0.043975830078125,
-0.044464111328125,
0.04620361328125,
-0.020477294921875,
-0.024200439453125,
-0.042144775390625,
-0.02734375,
-0.012664794921875,
0.062347412109375,
0.009429931640625,
-0.018463134765625,
-0.033355712890625,
0.031829833984375,
-0.0015974044799804688,
0.022491455078125,
0.000621795654296875,
0.0091552734375,
-0.03155517578125,
0.0272216796875,
0.018768310546875,
-0.0038604736328125,
0.0170440673828125,
-0.005626678466796875,
0.032928466796875,
0.032196044921875,
-0.05206298828125,
0.0122833251953125,
-0.00792694091796875,
0.01403045654296875,
0.00012409687042236328,
-0.022186279296875,
-0.07977294921875,
-0.041168212890625,
0.104736328125,
0.06121826171875,
0.037750244140625,
-0.01031494140625,
0.045196533203125,
-0.0135498046875,
-0.046234130859375,
-0.00897979736328125,
-0.0002048015594482422,
-0.0144805908203125,
-0.0120849609375,
-0.007770538330078125,
-0.001682281494140625,
0.0063934326171875,
-0.026123046875,
-0.0161285400390625,
-0.01245880126953125,
-0.0206298828125,
-0.017120361328125,
-0.01366424560546875,
0.050750732421875,
-0.0262908935546875,
-0.01204681396484375,
-0.00440216064453125,
-0.00962066650390625,
-0.0123748779296875,
-0.0291595458984375,
0.01165771484375,
0.00144195556640625,
-0.00536346435546875,
-0.0153350830078125,
0.026947021484375,
0.003658294677734375,
0.00872039794921875,
-0.04156494140625,
-0.01136016845703125,
-0.0052032470703125,
-0.0004968643188476562,
0.002620697021484375,
-0.019866943359375,
0.0013418197631835938,
0.004520416259765625,
-0.0224151611328125,
0.06158447265625,
-0.0014801025390625,
0.056671142578125,
0.0193634033203125,
0.01238250732421875,
-0.0745849609375,
0.01995849609375,
-0.050537109375,
-0.0226898193359375,
0.015960693359375,
0.0013380050659179688,
0.02813720703125,
-0.0200347900390625,
0.0262908935546875,
0.0285491943359375,
-0.004825592041015625,
0.01242828369140625
] |
6582647bbcd995c59550131ea646a87b678ecdd2
|
Wordpress Stackexchange
Q: Search/Replace for editor in HTML-mode Is there a way to do a Search and Replace from the editor in HTML-mode?
Plugins I found work in the visual editor, we are working only in HTML-mode, therefore -not- appropriate for what we do.
I would appreciate to find a code snippet or plugin for HTML-mode (did I miss the one you found?)
Thanks in advance for time and effort.
A: Why don't you add a custom button with the functionality you require? You could attach a JavaScript method to do the search and replace as requested?
Check out:
How to add a custom button to the tinyMCE toolbar?
Hope this helps...
|
Q: Search/Replace for editor in HTML-mode Is there a way to do a Search and Replace from the editor in HTML-mode?
Plugins I found work in the visual editor, we are working only in HTML-mode, therefore -not- appropriate for what we do.
I would appreciate to find a code snippet or plugin for HTML-mode (did I miss the one you found?)
Thanks in advance for time and effort.
A: Why don't you add a custom button with the functionality you require? You could attach a JavaScript method to do the search and replace as requested?
Check out:
How to add a custom button to the tinyMCE toolbar?
Hope this helps...
A: Plugins like "Better search and Replace" will also allow you to search and replace HTML snippets very effectively. For example I wanted to remove the html chunk <a name="more"></a> and replace it <br /> and the plugin executed it very efficiently...
|
wordpress
|
{
"language": "en",
"length": 152,
"provenance": "stackexchange_00019.jsonl.gz:420580",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54340"
}
|
[
-0.0190582275390625,
-0.0194854736328125,
0.0006561279296875,
0.037200927734375,
-0.015899658203125,
-0.005157470703125,
0.04754638671875,
-0.029632568359375,
0.020660400390625,
0.056060791015625,
0.0276641845703125,
-0.0102386474609375,
0.0202178955078125,
-0.041717529296875,
-0.0241241455078125,
0.01385498046875,
-0.0018281936645507812,
0.0092620849609375,
0.00876617431640625,
-0.035247802734375,
0.03240966796875,
-0.03607177734375,
0.007411956787109375,
-0.0693359375,
0.0199127197265625,
0.016815185546875,
0.06390380859375,
-0.037567138671875,
0.0138397216796875,
-0.0299224853515625,
0.0144500732421875,
-0.00257110595703125,
0.02490234375,
0.024993896484375,
-0.02783203125,
0.051849365234375,
-0.03131103515625,
0.040863037109375,
0.016754150390625,
-0.00600433349609375,
0.035980224609375,
-0.0263671875,
0.0051727294921875,
-0.007476806640625,
-0.003204345703125,
-0.0193328857421875,
0.049224853515625,
-0.048248291015625,
0.0164337158203125,
-0.04150390625,
-0.01110076904296875,
0.0201873779296875,
0.01776123046875,
-0.06976318359375,
-0.01068878173828125,
-0.0023326873779296875,
0.00424957275390625,
0.0228118896484375,
-0.0101165771484375,
0.0084228515625,
0.0117645263671875,
0.054779052734375,
-0.011322021484375,
0.045135498046875,
-0.0230865478515625,
-0.0096588134765625,
-0.0272369384765625,
-0.005764007568359375,
0.0186920166015625,
-0.007236480712890625,
0.0214385986328125,
-0.00029158592224121094,
0.0216522216796875,
0.0028095245361328125,
0.0184783935546875,
-0.0253448486328125,
-0.0033283233642578125,
0.003063201904296875,
0.016998291015625,
0.0225372314453125,
0.0175628662109375,
-0.005279541015625,
0.039337158203125,
-0.041717529296875,
0.002025604248046875,
-0.038604736328125,
-0.00719451904296875,
-0.0010118484497070312,
-0.039642333984375,
-0.014312744140625,
-0.0294189453125,
-0.051025390625,
-0.0308837890625,
0.0167083740234375,
-0.0118255615234375,
0.00803375244140625,
-0.0130767822265625,
0.003429412841796875,
-0.0021076202392578125,
0.035430908203125,
0.0204620361328125,
-0.044464111328125,
0.0677490234375,
-0.047088623046875,
0.023223876953125,
0.0130462646484375,
-0.0084991455078125,
0.07025146484375,
0.08038330078125,
0.034820556640625,
0.002044677734375,
0.032196044921875,
-0.018280029296875,
-0.033721923828125,
-0.01360321044921875,
0.0428466796875,
-0.0149993896484375,
0.029998779296875,
0.00994873046875,
0.050628662109375,
0.00630950927734375,
0.0223388671875,
-0.01110076904296875,
-0.005916595458984375,
-0.056488037109375,
-0.06280517578125,
0.0116729736328125,
0.00662994384765625,
0.0126190185546875,
-0.038604736328125,
-0.025970458984375,
0.0411376953125,
0.0611572265625,
0.054290771484375,
0.02655029296875,
0.0014362335205078125,
0.0303192138671875,
-0.0142059326171875,
0.01474761962890625,
-0.021881103515625,
0.00830078125,
0.0006542205810546875,
0.00997161865234375,
-0.01117706298828125,
0.01032257080078125,
-0.00551605224609375,
0.01561737060546875,
0.03216552734375,
0.008697509765625,
-0.05462646484375,
0.0501708984375,
-0.00004017353057861328,
0.0275421142578125,
0.01010894775390625,
0.02490234375,
-0.03448486328125,
0.045989990234375,
-0.036224365234375,
0.01922607421875,
-0.036651611328125,
-0.0235137939453125,
-0.004055023193359375,
0.0618896484375,
-0.05157470703125,
-0.02813720703125,
0.0009436607360839844,
-0.061737060546875,
0.00024235248565673828,
0.0263519287109375,
0.0238800048828125,
0.01045989990234375,
0.00032782554626464844,
-0.0133819580078125,
0.00592041015625,
0.00449371337890625,
0.01690673828125,
-0.0154876708984375,
0.01137542724609375,
0.0208282470703125,
0.039215087890625,
0.0377197265625,
-0.01399993896484375,
0.06524658203125,
0.0196075439453125,
-0.0582275390625,
0.03704833984375,
-0.0200042724609375,
0.053802490234375,
0.037628173828125,
0.0145721435546875,
-0.006885528564453125,
-0.0084228515625,
0.00254058837890625,
0.0247955322265625,
-0.00778961181640625,
-0.0233917236328125,
-0.0233917236328125,
0.01531219482421875,
-0.0236663818359375,
-0.031951904296875,
0.05340576171875,
-0.026123046875,
0.00740814208984375,
-0.0194244384765625,
-0.07525634765625,
-0.0017976760864257812,
-0.018218994140625,
0.0058441162109375,
0.03564453125,
0.003864288330078125,
-0.006793975830078125,
0.0006561279296875,
0.0055084228515625,
-0.01247406005859375,
-0.039398193359375,
-0.000270843505859375,
-0.0163421630859375,
-0.00830841064453125,
0.01837158203125,
0.0206451416015625,
0.014556884765625,
0.0171051025390625,
0.0133209228515625,
0.00008696317672729492,
0.0301055908203125,
0.005649566650390625,
-0.01739501953125,
0.01031494140625,
0.0272369384765625,
0.03253173828125,
-0.031402587890625,
-0.0032596588134765625,
0.044525146484375,
0.037017822265625,
-0.016326904296875,
0.004962921142578125,
0.020538330078125,
-0.046722412109375,
0.0097503662109375,
0.0462646484375,
0.0307159423828125,
0.0167999267578125,
0.00778961181640625,
0.016387939453125,
0.053314208984375,
0.0224609375,
0.034515380859375,
-0.01904296875,
0.01367950439453125,
0.044952392578125,
-0.0001227855682373047,
-0.047149658203125,
0.00887298583984375,
-0.07391357421875,
0.01739501953125,
0.021514892578125,
0.0343017578125,
0.0694580078125,
-0.0136260986328125,
-0.0145263671875,
-0.0107421875,
0.003215789794921875,
-0.0157012939453125,
0.0028972625732421875,
0.0175933837890625,
0.02801513671875,
0.04083251953125,
0.040740966796875,
-0.0219879150390625,
0.0157928466796875,
-0.0016994476318359375,
0.0214080810546875,
0.0070343017578125,
0.03857421875,
-0.017120361328125,
0.036895751953125,
-0.00640869140625,
-0.01184844970703125,
0.01090240478515625,
0.0232391357421875,
-0.0201263427734375,
-0.0000022649765014648438,
-0.022705078125,
-0.01302337646484375,
0.005023956298828125,
-0.0117950439453125,
0.01531219482421875,
-0.013916015625,
0.0006060600280761719,
0.018646240234375,
0.032470703125,
0.0174102783203125,
-0.0343017578125,
0.03173828125,
-0.03570556640625,
0.0029926300048828125,
0.0210418701171875,
-0.017669677734375,
0.039764404296875,
-0.0007491111755371094,
0.044708251953125,
0.05859375,
0.00879669189453125,
-0.009002685546875,
0.0207672119140625,
-0.02783203125,
-0.00601959228515625,
0.03271484375,
0.01551055908203125,
0.024993896484375,
-0.049530029296875,
0.03448486328125,
0.0160064697265625,
-0.0043792724609375,
0.00432586669921875,
-0.02490234375,
-0.04705810546875,
0.0100555419921875,
-0.08819580078125,
-0.045684814453125,
0.0217132568359375,
-0.04779052734375,
-0.037994384765625,
0.026397705078125,
-0.03558349609375,
0.008514404296875,
0.048248291015625,
-0.010711669921875,
0.01043701171875,
-0.009613037109375,
-0.01031494140625,
-0.01473236083984375,
-0.051727294921875,
-0.0281219482421875,
0.003162384033203125,
0.0091552734375,
0.0306854248046875,
-0.0004856586456298828,
0.01503753662109375,
-0.0233306884765625,
0.04058837890625,
0.00782012939453125,
-0.02801513671875,
0.0221099853515625,
0.0487060546875,
-0.0985107421875,
0.003902435302734375,
-0.0190582275390625,
0.057525634765625,
0.0265045166015625,
-0.01270294189453125,
0.0201416015625,
0.008087158203125,
0.0166778564453125,
0.0224761962890625,
-0.005062103271484375,
-0.0177154541015625,
0.0582275390625,
0.0294189453125,
-0.007511138916015625,
0.01763916015625,
0.0123138427734375,
0.01177978515625,
0.046783447265625,
-0.01493072509765625,
-0.046783447265625,
0.0004458427429199219,
0.048187255859375,
0.0185699462890625,
0.032501220703125,
0.024169921875,
0.0022182464599609375,
-0.01180267333984375,
-0.00848388671875,
-0.000014007091522216797,
-0.025146484375,
-0.0160064697265625,
-0.051605224609375,
0.0033092498779296875,
-0.0262908935546875,
-0.025604248046875,
0.007137298583984375,
-0.0279693603515625,
0.0251007080078125,
0.00041103363037109375,
0.033111572265625,
-0.00537872314453125,
0.035491943359375,
-0.019989013671875,
-0.02911376953125,
-0.0190887451171875,
0.05419921875,
-0.03857421875,
0.0007104873657226562,
0.0233306884765625,
-0.005794525146484375,
0.03668212890625,
-0.018524169921875,
-0.0533447265625,
-0.034698486328125,
-0.09954833984375,
0.0122528076171875,
-0.005889892578125,
-0.02886962890625,
-0.01611328125,
0.01395416259765625,
-0.049652099609375,
-0.04730224609375,
0.031341552734375,
-0.0439453125,
0.0099945068359375,
-0.02032470703125,
-0.0102996826171875,
-0.05340576171875,
0.004436492919921875,
-0.032867431640625,
-0.037567138671875,
-0.00841522216796875,
-0.0926513671875,
0.0614013671875,
0.0740966796875,
-0.025665283203125,
-0.01435089111328125,
0.0220489501953125,
0.020599365234375,
0.039947509765625,
0.0252532958984375,
0.01198577880859375,
0.0228729248046875,
-0.0296783447265625,
0.01528167724609375,
-0.04681396484375,
0.00016295909881591797,
0.0089569091796875,
-0.00864410400390625,
0.040374755859375,
-0.0104217529296875,
-0.016571044921875,
0.0258026123046875,
-0.040740966796875,
-0.0277252197265625,
-0.053741455078125,
-0.04046630859375,
-0.01593017578125,
-0.01262664794921875,
-0.020751953125,
-0.0208282470703125,
-0.018798828125,
0.03948974609375,
0.0291748046875,
0.0047149658203125,
-0.01258087158203125,
0.043426513671875,
0.0206451416015625,
-0.031585693359375,
0.0254974365234375,
-0.0355224609375,
0.0178375244140625,
0.047393798828125,
-0.0384521484375,
-0.017547607421875,
-0.0252685546875,
-0.005176544189453125,
0.00901031494140625,
0.0253753662109375,
-0.07275390625,
0.07275390625,
0.007556915283203125,
0.044647216796875,
-0.0027103424072265625,
0.006134033203125,
0.0272064208984375,
0.0108795166015625,
-0.01409912109375,
0.0239715576171875,
-0.01190948486328125,
-0.00768280029296875,
-0.01024627685546875,
-0.006168365478515625,
0.006954193115234375,
-0.004566192626953125,
-0.02093505859375,
0.0001481771469116211,
0.10400390625,
0.06915283203125,
-0.01922607421875,
0.04168701171875,
0.03192138671875,
-0.017608642578125,
0.00637054443359375,
0.0020923614501953125,
-0.001689910888671875,
0.03826904296875,
-0.043212890625,
-0.01110076904296875,
-0.00789642333984375,
-0.008544921875,
-0.01287078857421875,
0.01885986328125,
-0.041717529296875,
0.0025691986083984375,
0.01396942138671875,
-0.032470703125,
0.0087432861328125,
0.00829315185546875,
-0.014862060546875,
0.045684814453125,
-0.00243377685546875,
0.0260772705078125,
0.036041259765625,
0.04547119140625,
-0.0021686553955078125,
-0.045654296875,
-0.011810302734375,
-0.0261993408203125,
-0.01373291015625,
0.0236358642578125,
-0.038330078125,
-0.004032135009765625,
0.01403045654296875,
0.0543212890625,
-0.012939453125,
0.033050537109375,
-0.00664520263671875,
0.0301666259765625,
0.0298614501953125,
-0.00891876220703125,
0.00223541259765625,
-0.0015850067138671875,
0.00243377685546875,
0.007160186767578125,
-0.01372528076171875,
0.016082763671875,
0.0013074874877929688,
0.02752685546875,
-0.00902557373046875,
-0.01076507568359375,
-0.01959228515625,
-0.02691650390625,
-0.027130126953125,
0.0059356689453125,
0.02294921875,
-0.0118865966796875,
0.0251617431640625,
-0.00933074951171875,
-0.0303192138671875,
-0.04925537109375,
-0.04168701171875,
0.0033664703369140625,
-0.050384521484375,
-0.01512908935546875,
-0.0157470703125,
-0.0179595947265625,
-0.00936126708984375,
0.006107330322265625,
-0.040771484375,
-0.05023193359375,
-0.007648468017578125,
0.017059326171875,
0.0479736328125,
-0.0258941650390625,
-0.040802001953125,
0.005100250244140625,
0.0138092041015625,
-0.021636962890625,
0.014678955078125,
0.007259368896484375,
-0.01702880859375,
-0.056549072265625,
-0.0260467529296875,
-0.05224609375,
-0.01401519775390625,
-0.031890869140625,
-0.0196533203125,
-0.0396728515625,
0.01319122314453125,
0.0419921875,
0.03314208984375,
-0.0016374588012695312,
-0.0316162109375,
0.040985107421875,
-0.0018739700317382812,
-0.003719329833984375,
0.03741455078125,
-0.00312042236328125,
-0.03607177734375,
0.01116180419921875,
0.020050048828125,
-0.01161956787109375,
-0.048187255859375,
0.010406494140625,
-0.0289764404296875,
0.0291900634765625,
0.00563812255859375,
-0.04058837890625,
-0.0160980224609375,
-0.037261962890625,
-0.01332855224609375,
0.037017822265625,
-0.0178070068359375,
0.008819580078125,
-0.0243377685546875,
-0.00974273681640625,
-0.0241241455078125,
0.02166748046875,
-0.044342041015625,
0.0141754150390625,
-0.0299530029296875,
-0.050445556640625,
-0.04229736328125,
0.03411865234375,
0.000270843505859375,
0.0269775390625,
0.01322174072265625,
-0.01325225830078125,
-0.004474639892578125,
0.00506591796875,
-0.005710601806640625,
0.016326904296875,
0.0209808349609375,
0.0234527587890625,
-0.00128173828125,
0.020599365234375,
-0.005664825439453125,
-0.0102386474609375,
0.0207977294921875,
0.0219879150390625,
0.03253173828125,
-0.0238800048828125,
-0.01497650146484375,
0.008636474609375,
-0.0345458984375,
-0.0187225341796875,
0.0692138671875,
0.038360595703125,
-0.0870361328125,
-0.0167694091796875,
0.00266265869140625,
-0.0234375,
-0.0290985107421875,
0.0026493072509765625,
-0.021392822265625,
-0.05792236328125,
0.026611328125,
0.0302734375,
0.0013151168823242188,
0.0128326416015625,
0.0245513916015625,
-0.0218505859375,
0.00809478759765625,
0.003795623779296875,
0.0052642822265625,
-0.00023806095123291016,
-0.01087188720703125,
0.00807952880859375,
0.025787353515625,
-0.00702667236328125,
0.053131103515625,
0.006160736083984375,
-0.00146484375,
-0.048919677734375,
0.0386962890625,
0.025238037109375,
-0.052276611328125,
0.0276336669921875,
0.0269317626953125,
0.01348114013671875,
0.0244598388671875,
-0.0034046173095703125,
-0.0114593505859375,
-0.00024139881134033203,
-0.00940704345703125,
0.0201873779296875,
0.00015425682067871094,
-0.0220794677734375,
0.005222320556640625,
-0.0147705078125,
-0.00885009765625,
-0.038055419921875,
0.042510986328125,
0.01345062255859375,
0.005435943603515625,
0.020355224609375,
-0.0231475830078125,
-0.0166473388671875,
0.01351165771484375,
-0.03076171875,
0.00585174560546875,
-0.039031982421875,
-0.11016845703125,
-0.037506103515625,
0.005084991455078125,
-0.08160400390625,
-0.043975830078125,
0.0931396484375,
-0.06024169921875,
-0.06719970703125,
0.08905029296875,
0.04779052734375,
0.0178680419921875,
-0.023712158203125,
0.0516357421875,
-0.042388916015625,
0.0262451171875,
0.013702392578125,
0.0103759765625,
-0.037933349609375,
-0.032440185546875,
0.018310546875,
0.018585205078125,
-0.0008597373962402344,
0.0132904052734375,
-0.032196044921875,
-0.01126861572265625,
-0.034393310546875,
0.0198211669921875,
0.040496826171875,
0.039154052734375,
0.02496337890625,
0.036407470703125,
0.028533935546875,
0.0019445419311523438,
0.01995849609375,
-0.0008392333984375,
0.042236328125,
-0.054473876953125,
-0.005092620849609375,
0.0247039794921875,
0.01177215576171875,
0.01194000244140625,
0.00933074951171875,
-0.0439453125,
0.01666259765625,
-0.004123687744140625,
-0.025482177734375,
-0.035400390625,
0.0013818740844726562,
0.0267791748046875,
0.00628662109375,
-0.0914306640625,
-0.093505859375,
-0.019683837890625,
0.006946563720703125,
-0.0124359130859375,
0.020233154296875,
-0.0195159912109375,
0.00780487060546875,
0.03912353515625,
-0.03997802734375,
-0.01274871826171875,
0.01459503173828125,
-0.0023441314697265625,
0.0024662017822265625,
-0.014129638671875,
0.00997161865234375,
-0.05859375,
-0.0288543701171875,
0.0389404296875,
0.021575927734375,
-0.0087432861328125,
-0.059844970703125,
-0.002880096435546875,
-0.01396942138671875,
-0.01137542724609375,
0.00394439697265625,
-0.0186920166015625,
-0.0245819091796875,
0.02508544921875,
0.038787841796875,
-0.025054931640625,
-0.0323486328125,
0.0142059326171875,
0.002208709716796875,
0.002666473388671875,
0.0299835205078125,
-0.01520538330078125,
-0.046539306640625,
-0.00506591796875,
0.005588531494140625,
0.0284271240234375,
0.03521728515625,
0.035888671875,
0.037445068359375,
-0.0140380859375,
-0.038787841796875,
0.037445068359375,
-0.0161590576171875,
0.0654296875,
-0.04132080078125,
-0.004703521728515625,
-0.00788116455078125,
0.04388427734375,
0.0282135009765625,
0.051422119140625,
-0.001880645751953125,
-0.005462646484375,
0.0394287109375,
0.01123046875,
-0.0157318115234375,
-0.015960693359375,
0.006603240966796875,
-0.057403564453125,
0.0279998779296875,
0.0131072998046875,
0.01062774658203125,
-0.009490966796875,
-0.01360321044921875,
0.05303955078125,
0.0201263427734375,
0.041656494140625,
0.006870269775390625,
-0.0037708282470703125,
0.030975341796875,
-0.04412841796875,
0.056976318359375,
0.024139404296875,
-0.026214599609375,
-0.005771636962890625,
0.06060791015625,
-0.0535888671875,
-0.001979827880859375,
0.05010986328125,
-0.023529052734375,
0.00884246826171875,
0.0131072998046875,
-0.01763916015625,
-0.04278564453125,
0.0290679931640625,
0.039031982421875,
0.0172882080078125,
-0.0036106109619140625,
0.0263519287109375,
-0.04168701171875,
-0.024566650390625,
-0.0007452964782714844,
0.03533935546875,
-0.01261138916015625,
0.068603515625,
-0.0250091552734375,
0.0167388916015625,
-0.025238037109375,
0.0478515625,
-0.0526123046875,
-0.023681640625,
0.0276031494140625,
0.004253387451171875,
0.0174560546875,
-0.01288604736328125,
-0.0200958251953125,
0.0447998046875,
0.003131866455078125,
-0.0029735565185546875,
-0.004810333251953125,
0.0015573501586914062,
0.007152557373046875,
0.0265960693359375,
-0.0113525390625,
-0.01447296142578125,
-0.00522613525390625,
0.0149688720703125,
-0.01385498046875,
0.010772705078125,
0.0245513916015625,
0.0222320556640625,
0.033966064453125,
0.01885986328125,
-0.013031005859375,
0.03594970703125,
-0.041290283203125,
0.07110595703125,
0.045074462890625,
-0.019989013671875,
-0.03192138671875,
0.0221405029296875,
0.0002739429473876953,
-0.0214080810546875,
0.035675048828125,
-0.004810333251953125,
0.0177154541015625,
-0.078369140625,
0.0200958251953125,
0.001697540283203125,
0.07415771484375,
0.00530242919921875,
0.02935791015625,
-0.0219879150390625,
0.032684326171875,
-0.0029087066650390625,
0.006717681884765625,
-0.0020885467529296875,
0.0269775390625,
-0.01453399658203125,
0.0146636962890625,
0.0234222412109375,
-0.0254669189453125,
-0.0546875,
-0.0034351348876953125,
0.018310546875,
0.0055084228515625,
-0.035064697265625,
0.00798797607421875,
-0.004749298095703125,
0.0247650146484375,
-0.00435638427734375,
-0.0184173583984375,
-0.0041961669921875,
0.0020046234130859375,
-0.04107666015625,
-0.0292510986328125,
-0.054107666015625,
0.0156707763671875,
-0.047027587890625,
0.00933837890625,
0.0592041015625,
-0.004180908203125,
-0.0478515625,
0.0105743408203125,
-0.0098876953125,
0.06195068359375,
-0.06842041015625,
-0.0261077880859375,
0.037506103515625,
-0.0256805419921875,
-0.02093505859375,
-0.032012939453125,
0.0242156982421875,
-0.0692138671875,
-0.01184844970703125,
0.0303497314453125,
-0.01464080810546875,
0.002376556396484375,
-0.0577392578125,
-0.1514892578125,
-0.0111541748046875,
0.004146575927734375,
-0.0587158203125,
0.0004589557647705078,
-0.0231475830078125,
-0.0099029541015625,
-0.0557861328125,
-0.00792694091796875,
-0.00954437255859375,
-0.0214691162109375,
0.01922607421875,
0.004055023193359375,
0.0194549560546875,
0.015289306640625,
-0.0016880035400390625,
-0.056488037109375,
0.00325775146484375,
0.00887298583984375,
-0.0024967193603515625,
0.0186309814453125,
-0.0065155029296875,
0.00974273681640625,
0.034332275390625,
-0.025543212890625,
-0.10699462890625,
-0.03948974609375,
-0.0623779296875,
0.0019664764404296875,
-0.03558349609375,
-0.06170654296875,
-0.036041259765625,
0.069091796875,
0.04241943359375,
0.0182952880859375,
-0.016448974609375,
0.0238037109375,
0.01450347900390625,
-0.0186004638671875,
0.01226043701171875,
-0.00453948974609375,
-0.0013399124145507812,
0.007198333740234375,
-0.02447509765625,
-0.007083892822265625,
-0.01361083984375,
-0.00405120849609375,
-0.045440673828125,
-0.017822265625,
-0.014556884765625,
0.006763458251953125,
-0.050384521484375,
0.0712890625,
0.115966796875,
-0.07696533203125,
-0.007289886474609375,
0.035430908203125,
-0.039764404296875,
0.060791015625,
-0.03375244140625,
0.01422882080078125,
-0.005825042724609375,
-0.006992340087890625,
0.008270263671875,
0.0183563232421875,
-0.01171875,
-0.0092010498046875,
-0.02740478515625,
-0.0195770263671875,
0.01953125,
0.0045318603515625,
0.0031452178955078125,
-0.0623779296875,
0.0479736328125,
0.01078033447265625,
0.08526611328125,
-0.04150390625,
0.00830078125,
-0.035675048828125,
0.038360595703125,
-0.01381683349609375,
0.0196533203125,
0.03466796875,
-0.003261566162109375,
0.0189666748046875,
0.01279449462890625,
0.041717529296875,
-0.0238037109375,
0.032562255859375,
-0.0283660888671875,
0.010650634765625,
0.0103912353515625
] |
de19769e504703f71e54092b6ebc4ba6c8c16fbd
|
Wordpress Stackexchange
Q: query_posts doesn't order by title It seems like stupid bug, but how can i order by title? It anyways orders by date! I'm using:
query_posts( array(
'post_type' => 'page',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC'
) );
I want to use this in function as SHORTCODE. What i'm trying to achieve is to create site map / index of all entries in alphabetic order.
Also i'm using newest WP.
A: Thanks to Chip Bennett who told me that i'm doing wrong by using query_posts inside content. So i used get_posts and i got what i wanted, thanks!
Here is sample of how can you do it, if you got the same problem as me:
function some_name(){
global $post;
$tmp_post = $post;
$args = array( 'post_type'=>'page', 'numberposts' => -1, 'orderby'=> 'title', 'order' => 'ASC' );
$myposts = get_posts( $args );
if ( !empty($myposts) ) {
foreach( $myposts as $post ) : setup_postdata($post);
the_title();
echo '<br>';
endforeach;
}
$post = $tmp_post;
}
|
Q: query_posts doesn't order by title It seems like stupid bug, but how can i order by title? It anyways orders by date! I'm using:
query_posts( array(
'post_type' => 'page',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC'
) );
I want to use this in function as SHORTCODE. What i'm trying to achieve is to create site map / index of all entries in alphabetic order.
Also i'm using newest WP.
A: Thanks to Chip Bennett who told me that i'm doing wrong by using query_posts inside content. So i used get_posts and i got what i wanted, thanks!
Here is sample of how can you do it, if you got the same problem as me:
function some_name(){
global $post;
$tmp_post = $post;
$args = array( 'post_type'=>'page', 'numberposts' => -1, 'orderby'=> 'title', 'order' => 'ASC' );
$myposts = get_posts( $args );
if ( !empty($myposts) ) {
foreach( $myposts as $post ) : setup_postdata($post);
the_title();
echo '<br>';
endforeach;
}
$post = $tmp_post;
}
A: Another post has this code inside a function, but for those looking to simply add alphabetized posts to a custom theme, for example, you can use the following...
<?php // Alphabetize posts from the *** category
global $post;
$temp_post = $post;
$args = array( 'category' => *categoryID*, 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC' );
$these_posts = get_posts( $args );
if( !empty($these_posts) ) {
foreach( $these_posts as $post ) : setup_postdata($post);
?>
<?php
/* HTML/PHP code goes here to display each post */
the_title("<h2>", "</h2>");
the_content("<div class='content'>", "</div>");
?>
<?php
endforeach; // End of The Loop.
}
$post = $temp_post;
?>
|
wordpress
|
{
"language": "en",
"length": 268,
"provenance": "stackexchange_00019.jsonl.gz:420583",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54347"
}
|
[
0.035400390625,
-0.00048804283142089844,
0.0215911865234375,
0.005550384521484375,
0.001129150390625,
-0.0212860107421875,
0.042327880859375,
-0.03167724609375,
0.035247802734375,
0.0185394287109375,
-0.018646240234375,
-0.0198211669921875,
-0.026885986328125,
-0.031280517578125,
-0.034637451171875,
-0.03289794921875,
0.043121337890625,
-0.03564453125,
0.0032806396484375,
-0.00923919677734375,
-0.00738525390625,
0.02032470703125,
0.04278564453125,
0.0281982421875,
0.030914306640625,
0.00795745849609375,
0.06842041015625,
-0.036102294921875,
0.0355224609375,
-0.007442474365234375,
0.0236663818359375,
-0.056243896484375,
0.0309295654296875,
-0.00881195068359375,
0.009185791015625,
0.0343017578125,
0.038055419921875,
-0.008758544921875,
0.022125244140625,
0.0165863037109375,
0.01169586181640625,
0.021148681640625,
0.038787841796875,
-0.006572723388671875,
0.003452301025390625,
-0.04779052734375,
0.041900634765625,
-0.015289306640625,
0.010009765625,
-0.05224609375,
0.0086822509765625,
0.010467529296875,
0.035125732421875,
-0.0180511474609375,
-0.03021240234375,
-0.006160736083984375,
0.0193939208984375,
-0.0034809112548828125,
0.0264892578125,
-0.034881591796875,
-0.047882080078125,
0.002349853515625,
0.0272216796875,
-0.0008292198181152344,
0.00855255126953125,
0.01824951171875,
0.06085205078125,
-0.005462646484375,
-0.034423828125,
0.01399993896484375,
0.044189453125,
-0.0198822021484375,
-0.0181121826171875,
-0.01175689697265625,
0.009368896484375,
0.00677490234375,
-0.0369873046875,
-0.055908203125,
0.0243377685546875,
0.034637451171875,
0.013275146484375,
-0.0322265625,
-0.036407470703125,
-0.024566650390625,
0.01300811767578125,
-0.033172607421875,
0.0012454986572265625,
0.01386260986328125,
-0.0222015380859375,
-0.0308380126953125,
-0.029266357421875,
0.0060882568359375,
0.0028629302978515625,
-0.0139923095703125,
-0.030242919921875,
-0.016693115234375,
0.0094757080078125,
0.0848388671875,
-0.02410888671875,
0.004451751708984375,
-0.038848876953125,
-0.0048370361328125,
-0.01113128662109375,
-0.048309326171875,
0.01064300537109375,
-0.02264404296875,
-0.017486572265625,
-0.0293731689453125,
0.0297088623046875,
0.04833984375,
-0.028717041015625,
0.0284881591796875,
-0.011199951171875,
-0.0002027750015258789,
-0.0184783935546875,
0.022216796875,
-0.05072021484375,
0.018585205078125,
-0.0011472702026367188,
0.031982421875,
0.02178955078125,
0.016937255859375,
0.0172882080078125,
-0.004150390625,
-0.017974853515625,
0.012237548828125,
-0.007663726806640625,
-0.05438232421875,
0.008544921875,
0.03741455078125,
-0.0211639404296875,
0.00582122802734375,
0.039825439453125,
-0.004852294921875,
-0.0199127197265625,
-0.0247802734375,
-0.003826141357421875,
-0.0584716796875,
-0.013031005859375,
-0.0193328857421875,
0.03131103515625,
-0.0008893013000488281,
0.0180206298828125,
-0.00304412841796875,
-0.00299072265625,
-0.0076904296875,
0.0048828125,
0.021575927734375,
-0.005962371826171875,
-0.0256500244140625,
0.0098724365234375,
-0.0128021240234375,
0.00830841064453125,
0.0180816650390625,
-0.044769287109375,
0.004901885986328125,
-0.034393310546875,
-0.009246826171875,
0.00493621826171875,
-0.0178375244140625,
0.0302581787109375,
0.00785064697265625,
-0.020538330078125,
-0.049407958984375,
-0.056640625,
-0.0298919677734375,
-0.010345458984375,
-0.0125732421875,
0.010650634765625,
0.0253448486328125,
0.0083770751953125,
-0.0219268798828125,
0.00374603271484375,
0.003208160400390625,
-0.0193634033203125,
0.0116729736328125,
-0.005504608154296875,
-0.055908203125,
0.029571533203125,
0.0080413818359375,
-0.037322998046875,
-0.0163726806640625,
-0.0261993408203125,
0.0090789794921875,
-0.053741455078125,
0.04241943359375,
0.00811004638671875,
0.05181884765625,
0.0015211105346679688,
0.0246429443359375,
0.0296478271484375,
0.034820556640625,
-0.07415771484375,
0.05487060546875,
0.0118560791015625,
-0.0386962890625,
-0.0038356781005859375,
-0.01898193359375,
0.0111236572265625,
-0.01107025146484375,
-0.0011625289916992188,
0.0018558502197265625,
-0.0070343017578125,
0.03497314453125,
-0.005084991455078125,
-0.01045989990234375,
0.005237579345703125,
-0.0005526542663574219,
0.01971435546875,
0.01983642578125,
0.0211639404296875,
0.00885772705078125,
-0.03570556640625,
-0.010955810546875,
-0.05413818359375,
-0.013916015625,
-0.015777587890625,
-0.0177001953125,
-0.0275115966796875,
0.02044677734375,
-0.047332763671875,
-0.01445770263671875,
-0.05267333984375,
0.04193115234375,
0.06927490234375,
-0.0236663818359375,
-0.0214996337890625,
-0.0283355712890625,
0.0198974609375,
-0.004390716552734375,
-0.059539794921875,
0.039459228515625,
-0.0253448486328125,
0.045166015625,
-0.0182647705078125,
-0.0144805908203125,
0.0045928955078125,
-0.00960540771484375,
0.03985595703125,
0.027740478515625,
0.048828125,
0.023681640625,
0.02850341796875,
0.0145721435546875,
0.031951904296875,
-0.0196990966796875,
0.0345458984375,
-0.0302581787109375,
0.029083251953125,
0.08978271484375,
0.035797119140625,
0.01483154296875,
-0.004940032958984375,
0.0281219482421875,
0.0108642578125,
0.029022216796875,
0.006076812744140625,
0.044219970703125,
-0.0133056640625,
-0.015777587890625,
0.005279541015625,
-0.0419921875,
-0.0237274169921875,
-0.01251983642578125,
0.0250244140625,
0.037933349609375,
0.034515380859375,
0.031280517578125,
-0.032806396484375,
0.0220794677734375,
-0.0095367431640625,
-0.01087188720703125,
0.03155517578125,
0.0093994140625,
-0.03704833984375,
-0.01471710205078125,
-0.0103607177734375,
-0.0084686279296875,
0.0355224609375,
-0.01568603515625,
0.00010061264038085938,
0.0244598388671875,
0.0013713836669921875,
0.006931304931640625,
-0.00959014892578125,
-0.061370849609375,
0.01092529296875,
0.038116455078125,
-0.021881103515625,
-0.0227203369140625,
-0.0029277801513671875,
0.042633056640625,
-0.0333251953125,
0.05706787109375,
0.011810302734375,
-0.002185821533203125,
0.0099639892578125,
-0.04852294921875,
0.030181884765625,
-0.05694580078125,
0.04229736328125,
0.055450439453125,
-0.01629638671875,
0.01251220703125,
-0.0028285980224609375,
0.01557159423828125,
-0.00901031494140625,
0.0007891654968261719,
-0.0240631103515625,
-0.008392333984375,
-0.058380126953125,
0.019134521484375,
0.047271728515625,
0.08905029296875,
0.02154541015625,
-0.04132080078125,
0.040283203125,
0.0704345703125,
-0.0797119140625,
-0.123046875,
-0.005237579345703125,
-0.0738525390625,
0.01800537109375,
-0.01506805419921875,
-0.033966064453125,
-0.013763427734375,
0.01715087890625,
0.0094757080078125,
0.006710052490234375,
-0.00965118408203125,
-0.033050537109375,
-0.0009756088256835938,
-0.03851318359375,
0.0265655517578125,
0.0026340484619140625,
0.01227569580078125,
0.01407623291015625,
0.07415771484375,
0.0216522216796875,
-0.038726806640625,
0.034576416015625,
0.04443359375,
-0.0250244140625,
0.0173492431640625,
0.005344390869140625,
-0.006275177001953125,
-0.0022525787353515625,
0.005199432373046875,
0.041595458984375,
0.024169921875,
-0.023040771484375,
0.00009196996688842773,
-0.01280975341796875,
0.01166534423828125,
0.006603240966796875,
0.0304107666015625,
0.0180816650390625,
0.0299530029296875,
0.02752685546875,
-0.02032470703125,
-0.01503753662109375,
-0.005573272705078125,
-0.051300048828125,
-0.020111083984375,
0.035919189453125,
-0.00649261474609375,
-0.031402587890625,
-0.00197601318359375,
0.004276275634765625,
0.0237274169921875,
0.01385498046875,
-0.01346588134765625,
0.017578125,
0.00986480712890625,
0.01001739501953125,
-0.017578125,
-0.0081634521484375,
-0.0110931396484375,
-0.0083770751953125,
-0.004283905029296875,
0.016998291015625,
-0.00337982177734375,
-0.00240325927734375,
-0.034149169921875,
-0.043731689453125,
0.048492431640625,
-0.0037384033203125,
0.01432037353515625,
-0.0335693359375,
-0.044708251953125,
-0.0014925003051757812,
0.072998046875,
-0.039337158203125,
-0.0227203369140625,
0.01224517822265625,
0.020904541015625,
-0.052490234375,
-0.049652099609375,
-0.0277252197265625,
-0.009063720703125,
-0.05181884765625,
0.00466156005859375,
-0.008087158203125,
-0.01250457763671875,
-0.023895263671875,
0.00945281982421875,
-0.037078857421875,
-0.017791748046875,
0.0234527587890625,
-0.0036640167236328125,
0.033416748046875,
0.009613037109375,
-0.0002161264419555664,
0.0138702392578125,
-0.030120849609375,
-0.00141143798828125,
-0.088623046875,
-0.0071258544921875,
0.00543212890625,
0.053009033203125,
-0.0173797607421875,
-0.01259613037109375,
-0.022613525390625,
0.046234130859375,
0.00925445556640625,
0.00341033935546875,
0.005161285400390625,
-0.009979248046875,
-0.004795074462890625,
-0.008087158203125,
-0.019317626953125,
-0.032135009765625,
-0.0068511962890625,
0.004817962646484375,
0.006710052490234375,
0.0372314453125,
-0.041717529296875,
-0.0093231201171875,
-0.027099609375,
-0.018646240234375,
-0.028656005859375,
-0.037689208984375,
0.016357421875,
0.015960693359375,
-0.031402587890625,
0.0242156982421875,
-0.03802490234375,
-0.0416259765625,
0.032958984375,
-0.0004930496215820312,
-0.0014801025390625,
-0.0017995834350585938,
0.056610107421875,
0.002902984619140625,
-0.0172576904296875,
-0.054168701171875,
-0.009185791015625,
0.042572021484375,
-0.008941650390625,
0.0188751220703125,
-0.01806640625,
-0.051116943359375,
0.0860595703125,
-0.002574920654296875,
-0.03582763671875,
0.01448822021484375,
0.033447265625,
0.01169586181640625,
-0.034210205078125,
0.00975799560546875,
-0.01488494873046875,
0.005008697509765625,
0.0300140380859375,
0.007465362548828125,
-0.0259857177734375,
0.011962890625,
0.040191650390625,
0.006908416748046875,
0.016021728515625,
-0.01617431640625,
-0.03546142578125,
0.01476287841796875,
0.006488800048828125,
-0.0228118896484375,
0.006175994873046875,
0.005001068115234375,
-0.0079345703125,
-0.007083892822265625,
0.01488494873046875,
0.0272979736328125,
0.05316162109375,
-0.0120391845703125,
0.054779052734375,
0.00594329833984375,
0.005527496337890625,
-0.01093292236328125,
-0.0180206298828125,
0.08099365234375,
0.0094757080078125,
-0.0294036865234375,
0.0033740997314453125,
-0.033050537109375,
0.032135009765625,
-0.005649566650390625,
0.01251220703125,
0.0216827392578125,
0.03277587890625,
0.033416748046875,
0.0107574462890625,
-0.006885528564453125,
0.044647216796875,
0.0045928955078125,
0.040130615234375,
0.02862548828125,
-0.0222320556640625,
-0.0162200927734375,
0.045257568359375,
-0.028106689453125,
0.006137847900390625,
-0.0076751708984375,
0.0202484130859375,
0.007419586181640625,
0.0295562744140625,
0.01322174072265625,
0.0009446144104003906,
-0.003620147705078125,
0.02740478515625,
0.0213165283203125,
-0.0249786376953125,
-0.0166168212890625,
0.0079345703125,
0.008148193359375,
0.0003409385681152344,
0.00862884521484375,
0.021148681640625,
0.016998291015625,
-0.01110076904296875,
0.037933349609375,
0.044891357421875,
-0.01131439208984375,
-0.043914794921875,
-0.059600830078125,
0.0176544189453125,
0.015838623046875,
-0.005359649658203125,
0.006282806396484375,
-0.005184173583984375,
0.032135009765625,
-0.03106689453125,
0.024383544921875,
-0.01285552978515625,
-0.0330810546875,
0.034454345703125,
-0.027740478515625,
-0.0207672119140625,
0.04205322265625,
0.01558685302734375,
-0.0106964111328125,
-0.006359100341796875,
0.0277862548828125,
-0.01546478271484375,
0.08697509765625,
-0.0943603515625,
0.0234832763671875,
-0.033477783203125,
0.005859375,
0.0185546875,
0.01081085205078125,
-0.0246124267578125,
0.011444091796875,
-0.0295257568359375,
-0.0167694091796875,
-0.0197296142578125,
-0.060760498046875,
-0.054534912109375,
-0.04449462890625,
-0.0014238357543945312,
0.0175628662109375,
-0.019012451171875,
-0.036376953125,
-0.015411376953125,
-0.004711151123046875,
0.003482818603515625,
0.0095977783203125,
-0.00008094310760498047,
0.06781005859375,
-0.0193634033203125,
0.0489501953125,
0.011138916015625,
0.016204833984375,
-0.0252227783203125,
-0.007282257080078125,
0.029632568359375,
-0.06451416015625,
-0.059967041015625,
0.0030689239501953125,
-0.077880859375,
0.0030536651611328125,
0.0179595947265625,
-0.019561767578125,
0.024383544921875,
0.0134429931640625,
0.001834869384765625,
-0.0004563331604003906,
-0.03564453125,
0.003932952880859375,
-0.00896453857421875,
0.050445556640625,
-0.017364501953125,
0.0102386474609375,
-0.00766754150390625,
-0.00911712646484375,
0.0261077880859375,
-0.022125244140625,
0.0234832763671875,
0.00698089599609375,
-0.03857421875,
0.037384033203125,
0.09796142578125,
0.03594970703125,
0.051422119140625,
0.0233154296875,
0.01355743408203125,
0.00511932373046875,
-0.00315093994140625,
0.039947509765625,
-0.0231475830078125,
0.0799560546875,
0.0015087127685546875,
-0.0224151611328125,
0.04046630859375,
-0.047454833984375,
0.01032257080078125,
0.0164794921875,
0.05255126953125,
-0.027862548828125,
0.0121917724609375,
0.0222320556640625,
-0.00899505615234375,
0.0226898193359375,
-0.0030689239501953125,
0.007659912109375,
-0.00936126708984375,
0.051605224609375,
-0.005474090576171875,
-0.0107421875,
0.0236968994140625,
-0.01537322998046875,
-0.0075225830078125,
-0.00382232666015625,
0.052825927734375,
0.0113983154296875,
-0.039520263671875,
-0.0296478271484375,
0.0203094482421875,
-0.01369476318359375,
-0.0298614501953125,
0.0149688720703125,
0.0082550048828125,
-0.004245758056640625,
-0.0836181640625,
0.01221466064453125,
-0.016693115234375,
-0.00647735595703125,
0.0020084381103515625,
-0.00756072998046875,
0.001132965087890625,
0.0399169921875,
-0.0197296142578125,
0.003139495849609375,
0.0207977294921875,
-0.035400390625,
-0.0071563720703125,
-0.01093292236328125,
0.0157928466796875,
0.00019228458404541016,
0.01433563232421875,
0.0259246826171875,
0.004791259765625,
-0.046295166015625,
-0.0015735626220703125,
0.00466156005859375,
0.01056671142578125,
-0.0201263427734375,
-0.018402099609375,
0.02923583984375,
0.0267791748046875,
0.00623321533203125,
0.00710296630859375,
0.01328277587890625,
-0.02532958984375,
0.00662994384765625,
0.017333984375,
0.004749298095703125,
-0.038421630859375,
-0.0095977783203125,
-0.052581787109375,
0.0972900390625,
-0.002101898193359375,
0.0033626556396484375,
-0.006252288818359375,
0.04498291015625,
-0.02081298828125,
0.02734375,
-0.051605224609375,
0.051727294921875,
-0.00250244140625,
0.08770751953125,
-0.09271240234375,
-0.03302001953125,
0.01348876953125,
0.066162109375,
0.049652099609375,
0.005126953125,
-0.0650634765625,
-0.0058441162109375,
0.0697021484375,
0.083984375,
0.0396728515625,
0.0257720947265625,
0.01165771484375,
0.0479736328125,
0.0435791015625,
0.0138702392578125,
0.054351806640625,
-0.0268707275390625,
-0.038726806640625,
0.041534423828125,
0.020965576171875,
0.004360198974609375,
0.0129547119140625,
-0.03924560546875,
-0.05487060546875,
0.01490020751953125,
0.040771484375,
0.032257080078125,
0.021514892578125,
0.01904296875,
0.046142578125,
-0.06634521484375,
-0.0587158203125,
-0.01369476318359375,
0.042816162109375,
0.0244903564453125,
0.0367431640625,
0.035186767578125,
0.0421142578125,
0.0205841064453125,
-0.03778076171875,
0.014678955078125,
-0.00972747802734375,
-0.034881591796875,
0.06884765625,
0.0166778564453125,
0.01488494873046875,
-0.0687255859375,
-0.0382080078125,
0.0762939453125,
0.103759765625,
-0.04541015625,
0.01024627685546875,
0.024749755859375,
-0.01081085205078125,
-0.0174560546875,
-0.063232421875,
-0.0479736328125,
0.002899169921875,
0.00760650634765625,
-0.03265380859375,
-0.0176544189453125,
0.025665283203125,
0.037017822265625,
0.0007281303405761719,
-0.01387786865234375,
-0.03228759765625,
-0.02923583984375,
-0.021026611328125,
0.0283355712890625,
0.033294677734375,
0.047210693359375,
-0.0272064208984375,
0.08966064453125,
-0.06439208984375,
-0.0141754150390625,
-0.0035800933837890625,
0.0293121337890625,
-0.01313018798828125,
0.0096588134765625,
-0.01403045654296875,
-0.037506103515625,
-0.0640869140625,
0.03387451171875,
0.04254150390625,
0.01232147216796875,
0.05364990234375,
0.06304931640625,
-0.0002593994140625,
-0.006725311279296875,
0.0394287109375,
0.003162384033203125,
-0.01934814453125,
0.00835418701171875,
-0.01226043701171875,
0.0008454322814941406,
-0.018890380859375,
0.013031005859375,
0.0634765625,
-0.0223388671875,
-0.0188140869140625,
0.054290771484375,
-0.01276397705078125,
-0.0004930496215820312,
0.0310821533203125,
0.0030879974365234375,
0.0750732421875,
0.005596160888671875,
-0.039764404296875,
-0.013763427734375,
-0.00833892822265625,
-0.05413818359375,
0.033294677734375,
0.0516357421875,
0.0074310302734375,
-0.0141448974609375,
0.01093292236328125,
-0.03875732421875,
0.004329681396484375,
0.02264404296875,
0.016937255859375,
0.0193328857421875,
0.005931854248046875,
-0.0053558349609375,
-0.0293426513671875,
-0.025177001953125,
-0.006992340087890625,
0.030975341796875,
-0.00579833984375,
0.02276611328125,
0.0108184814453125,
0.0222320556640625,
-0.023284912109375,
0.01229095458984375,
-0.03436279296875,
-0.033416748046875,
0.05157470703125,
-0.01372528076171875,
-0.004047393798828125,
-0.0017385482788085938,
0.03167724609375,
0.0022068023681640625,
0.05767822265625,
-0.020172119140625,
-0.007099151611328125,
-0.03399658203125,
0.032928466796875,
-0.0379638671875,
0.01190948486328125,
-0.021728515625,
0.043426513671875,
0.01328277587890625,
-0.034332275390625,
0.0325927734375,
-0.0030422210693359375,
0.01132965087890625,
0.01397705078125,
0.0208282470703125,
-0.045501708984375,
0.046295166015625,
-0.036651611328125,
0.07330322265625,
0.034820556640625,
0.008697509765625,
-0.00739288330078125,
0.0003159046173095703,
-0.004425048828125,
0.0020885467529296875,
0.034698486328125,
-0.027099609375,
0.0238494873046875,
-0.0189666748046875,
-0.0041656494140625,
0.00731658935546875,
0.0684814453125,
0.01116180419921875,
0.0289154052734375,
-0.01611328125,
-0.0013322830200195312,
-0.041748046875,
0.044189453125,
-0.033905029296875,
-0.034820556640625,
0.0260467529296875,
-0.01020050048828125,
0.018157958984375,
-0.01183319091796875,
-0.021270751953125,
-0.0174713134765625,
-0.0063629150390625,
-0.0193023681640625,
0.0250091552734375,
-0.00688934326171875,
-0.0260467529296875,
-0.045562744140625,
-0.01317596435546875,
-0.042999267578125,
0.01300811767578125,
0.00838470458984375,
-0.01073455810546875,
0.017303466796875,
-0.0572509765625,
-0.0249176025390625,
0.0005412101745605469,
0.010406494140625,
0.031768798828125,
-0.013336181640625,
-0.04339599609375,
0.020111083984375,
-0.020904541015625,
0.058807373046875,
-0.0155181884765625,
0.007244110107421875,
0.056732177734375,
0.010986328125,
-0.07275390625,
-0.11431884765625,
0.02374267578125,
-0.063232421875,
0.0103302001953125,
-0.0002796649932861328,
0.005870819091796875,
0.021026611328125,
-0.0217437744140625,
-0.032684326171875,
0.0667724609375,
-0.01056671142578125,
-0.0205841064453125,
-0.046905517578125,
0.0155487060546875,
-0.005413055419921875,
0.0242462158203125,
0.0229034423828125,
-0.057220458984375,
-0.0217132568359375,
-0.0002598762512207031,
0.005321502685546875,
0.06072998046875,
0.0032672882080078125,
0.05096435546875,
-0.0684814453125,
0.0052337646484375,
-0.0504150390625,
-0.032135009765625,
0.0245361328125,
-0.0290679931640625,
0.057586669921875,
0.0318603515625,
-0.021331787109375,
0.0202178955078125,
0.0183258056640625,
-0.01187896728515625,
-0.01419830322265625,
-0.0210113525390625,
-0.037567138671875,
0.00030922889709472656,
0.0160369873046875,
0.1072998046875,
0.01190185546875,
-0.0504150390625,
0.0037784576416015625,
0.0177459716796875,
0.002452850341796875,
-0.0246734619140625,
0.01221466064453125,
-0.0521240234375,
-0.047607421875,
-0.01343536376953125,
-0.01335906982421875,
0.01125335693359375,
-0.0296478271484375,
-0.01885986328125,
-0.02130126953125,
-0.0258331298828125,
-0.01137542724609375,
-0.0016307830810546875,
0.004024505615234375,
0.044097900390625,
-0.048065185546875,
-0.0268096923828125,
-0.0005621910095214844,
0.00457000732421875,
-0.010589599609375,
-0.03363037109375,
-0.007122039794921875,
0.037261962890625,
-0.017181396484375,
-0.00919342041015625,
0.0258636474609375,
0.007541656494140625,
0.00846099853515625,
0.0092315673828125,
-0.0274658203125,
0.01383209228515625,
0.0162506103515625,
-0.00324249267578125,
-0.029815673828125,
0.06195068359375,
0.0164642333984375,
0.05279541015625,
-0.00730133056640625,
0.055389404296875,
0.0190277099609375,
0.0279693603515625,
0.00601959228515625,
-0.0163726806640625,
0.030426025390625,
-0.0360107421875,
0.000027835369110107422,
0.0169219970703125,
0.0209197998046875,
0.016754150390625,
-0.0165557861328125,
-0.025390625,
-0.0130462646484375,
-0.0175323486328125
] |
ddb07eda7260fbff93e01880b4fac96dfecca8bb
|
Wordpress Stackexchange
Q: has_archive=false on the default post type On the default post type, why does the has_archive property equals to FALSE?
$type_obj = get_post_type_object('post');
var_dump($type_obj->has_archive); // FALSE
A: Late answer.
has_archive applies only for the rewrite arguments.
In Detail
If has_archive is set to true, then the $archive_slug will get set to the rewrite['slug'] argument. If then a rewrite['with_front'] arg is set, then this one will get prepended. The result of this will then get added as rewrite rule:
add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
If feeds are set to true and has_archive also, then you'll also get rewritten rules for feeds:
add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
The same principle applies for rewrite['pages']:
add_rewrite_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' );
Summed up:
If you ain't got has_archive set to true, then any try to add rewrites for feeds, pages or archives will end up with a big ?.
|
Q: has_archive=false on the default post type On the default post type, why does the has_archive property equals to FALSE?
$type_obj = get_post_type_object('post');
var_dump($type_obj->has_archive); // FALSE
A: Late answer.
has_archive applies only for the rewrite arguments.
In Detail
If has_archive is set to true, then the $archive_slug will get set to the rewrite['slug'] argument. If then a rewrite['with_front'] arg is set, then this one will get prepended. The result of this will then get added as rewrite rule:
add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
If feeds are set to true and has_archive also, then you'll also get rewritten rules for feeds:
add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
The same principle applies for rewrite['pages']:
add_rewrite_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' );
Summed up:
If you ain't got has_archive set to true, then any try to add rewrites for feeds, pages or archives will end up with a big ?.
|
wordpress
|
{
"language": "en",
"length": 155,
"provenance": "stackexchange_00019.jsonl.gz:420585",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54357"
}
|
[
0.06329345703125,
-0.0145111083984375,
0.0247039794921875,
-0.052215576171875,
-0.0033054351806640625,
-0.00984954833984375,
0.0404052734375,
-0.0118865966796875,
-0.0225067138671875,
-0.0167236328125,
0.0254058837890625,
-0.015899658203125,
0.0015630722045898438,
-0.0584716796875,
0.04144287109375,
-0.003795623779296875,
0.0299530029296875,
-0.0265045166015625,
0.0113067626953125,
-0.01029205322265625,
0.021728515625,
-0.0023136138916015625,
0.031494140625,
0.034881591796875,
0.03228759765625,
-0.03369140625,
0.042144775390625,
-0.0127410888671875,
-0.0015497207641601562,
-0.02642822265625,
0.0223541259765625,
0.005390167236328125,
0.042633056640625,
-0.00970458984375,
-0.004497528076171875,
0.026947021484375,
-0.0201263427734375,
0.0005426406860351562,
-0.0005998611450195312,
0.005245208740234375,
0.0014505386352539062,
-0.0089569091796875,
0.044525146484375,
-0.036468505859375,
0.014373779296875,
-0.0145416259765625,
0.0078125,
-0.05010986328125,
0.019744873046875,
0.00848388671875,
-0.0178680419921875,
0.047119140625,
-0.0241851806640625,
-0.00618743896484375,
0.0021514892578125,
0.02117919921875,
0.031890869140625,
-0.04046630859375,
0.0221405029296875,
-0.035980224609375,
-0.03143310546875,
0.01406097412109375,
0.0244293212890625,
0.005100250244140625,
-0.0179595947265625,
-0.00506591796875,
0.0021572113037109375,
0.00972747802734375,
-0.03802490234375,
-0.00391387939453125,
0.03900146484375,
-0.0261383056640625,
0.003955841064453125,
-0.00661468505859375,
-0.0012187957763671875,
-0.034820556640625,
0.0126190185546875,
-0.01340484619140625,
-0.0017442703247070312,
0.0238189697265625,
0.00975799560546875,
-0.0178985595703125,
-0.01239013671875,
-0.01049041748046875,
0.0170745849609375,
0.0045013427734375,
-0.004085540771484375,
-0.01003265380859375,
-0.02984619140625,
-0.0208282470703125,
-0.0009822845458984375,
-0.0433349609375,
-0.0187225341796875,
-0.0184326171875,
0.014984130859375,
-0.040191650390625,
0.0404052734375,
0.0255126953125,
0.01324462890625,
-0.0008940696716308594,
0.0027446746826171875,
-0.057891845703125,
0.040740966796875,
-0.03753662109375,
0.021759033203125,
0.02545166015625,
-0.0045013427734375,
0.007305145263671875,
0.058258056640625,
-0.00041866302490234375,
-0.00513458251953125,
0.0810546875,
-0.017913818359375,
0.00428009033203125,
-0.01546478271484375,
-0.01318359375,
-0.08819580078125,
0.0308685302734375,
-0.013153076171875,
0.0277557373046875,
0.00963592529296875,
0.026641845703125,
0.0169525146484375,
-0.034637451171875,
-0.00757598876953125,
0.00839996337890625,
-0.0220489501953125,
-0.045684814453125,
0.02496337890625,
0.05621337890625,
-0.004512786865234375,
-0.0220947265625,
-0.017303466796875,
0.003246307373046875,
-0.01044464111328125,
-0.0188140869140625,
0.01172637939453125,
-0.0621337890625,
-0.0433349609375,
0.04437255859375,
-0.01313018798828125,
-0.04339599609375,
-0.00624847412109375,
-0.006305694580078125,
-0.0179290771484375,
0.029571533203125,
0.0262298583984375,
0.0031833648681640625,
-0.030670166015625,
-0.0596923828125,
-0.005443572998046875,
-0.041259765625,
0.036407470703125,
0.01513671875,
-0.07366943359375,
-0.0293731689453125,
0.00867462158203125,
-0.0218963623046875,
-0.021087646484375,
-0.0662841796875,
0.00006848573684692383,
-0.005939483642578125,
0.0292816162109375,
-0.0494384765625,
-0.0728759765625,
0.0119171142578125,
-0.057342529296875,
-0.01555633544921875,
0.0202789306640625,
-0.003940582275390625,
0.037506103515625,
0.01271820068359375,
0.017608642578125,
0.006130218505859375,
-0.0004553794860839844,
-0.0210113525390625,
0.0237884521484375,
-0.0074920654296875,
-0.00193023681640625,
0.068115234375,
0.0081024169921875,
-0.037322998046875,
-0.017364501953125,
-0.0058441162109375,
-0.07342529296875,
0.050628662109375,
0.020660400390625,
0.07269287109375,
-0.004367828369140625,
0.016693115234375,
0.050079345703125,
0.028045654296875,
-0.036163330078125,
0.00453948974609375,
0.004238128662109375,
-0.0050506591796875,
-0.00678253173828125,
-0.0095367431640625,
-0.021759033203125,
0.0060882568359375,
-0.011627197265625,
0.005802154541015625,
-0.01715087890625,
0.00913238525390625,
-0.0433349609375,
-0.006439208984375,
-0.017303466796875,
0.0325927734375,
0.01099395751953125,
0.03033447265625,
0.00923919677734375,
0.007511138916015625,
-0.037139892578125,
0.0323486328125,
0.006587982177734375,
0.0262603759765625,
-0.00830841064453125,
-0.0003402233123779297,
-0.043701171875,
0.01003265380859375,
-0.038970947265625,
-0.03277587890625,
-0.036773681640625,
0.027099609375,
0.06195068359375,
0.007511138916015625,
-0.01270294189453125,
-0.0264129638671875,
0.018096923828125,
0.03546142578125,
-0.085205078125,
0.0328369140625,
0.05316162109375,
0.0197906494140625,
-0.0288848876953125,
0.0164794921875,
-0.001125335693359375,
-0.061737060546875,
-0.0026531219482421875,
0.058624267578125,
0.0225372314453125,
0.038818359375,
-0.0396728515625,
-0.007183074951171875,
0.019073486328125,
-0.01238250732421875,
0.0196533203125,
-0.0258636474609375,
0.00913238525390625,
0.05230712890625,
0.0165863037109375,
0.0248565673828125,
-0.0012102127075195312,
-0.038238525390625,
0.01111602783203125,
0.0313720703125,
0.027801513671875,
0.0311279296875,
-0.00838470458984375,
0.025909423828125,
-0.01194000244140625,
0.043792724609375,
0.0035915374755859375,
0.0142822265625,
0.0309906005859375,
0.007171630859375,
0.035736083984375,
0.01197052001953125,
-0.02203369140625,
0.007904052734375,
0.01247406005859375,
-0.007694244384765625,
-0.00606536865234375,
0.03363037109375,
0.06524658203125,
0.013458251953125,
-0.0252227783203125,
-0.004207611083984375,
0.0017852783203125,
0.01128387451171875,
-0.013427734375,
0.0124664306640625,
0.004360198974609375,
-0.007495880126953125,
-0.021148681640625,
-0.05718994140625,
0.0140838623046875,
0.0335693359375,
0.0160064697265625,
-0.004505157470703125,
0.01229095458984375,
0.026763916015625,
-0.017913818359375,
0.035675048828125,
0.04541015625,
-0.0284576416015625,
-0.00997161865234375,
-0.056884765625,
0.04095458984375,
-0.028900146484375,
0.045257568359375,
0.06964111328125,
-0.0006594657897949219,
0.01052093505859375,
0.007030487060546875,
0.0037174224853515625,
-0.00490570068359375,
0.0303192138671875,
-0.0186309814453125,
-0.0143585205078125,
-0.05072021484375,
-0.0012254714965820312,
0.0216522216796875,
-0.009735107421875,
0.03997802734375,
-0.004474639892578125,
-0.00482177734375,
0.023681640625,
-0.0322265625,
-0.058746337890625,
0.04827880859375,
-0.09478759765625,
-0.004360198974609375,
0.005817413330078125,
-0.054351806640625,
-0.0252685546875,
0.0650634765625,
-0.007007598876953125,
-0.00862884521484375,
-0.0005092620849609375,
-0.04510498046875,
-0.0537109375,
-0.0743408203125,
0.0020389556884765625,
-0.004840850830078125,
0.0172271728515625,
0.011322021484375,
0.044708251953125,
0.0277252197265625,
-0.0293426513671875,
0.053192138671875,
0.0295867919921875,
-0.034149169921875,
0.007762908935546875,
-0.021881103515625,
0.0014410018920898438,
0.036895751953125,
-0.0089874267578125,
0.0626220703125,
0.042022705078125,
-0.0240936279296875,
0.01006317138671875,
-0.00966644287109375,
-0.0284271240234375,
-0.004947662353515625,
0.050262451171875,
0.017333984375,
-0.01067352294921875,
0.033355712890625,
-0.0389404296875,
-0.049957275390625,
-0.002044677734375,
-0.038055419921875,
0.0060577392578125,
0.0216827392578125,
0.0172576904296875,
-0.0214996337890625,
0.01363372802734375,
-0.0090179443359375,
0.0015697479248046875,
0.03997802734375,
-0.04925537109375,
0.052001953125,
-0.03765869140625,
-0.0204315185546875,
-0.04888916015625,
0.052032470703125,
-0.0172576904296875,
0.020355224609375,
0.043121337890625,
-0.00873565673828125,
0.0066070556640625,
-0.00605010986328125,
-0.01039886474609375,
-0.040283203125,
0.0113372802734375,
-0.061737060546875,
0.0027294158935546875,
-0.048065185546875,
0.0204925537109375,
-0.027801513671875,
0.0279083251953125,
-0.0146942138671875,
-0.01403045654296875,
0.0011272430419921875,
0.015777587890625,
0.0038909912109375,
-0.06500244140625,
-0.0002799034118652344,
-0.022369384765625,
-0.024017333984375,
0.0140533447265625,
-0.00732421875,
-0.018463134765625,
0.00005328655242919922,
-0.045135498046875,
0.01099395751953125,
-0.032379150390625,
0.05853271484375,
0.0023784637451171875,
0.0005578994750976562,
0.046875,
-0.009185791015625,
0.02374267578125,
-0.07373046875,
0.0131988525390625,
-0.11151123046875,
-0.005222320556640625,
0.00036907196044921875,
0.05194091796875,
-0.01529693603515625,
0.00485992431640625,
-0.01407623291015625,
0.060638427734375,
0.019866943359375,
-0.042755126953125,
0.0205535888671875,
-0.0180511474609375,
-0.0345458984375,
0.00492095947265625,
-0.015625,
-0.0255584716796875,
0.036529541015625,
0.0037250518798828125,
-0.045654296875,
-0.031585693359375,
-0.05816650390625,
-0.007747650146484375,
-0.011474609375,
-0.039306640625,
-0.05963134765625,
-0.034576416015625,
-0.0308837890625,
0.0113067626953125,
0.0009579658508300781,
-0.025177001953125,
-0.065673828125,
-0.069580078125,
0.0217132568359375,
-0.0035762786865234375,
-0.047332763671875,
0.0225830078125,
0.0394287109375,
0.01690673828125,
-0.01482391357421875,
-0.041107177734375,
-0.0239410400390625,
-0.0029926300048828125,
-0.0022907257080078125,
0.05242919921875,
0.030487060546875,
0.0184173583984375,
0.02227783203125,
-0.0308990478515625,
-0.0000393986701965332,
-0.041717529296875,
0.032196044921875,
-0.0172271728515625,
-0.028045654296875,
0.0253753662109375,
-0.044952392578125,
0.05865478515625,
0.0450439453125,
-0.00824737548828125,
-0.017791748046875,
-0.00865936279296875,
0.0479736328125,
-0.033172607421875,
0.0218658447265625,
-0.058624267578125,
-0.0025463104248046875,
-0.00726318359375,
0.0276336669921875,
0.031036376953125,
0.0219268798828125,
-0.0017614364624023438,
0.0052032470703125,
0.020538330078125,
0.0108642578125,
0.006061553955078125,
0.029266357421875,
0.01081085205078125,
0.03167724609375,
0.0248870849609375,
0.0273284912109375,
-0.045928955078125,
0.0104522705078125,
0.00946044921875,
-0.0196685791015625,
-0.05303955078125,
-0.01837158203125,
-0.0015869140625,
0.0274200439453125,
0.0235137939453125,
-0.00922393798828125,
0.056396484375,
0.0193634033203125,
-0.032684326171875,
0.0002465248107910156,
-0.03460693359375,
-0.01049041748046875,
-0.0643310546875,
0.022735595703125,
0.007610321044921875,
-0.005603790283203125,
0.002777099609375,
0.0635986328125,
0.029571533203125,
0.0212860107421875,
-0.0238037109375,
-0.0164642333984375,
0.0117645263671875,
0.032196044921875,
0.023773193359375,
0.01003265380859375,
-0.023895263671875,
0.032684326171875,
0.034637451171875,
-0.0269775390625,
0.0007805824279785156,
0.049407958984375,
0.045196533203125,
-0.0216522216796875,
-0.0305633544921875,
-0.0012569427490234375,
-0.029693603515625,
-0.0185089111328125,
0.0193634033203125,
0.0153350830078125,
-0.01435089111328125,
-0.023956298828125,
-0.01473236083984375,
0.0169219970703125,
-0.002979278564453125,
-0.02362060546875,
0.03009033203125,
-0.04083251953125,
0.015716552734375,
0.0271148681640625,
-0.042816162109375,
0.0139923095703125,
0.0230255126953125,
-0.00019156932830810547,
-0.020782470703125,
0.02130126953125,
-0.02374267578125,
0.037567138671875,
-0.0439453125,
-0.043121337890625,
0.0677490234375,
-0.0116424560546875,
0.02142333984375,
-0.01788330078125,
-0.0229339599609375,
0.00841522216796875,
0.0024127960205078125,
0.04058837890625,
0.007808685302734375,
-0.007762908935546875,
0.0097503662109375,
-0.06964111328125,
-0.024017333984375,
-0.00010031461715698242,
-0.0308990478515625,
-0.018646240234375,
-0.00931549072265625,
-0.023651123046875,
0.0236053466796875,
-0.0198822021484375,
0.0198974609375,
-0.01389312744140625,
0.027008056640625,
-0.0018949508666992188,
0.059600830078125,
-0.019500732421875,
0.0733642578125,
-0.050689697265625,
0.04315185546875,
-0.03173828125,
-0.00566864013671875,
-0.0347900390625,
0.023834228515625,
0.00366973876953125,
-0.061981201171875,
-0.024810791015625,
0.00415802001953125,
-0.0341796875,
0.0309906005859375,
0.0482177734375,
-0.00927734375,
-0.01029205322265625,
-0.018890380859375,
-0.0141448974609375,
-0.032012939453125,
0.078369140625,
-0.033538818359375,
0.0240936279296875,
-0.0266876220703125,
-0.0023040771484375,
0.040313720703125,
-0.0302276611328125,
-0.0293731689453125,
-0.006267547607421875,
-0.0209503173828125,
0.01812744140625,
0.01230621337890625,
-0.057708740234375,
0.046234130859375,
0.060943603515625,
0.0096588134765625,
0.052490234375,
0.005229949951171875,
0.02197265625,
0.0614013671875,
0.0159149169921875,
0.00705718994140625,
0.024566650390625,
0.037078857421875,
-0.0039043426513671875,
0.036285400390625,
0.02618408203125,
0.0014190673828125,
0.018768310546875,
0.0249176025390625,
0.054901123046875,
-0.042938232421875,
-0.0007405281066894531,
0.0178680419921875,
-0.0302276611328125,
-0.00272369384765625,
0.040802001953125,
0.005840301513671875,
0.04022216796875,
-0.0181121826171875,
-0.01464080810546875,
-0.023162841796875,
0.0084381103515625,
0.027923583984375,
0.007740020751953125,
0.0016298294067382812,
0.0222320556640625,
0.00489044189453125,
0.0135345458984375,
-0.0430908203125,
0.00702667236328125,
-0.0089874267578125,
-0.00937652587890625,
0.0004620552062988281,
-0.0199737548828125,
-0.0506591796875,
-0.02740478515625,
0.0013322830200195312,
-0.01032257080078125,
0.00914764404296875,
0.052032470703125,
0.0160064697265625,
0.01287078857421875,
0.0078277587890625,
0.01812744140625,
0.00414276123046875,
-0.0273590087890625,
-0.0185699462890625,
-0.07080078125,
-0.0311279296875,
0.0316162109375,
0.020843505859375,
0.0025997161865234375,
0.025787353515625,
-0.0170440673828125,
-0.08349609375,
-0.032379150390625,
-0.0745849609375,
0.077880859375,
-0.0413818359375,
-0.00044035911560058594,
-0.0220489501953125,
0.05682373046875,
0.031585693359375,
-0.0115509033203125,
0.0028476715087890625,
-0.07940673828125,
-0.041595458984375,
-0.00554656982421875,
-0.046051025390625,
0.01377105712890625,
-0.0088348388671875,
-0.05694580078125,
0.0888671875,
-0.0112457275390625,
0.01971435546875,
0.00365447998046875,
0.03515625,
0.009490966796875,
0.024169921875,
-0.01419830322265625,
0.020965576171875,
-0.015411376953125,
0.0212249755859375,
-0.055938720703125,
-0.003814697265625,
-0.00809478759765625,
0.05364990234375,
0.03955078125,
0.007678985595703125,
-0.044708251953125,
-0.0025234222412109375,
0.0631103515625,
0.0325927734375,
0.01123809814453125,
0.033172607421875,
-0.01397705078125,
0.020355224609375,
0.025146484375,
-0.0679931640625,
0.007843017578125,
-0.0015974044799804688,
-0.007293701171875,
0.0139923095703125,
0.01015472412109375,
0.02276611328125,
-0.0262908935546875,
0.01532745361328125,
-0.0288238525390625,
-0.01026153564453125,
0.0307769775390625,
-0.006500244140625,
-0.01192474365234375,
0.0172271728515625,
0.0419921875,
-0.09686279296875,
-0.0294952392578125,
-0.037506103515625,
0.046234130859375,
0.0108795166015625,
-0.026824951171875,
0.0218048095703125,
0.0006055831909179688,
0.043731689453125,
-0.021636962890625,
-0.0226287841796875,
-0.01036834716796875,
0.027374267578125,
0.0252838134765625,
0.0270538330078125,
0.04718017578125,
-0.03314208984375,
-0.019317626953125,
0.0333251953125,
0.0540771484375,
-0.0277099609375,
-0.0670166015625,
0.0037822723388671875,
-0.0084228515625,
0.00020456314086914062,
0.023712158203125,
0.014923095703125,
-0.02197265625,
0.0276336669921875,
-0.043060302734375,
-0.00785064697265625,
0.0238800048828125,
0.023529052734375,
-0.0188751220703125,
-0.021087646484375,
-0.001922607421875,
-0.0142974853515625,
-0.03564453125,
-0.00405120849609375,
-0.00626373291015625,
0.062255859375,
0.0228729248046875,
0.044158935546875,
-0.0413818359375,
-0.0244293212890625,
-0.0242156982421875,
0.038818359375,
-0.0185699462890625,
0.036895751953125,
-0.06378173828125,
-0.027618408203125,
-0.00522613525390625,
0.03363037109375,
0.049102783203125,
-0.0153045654296875,
0.0178070068359375,
-0.007129669189453125,
-0.0179443359375,
0.0236663818359375,
0.05413818359375,
-0.007640838623046875,
0.0458984375,
-0.039703369140625,
0.06378173828125,
0.01178741455078125,
0.005962371826171875,
-0.0203094482421875,
0.03643798828125,
0.0292816162109375,
0.036773681640625,
0.0029354095458984375,
0.0197296142578125,
-0.00928497314453125,
0.00945281982421875,
0.002094268798828125,
0.0249481201171875,
0.058349609375,
-0.04132080078125,
-0.00682830810546875,
-0.006015777587890625,
-0.0865478515625,
0.02105712890625,
0.041259765625,
-0.0262603759765625,
-0.006103515625,
0.0156402587890625,
0.032135009765625,
0.01531219482421875,
-0.00887298583984375,
-0.0110626220703125,
0.017242431640625,
0.04608154296875,
0.019317626953125,
0.00748443603515625,
0.0033435821533203125,
0.03533935546875,
0.011962890625,
-0.03118896484375,
0.0657958984375,
-0.0310821533203125,
-0.01016998291015625,
0.004177093505859375,
-0.0077667236328125,
-0.0150299072265625,
0.011962890625,
-0.04315185546875,
-0.0305633544921875,
-0.0027713775634765625,
0.005596160888671875,
-0.0265655517578125,
-0.035858154296875,
0.0625,
-0.055450439453125,
-0.0080718994140625,
-0.04302978515625,
0.02825927734375,
-0.043243408203125,
-0.020050048828125,
-0.039947509765625,
-0.0343017578125,
-0.037384033203125,
0.004070281982421875,
0.01131439208984375,
-0.01568603515625,
-0.04144287109375,
0.0701904296875,
0.017578125,
-0.00716400146484375,
0.006561279296875,
-0.059417724609375,
0.00696563720703125,
0.027679443359375,
0.0279693603515625,
0.0161285400390625,
0.047271728515625,
-0.01641845703125,
0.0301055908203125,
0.0282135009765625,
0.026824951171875,
0.0267333984375,
0.031280517578125,
-0.024871826171875,
-0.034088134765625,
-0.0200347900390625,
-0.0198974609375,
-0.026641845703125,
-0.020233154296875,
-0.01328277587890625,
-0.00786590576171875,
-0.00231170654296875,
-0.007415771484375,
-0.01514434814453125,
-0.01922607421875,
-0.00974273681640625,
-0.004405975341796875,
-0.0401611328125,
0.013458251953125,
0.0308380126953125,
0.024169921875,
-0.007781982421875,
-0.04803466796875,
0.04541015625,
-0.04229736328125,
0.05316162109375,
-0.02850341796875,
-0.0213165283203125,
-0.0088043212890625,
-0.03759765625,
-0.04608154296875,
0.01285552978515625,
-0.08392333984375,
-0.026641845703125,
-0.0400390625,
0.0025501251220703125,
0.033172607421875,
-0.00637054443359375,
-0.027679443359375,
-0.03265380859375,
-0.0247802734375,
0.0300445556640625,
-0.03009033203125,
-0.01248931884765625,
0.0458984375,
0.001964569091796875,
-0.03240966796875,
-0.07666015625,
-0.0232696533203125,
-0.0709228515625,
0.017974853515625,
0.0205535888671875,
-0.047210693359375,
-0.0245361328125,
-0.03350830078125,
-0.020721435546875,
0.08062744140625,
0.0150909423828125,
-0.005962371826171875,
-0.062286376953125,
0.01549530029296875,
0.0158843994140625,
-0.004947662353515625,
-0.024200439453125,
0.005947113037109375,
-0.040802001953125,
0.00807952880859375,
0.005413055419921875,
0.0531005859375,
-0.00885009765625,
0.0026378631591796875,
-0.007740020751953125,
0.00823974609375,
0.0024929046630859375,
0.00722503662109375,
-0.003650665283203125,
0.006214141845703125,
0.0455322265625,
0.061553955078125,
0.007717132568359375,
0.0848388671875,
0.023773193359375,
-0.03118896484375,
0.02581787109375,
0.0169219970703125,
-0.05609130859375,
-0.02093505859375,
0.06134033203125,
0.0199432373046875,
0.02606201171875,
-0.0085601806640625,
-0.0308685302734375,
-0.0482177734375,
-0.062255859375,
-0.01216888427734375,
0.037200927734375,
-0.0479736328125,
0.02923583984375,
-0.01470184326171875,
0.015960693359375,
-0.007480621337890625,
-0.0307769775390625,
-0.0022411346435546875,
-0.02020263671875,
-0.00921630859375,
0.002323150634765625,
0.0153656005859375,
-0.00696563720703125,
0.004917144775390625,
-0.010406494140625,
0.0012521743774414062,
-0.0239715576171875,
0.0308074951171875,
-0.006938934326171875,
-0.0308837890625,
-0.033599853515625,
0.0223541259765625,
-0.01200103759765625,
-0.02099609375,
0.0172119140625,
-0.0021953582763671875,
0.0123291015625,
0.029815673828125,
0.012359619140625,
-0.00757598876953125,
0.00586700439453125,
-0.029754638671875,
-0.04052734375,
0.02685546875,
-0.0010633468627929688,
0.03704833984375,
-0.007259368896484375,
-0.011016845703125,
-0.0039005279541015625,
0.0428466796875,
-0.0242919921875,
0.001873016357421875,
-0.0008401870727539062,
-0.01108551025390625,
-0.0096282958984375,
-0.00742340087890625,
-0.029266357421875,
-0.090576171875,
0.034637451171875,
-0.053131103515625,
0.0095672607421875,
0.0333251953125
] |
6826a1800e7da0e750616f932a2f3c25cab6fdc9
|
Wordpress Stackexchange
Q: How can I stop TinyMCE from converting my HTML entities to characters? Here's the problem: I paste the HTML entity code for, let's say, a service mark (℠) into the HTML view of the editor. As soon as I switch to the "visual" tab, my entity code is turned into an actual service mark character (I guess the corresponding UTF-8 character or something? I don't know from character encodings...). I don't want this--I want it to stay as the entity reference.
Is there some kind of configuration I can change to stop TinyMCE from doing this? My understanding from reading the internets is that this is not the default behavior--that TinyMCE should actually be doing the opposite, and converting characters to their entities. So is this something specific to WordPress' version of TinyMCE?
A: According to this page, you can use the tiny_mce_before_init filter, make sure the entity encoding is set to named, and then add whichever special characters you want to the entities array.
|
Q: How can I stop TinyMCE from converting my HTML entities to characters? Here's the problem: I paste the HTML entity code for, let's say, a service mark (℠) into the HTML view of the editor. As soon as I switch to the "visual" tab, my entity code is turned into an actual service mark character (I guess the corresponding UTF-8 character or something? I don't know from character encodings...). I don't want this--I want it to stay as the entity reference.
Is there some kind of configuration I can change to stop TinyMCE from doing this? My understanding from reading the internets is that this is not the default behavior--that TinyMCE should actually be doing the opposite, and converting characters to their entities. So is this something specific to WordPress' version of TinyMCE?
A: According to this page, you can use the tiny_mce_before_init filter, make sure the entity encoding is set to named, and then add whichever special characters you want to the entities array.
A: Thanks, fdsa!
For posterity, here's the actual code I used. It adds copyright, registered, trademark, service mark and euro to the array of allowed entities. I'm confused as to why some of these aren't in there by default, as they're really common. But in any case, this works:
// Custom configuration for TinyMCE
function wpsx_54398_configure_tiny_mce( $initArray ) {
// Add some common entities to the default array (copy, reg, trade, service mark, euro)
// The odd entires are the entity *number*, the even entries are the entity *name*. If the entity has no name,
// use the number, prefixed with a hash (for example, the service mark is "8480,#8480").
$initArray['entities'] = $initArray['entities'] . ',169,copy,174,reg,8482,trade,8480,#8480,8364,euro';
return $initArray;
}
add_filter('tiny_mce_before_init', 'wpsx_54398_configure_tiny_mce');
|
wordpress
|
{
"language": "en",
"length": 286,
"provenance": "stackexchange_00019.jsonl.gz:420597",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54398"
}
|
[
0.023651123046875,
0.0269775390625,
-0.021881103515625,
0.0379638671875,
0.04144287109375,
-0.037078857421875,
0.072021484375,
-0.039642333984375,
0.018035888671875,
0.057861328125,
0.05517578125,
-0.0242462158203125,
0.053985595703125,
-0.04156494140625,
-0.043731689453125,
0.027587890625,
0.0236663818359375,
-0.02789306640625,
0.0128631591796875,
-0.0145263671875,
-0.00965118408203125,
0.0072174072265625,
0.050750732421875,
-0.06005859375,
0.026214599609375,
-0.0687255859375,
0.0843505859375,
-0.055267333984375,
0.010894775390625,
-0.046051025390625,
0.01105499267578125,
0.0294647216796875,
0.01194000244140625,
0.08203125,
-0.10174560546875,
0.052337646484375,
-0.027191162109375,
0.0513916015625,
0.006649017333984375,
0.00420379638671875,
0.0268402099609375,
-0.032684326171875,
0.040191650390625,
-0.0049591064453125,
0.008453369140625,
0.0077667236328125,
0.011505126953125,
-0.045074462890625,
0.01290130615234375,
-0.0384521484375,
0.015380859375,
0.0231475830078125,
0.0291748046875,
-0.0025272369384765625,
-0.033447265625,
0.0008258819580078125,
-0.039642333984375,
-0.00389862060546875,
-0.00833892822265625,
0.054931640625,
0.045196533203125,
0.022979736328125,
-0.024627685546875,
-0.0018634796142578125,
-0.004627227783203125,
-0.01204681396484375,
-0.044921875,
0.01103973388671875,
0.04669189453125,
-0.003204345703125,
-0.0166778564453125,
0.00453948974609375,
0.008575439453125,
-0.04742431640625,
0.0017728805541992188,
0.04302978515625,
-0.043914794921875,
-0.017303466796875,
0.0243682861328125,
-0.01544952392578125,
0.039337158203125,
0.008026123046875,
-0.01715087890625,
-0.00991058349609375,
-0.005397796630859375,
0.0040740966796875,
0.005863189697265625,
-0.0289154052734375,
0.005748748779296875,
-0.0038051605224609375,
-0.01064300537109375,
0.041961669921875,
0.01114654541015625,
0.0367431640625,
-0.028076171875,
0.0250244140625,
-0.012969970703125,
-0.0305938720703125,
0.0095672607421875,
0.027496337890625,
0.0200042724609375,
-0.062255859375,
0.07623291015625,
-0.021331787109375,
0.03485107421875,
-0.00952911376953125,
-0.0195770263671875,
-0.005374908447265625,
0.08172607421875,
0.0235443115234375,
0.0007648468017578125,
0.1080322265625,
-0.019866943359375,
-0.06964111328125,
0.0173187255859375,
0.06085205078125,
-0.0036029815673828125,
0.03472900390625,
0.019866943359375,
0.02899169921875,
0.0108489990234375,
0.01061248779296875,
0.0194091796875,
-0.0024871826171875,
-0.0267181396484375,
-0.0279541015625,
-0.01471710205078125,
-0.01788330078125,
0.00853729248046875,
0.00913238525390625,
-0.034210205078125,
-0.0126800537109375,
0.045074462890625,
0.07513427734375,
0.036224365234375,
-0.0198211669921875,
0.0055084228515625,
-0.0189971923828125,
-0.0216217041015625,
0.0183868408203125,
-0.004268646240234375,
-0.0227508544921875,
0.0010547637939453125,
-0.0362548828125,
-0.05059814453125,
0.0302734375,
0.0240325927734375,
0.01103973388671875,
-0.038421630859375,
-0.0770263671875,
-0.0138092041015625,
-0.03704833984375,
0.054595947265625,
-0.00876617431640625,
0.01727294921875,
-0.0943603515625,
0.06072998046875,
-0.07196044921875,
0.0260772705078125,
-0.08319091796875,
-0.00362396240234375,
-0.0024261474609375,
0.040191650390625,
-0.018341064453125,
-0.0249786376953125,
-0.009033203125,
-0.042205810546875,
-0.0011892318725585938,
0.0235748291015625,
0.044281005859375,
-0.0445556640625,
-0.0091705322265625,
-0.0013132095336914062,
-0.011993408203125,
-0.0213470458984375,
-0.005077362060546875,
-0.0261077880859375,
0.0211029052734375,
0.033905029296875,
0.0208892822265625,
0.01556396484375,
-0.0252685546875,
0.0609130859375,
0.01555633544921875,
-0.059234619140625,
0.035888671875,
-0.0002567768096923828,
0.08001708984375,
0.040252685546875,
0.017913818359375,
0.01666259765625,
-0.00838470458984375,
0.001064300537109375,
0.0191497802734375,
0.029083251953125,
-0.0224761962890625,
-0.034149169921875,
-0.002197265625,
0.00765228271484375,
-0.041748046875,
0.053375244140625,
0.006603240966796875,
0.000064849853515625,
-0.042236328125,
0.002368927001953125,
-0.03521728515625,
0.023468017578125,
0.01433563232421875,
-0.0080413818359375,
0.0043792724609375,
0.007747650146484375,
-0.033447265625,
-0.028045654296875,
0.063232421875,
0.0176544189453125,
0.0224456787109375,
-0.006103515625,
0.01132965087890625,
-0.006458282470703125,
0.009185791015625,
0.01128387451171875,
-0.0299530029296875,
0.00377655029296875,
0.03363037109375,
-0.04144287109375,
-0.00969696044921875,
-0.005767822265625,
0.001163482666015625,
-0.0262451171875,
-0.008331298828125,
0.049560546875,
0.01995849609375,
0.0406494140625,
0.0301666259765625,
-0.045318603515625,
-0.0418701171875,
-0.058319091796875,
-0.095703125,
0.0158843994140625,
0.078125,
0.0237274169921875,
-0.0035114288330078125,
-0.0325927734375,
-0.0194244384765625,
0.0014667510986328125,
-0.0275421142578125,
0.01236724853515625,
-0.019195556640625,
0.0232696533203125,
0.031585693359375,
0.00878143310546875,
-0.053619384765625,
0.01160430908203125,
-0.10064697265625,
0.012603759765625,
0.0212554931640625,
0.0296478271484375,
-0.0079193115234375,
0.0214080810546875,
-0.0008211135864257812,
0.024932861328125,
0.00014531612396240234,
-0.050872802734375,
0.0135650634765625,
-0.025543212890625,
0.047576904296875,
0.006237030029296875,
0.01218414306640625,
-0.042877197265625,
0.024444580078125,
0.0269622802734375,
0.03033447265625,
-0.01059722900390625,
0.0018720626831054688,
0.004505157470703125,
0.035675048828125,
-0.059600830078125,
0.0240631103515625,
0.037750244140625,
0.0137176513671875,
-0.021881103515625,
0.01654052734375,
0.0014181137084960938,
-0.00836181640625,
-0.0051116943359375,
-0.02044677734375,
0.00815582275390625,
-0.003459930419921875,
-0.049713134765625,
-0.023712158203125,
0.00494384765625,
0.03399658203125,
-0.01934814453125,
0.0008325576782226562,
0.00005239248275756836,
0.01134490966796875,
0.04876708984375,
0.022918701171875,
0.0129547119140625,
0.0091552734375,
0.07562255859375,
0.0396728515625,
-0.0010766983032226562,
-0.01369476318359375,
0.018585205078125,
-0.035003662109375,
0.0153045654296875,
0.0302734375,
0.0166168212890625,
-0.00934600830078125,
-0.0489501953125,
0.0175018310546875,
0.0124359130859375,
0.035980224609375,
-0.0064697265625,
-0.0406494140625,
-0.000059545040130615234,
0.005367279052734375,
-0.039337158203125,
-0.0304718017578125,
-0.003490447998046875,
0.004840850830078125,
-0.0184326171875,
0.0301513671875,
-0.006748199462890625,
-0.00733184814453125,
0.022796630859375,
-0.0003685951232910156,
-0.0023059844970703125,
-0.018280029296875,
-0.055694580078125,
-0.031768798828125,
-0.05548095703125,
0.02655029296875,
-0.00753021240234375,
0.0060577392578125,
0.02313232421875,
-0.01313018798828125,
0.00514984130859375,
-0.0036373138427734375,
0.04736328125,
-0.02337646484375,
-0.0252227783203125,
0.01226806640625,
-0.0178985595703125,
-0.00983428955078125,
0.004268646240234375,
0.004741668701171875,
-0.022979736328125,
0.0095367431640625,
0.0205841064453125,
0.00833892822265625,
0.0027027130126953125,
0.02655029296875,
0.041351318359375,
0.00931549072265625,
-0.022979736328125,
0.061553955078125,
0.071044921875,
0.00525665283203125,
-0.0643310546875,
-0.00243377685546875,
-0.057220458984375,
0.0814208984375,
0.0149688720703125,
0.0011930465698242188,
0.004703521728515625,
0.057586669921875,
0.002532958984375,
0.0217132568359375,
0.055816650390625,
-0.004421234130859375,
-0.0270538330078125,
-0.03125,
-0.03338623046875,
-0.0241851806640625,
0.047210693359375,
0.0014047622680664062,
0.0232086181640625,
0.0201568603515625,
0.0338134765625,
0.006137847900390625,
-0.007129669189453125,
-0.01206207275390625,
-0.0305023193359375,
0.032989501953125,
-0.06268310546875,
0.0236358642578125,
-0.04180908203125,
-0.004489898681640625,
-0.018829345703125,
0.09002685546875,
0.0162353515625,
-0.004871368408203125,
0.0136260986328125,
-0.003971099853515625,
-0.044464111328125,
0.007259368896484375,
-0.0672607421875,
-0.00930023193359375,
-0.042938232421875,
0.004108428955078125,
-0.00696563720703125,
-0.029022216796875,
-0.036590576171875,
-0.0005769729614257812,
-0.0311126708984375,
-0.037750244140625,
0.0235137939453125,
-0.040496826171875,
0.0184478759765625,
-0.0038547515869140625,
0.0032711029052734375,
-0.0291900634765625,
-0.001628875732421875,
-0.051513671875,
-0.0821533203125,
-0.0292205810546875,
-0.032470703125,
0.0819091796875,
0.0220794677734375,
-0.039093017578125,
-0.0006518363952636719,
0.068359375,
0.002338409423828125,
0.0038585662841796875,
0.02410888671875,
0.0333251953125,
0.014556884765625,
-0.00801849365234375,
0.0010633468627929688,
-0.038818359375,
-0.01348876953125,
0.0273284912109375,
-0.00818634033203125,
0.005069732666015625,
-0.0176544189453125,
-0.077392578125,
0.04022216796875,
-0.05218505859375,
-0.040130615234375,
-0.0283966064453125,
-0.02056884765625,
0.016204833984375,
-0.0254669189453125,
0.01490020751953125,
-0.016082763671875,
-0.04010009765625,
0.0307769775390625,
0.0458984375,
-0.00027179718017578125,
-0.00266265869140625,
0.00211334228515625,
0.00934600830078125,
-0.05096435546875,
0.002422332763671875,
-0.0181884765625,
0.0035381317138671875,
-0.02008056640625,
0.053680419921875,
0.0113525390625,
0.01305389404296875,
0.044952392578125,
-0.0229644775390625,
0.025848388671875,
-0.08660888671875,
0.0889892578125,
-0.00391387939453125,
0.01355743408203125,
0.006961822509765625,
0.004962921142578125,
0.018646240234375,
0.006114959716796875,
0.0018405914306640625,
0.017333984375,
0.0191802978515625,
0.00394439697265625,
0.0027065277099609375,
-0.0247955322265625,
-0.006927490234375,
-0.01410675048828125,
-0.0089111328125,
0.05712890625,
0.0179290771484375,
0.02685546875,
0.00446319580078125,
-0.011688232421875,
0.02532958984375,
-0.01476287841796875,
-0.0201263427734375,
-0.0237274169921875,
0.015960693359375,
0.0207977294921875,
-0.036163330078125,
-0.019134521484375,
-0.0016336441040039062,
-0.00521087646484375,
0.0032024383544921875,
0.0322265625,
-0.00934600830078125,
0.0031414031982421875,
0.0030803680419921875,
0.007137298583984375,
-0.0271759033203125,
-0.0167694091796875,
-0.025665283203125,
0.0057220458984375,
-0.01280975341796875,
0.0291290283203125,
0.0198211669921875,
-0.027191162109375,
-0.004535675048828125,
-0.02197265625,
-0.0259552001953125,
-0.005222320556640625,
0.0098419189453125,
0.02313232421875,
0.005901336669921875,
0.01959228515625,
-0.0158843994140625,
0.0267181396484375,
0.006275177001953125,
0.05633544921875,
0.02520751953125,
-0.003353118896484375,
-0.0242156982421875,
0.045379638671875,
-0.034271240234375,
-0.0108795166015625,
0.00439453125,
0.01517486572265625,
0.0037860870361328125,
-0.007755279541015625,
-0.019012451171875,
0.0230865478515625,
-0.0208282470703125,
-0.00550079345703125,
0.01090240478515625,
-0.03045654296875,
-0.0338134765625,
-0.020843505859375,
-0.0007925033569335938,
0.0186614990234375,
-0.014495849609375,
-0.0083160400390625,
0.0121307373046875,
-0.0037326812744140625,
0.041412353515625,
0.0005645751953125,
0.001132965087890625,
0.0063323974609375,
-0.005023956298828125,
-0.00977325439453125,
-0.01441192626953125,
-0.0251922607421875,
-0.01313018798828125,
-0.0034942626953125,
-0.0045318603515625,
-0.001010894775390625,
0.0157012939453125,
-0.00928497314453125,
0.00667572021484375,
0.0036945343017578125,
-0.020965576171875,
-0.0240936279296875,
0.0182952880859375,
0.023193359375,
0.01110076904296875,
-0.03765869140625,
-0.006500244140625,
-0.05267333984375,
-0.019317626953125,
0.00676727294921875,
-0.02838134765625,
-0.0252227783203125,
-0.00839996337890625,
0.051483154296875,
0.035369873046875,
0.03814697265625,
-0.0296173095703125,
0.006267547607421875,
-0.00983428955078125,
0.004180908203125,
0.05377197265625,
-0.019287109375,
0.01277923583984375,
0.0011043548583984375,
0.018341064453125,
-0.01032257080078125,
0.011505126953125,
0.0509033203125,
-0.0239715576171875,
0.0216827392578125,
-0.0224609375,
-0.0186920166015625,
0.00553131103515625,
-0.0489501953125,
-0.043548583984375,
-0.002094268798828125,
-0.0067901611328125,
0.03802490234375,
-0.01080322265625,
0.0110626220703125,
-0.0084075927734375,
-0.0021820068359375,
-0.04168701171875,
0.0293121337890625,
0.0207061767578125,
-0.029571533203125,
-0.033660888671875,
-0.006927490234375,
0.01119232177734375,
0.01412200927734375,
-0.0113372802734375,
-0.00579071044921875,
0.00048661231994628906,
0.028717041015625,
-0.0209808349609375,
-0.01218414306640625,
-0.00795745849609375,
-0.003940582275390625,
0.01546478271484375,
0.01442718505859375,
-0.00887298583984375,
-0.0031452178955078125,
0.0186920166015625,
0.0262298583984375,
-0.0164794921875,
-0.032745361328125,
0.0142364501953125,
-0.034332275390625,
-0.011505126953125,
0.031097412109375,
0.08648681640625,
0.1060791015625,
-0.10186767578125,
-0.0018815994262695312,
0.04583740234375,
-0.027130126953125,
0.017364501953125,
0.00670623779296875,
-0.0283050537109375,
-0.045867919921875,
0.04864501953125,
-0.0435791015625,
-0.00861358642578125,
0.022491455078125,
0.00508880615234375,
-0.0101470947265625,
-0.007114410400390625,
0.05535888671875,
0.028717041015625,
0.03582763671875,
-0.01219940185546875,
-0.0301666259765625,
0.0252685546875,
-0.032196044921875,
0.0239715576171875,
0.0018177032470703125,
-0.0027294158935546875,
-0.06256103515625,
0.021026611328125,
0.004001617431640625,
-0.0227508544921875,
-0.004734039306640625,
-0.007598876953125,
-0.01177978515625,
0.040008544921875,
-0.0511474609375,
0.0156402587890625,
0.0279998779296875,
-0.014068603515625,
0.05169677734375,
0.004192352294921875,
-0.0031108856201171875,
0.038665771484375,
0.0009627342224121094,
-0.00395965576171875,
0.0166168212890625,
0.0165863037109375,
0.0038909912109375,
0.0115966796875,
-0.0333251953125,
0.0198974609375,
-0.0272216796875,
0.05908203125,
-0.0325927734375,
-0.023101806640625,
-0.05987548828125,
-0.04400634765625,
-0.0543212890625,
-0.0252685546875,
-0.05816650390625,
-0.04095458984375,
0.013214111328125,
-0.0728759765625,
-0.091796875,
0.053466796875,
0.03643798828125,
0.03985595703125,
-0.0203704833984375,
0.0181121826171875,
-0.02239990234375,
-0.0204010009765625,
-0.03369140625,
0.02001953125,
-0.01175689697265625,
0.0262298583984375,
-0.051910400390625,
0.00388336181640625,
0.0005497932434082031,
0.010467529296875,
-0.036163330078125,
-0.006122589111328125,
-0.017547607421875,
0.005268096923828125,
0.0177154541015625,
0.0194549560546875,
0.018890380859375,
0.027862548828125,
0.0140380859375,
-0.031646728515625,
0.00730133056640625,
0.007350921630859375,
0.0247650146484375,
-0.00782012939453125,
-0.01294708251953125,
0.037811279296875,
-0.0017118453979492188,
-0.00771331787109375,
0.0191192626953125,
-0.05548095703125,
0.00897979736328125,
0.0060272216796875,
-0.019561767578125,
-0.05645751953125,
0.0028533935546875,
0.05023193359375,
0.04864501953125,
-0.055206298828125,
-0.06085205078125,
-0.029205322265625,
0.033782958984375,
0.01232147216796875,
0.040283203125,
0.023651123046875,
0.009918212890625,
0.06396484375,
-0.0181732177734375,
0.0222625732421875,
0.0117950439453125,
-0.0152587890625,
-0.01374053955078125,
0.00405120849609375,
0.01221466064453125,
-0.0275421142578125,
-0.004108428955078125,
0.0577392578125,
0.01279449462890625,
-0.0101318359375,
-0.009307861328125,
0.0012617111206054688,
-0.001857757568359375,
0.01381683349609375,
-0.02789306640625,
0.01715087890625,
-0.03936767578125,
-0.0182342529296875,
0.06231689453125,
-0.033447265625,
-0.0222625732421875,
0.006847381591796875,
0.0304412841796875,
0.0428466796875,
0.0084228515625,
-0.016448974609375,
-0.04974365234375,
0.0005731582641601562,
0.01141357421875,
0.0528564453125,
0.03497314453125,
0.038970947265625,
0.01309967041015625,
-0.0246734619140625,
0.0019426345825195312,
0.0063018798828125,
0.029754638671875,
-0.0283355712890625,
0.0118865966796875,
0.0035343170166015625,
0.0091552734375,
0.0010595321655273438,
-0.02001953125,
-0.013092041015625,
0.03131103515625,
0.04083251953125,
-0.0350341796875,
-0.018341064453125,
0.03399658203125,
-0.0167999267578125,
0.0380859375,
-0.05682373046875,
-0.003696441650390625,
-0.0130157470703125,
-0.02178955078125,
-0.00634002685546875,
-0.033721923828125,
0.06005859375,
-0.00966644287109375,
0.044769287109375,
-0.00835418701171875,
-0.00507354736328125,
0.013275146484375,
-0.055633544921875,
0.041168212890625,
0.019744873046875,
0.0419921875,
0.0049591064453125,
-0.00231170654296875,
-0.04193115234375,
-0.00710296630859375,
0.0307159423828125,
-0.005657196044921875,
0.018524169921875,
-0.0002117156982421875,
-0.0279998779296875,
0.00450897216796875,
0.0031948089599609375,
0.0277099609375,
0.0024166107177734375,
-0.01039886474609375,
-0.006103515625,
0.007335662841796875,
0.0240478515625,
0.0247802734375,
0.00917816162109375,
0.00861358642578125,
0.048583984375,
0.00012993812561035156,
0.004894256591796875,
-0.053070068359375,
0.003276824951171875,
-0.02685546875,
-0.05078125,
0.00601959228515625,
0.05499267578125,
0.0156707763671875,
-0.0321044921875,
-0.038421630859375,
0.051300048828125,
-0.021636962890625,
-0.0219573974609375,
0.0029430389404296875,
0.01416778564453125,
-0.005939483642578125,
0.037322998046875,
0.014190673828125,
-0.0160369873046875,
-0.03814697265625,
-0.031005859375,
-0.00806427001953125,
0.00789642333984375,
-0.005367279052734375,
-0.006710052490234375,
0.0360107421875,
0.0002002716064453125,
-0.04437255859375,
0.031036376953125,
-0.06878662109375,
0.0176239013671875,
0.023956298828125,
0.079833984375,
0.00933837890625,
0.005096435546875,
-0.035797119140625,
0.0174102783203125,
0.004974365234375,
-0.00739288330078125,
0.005092620849609375,
-0.0916748046875,
0.04644775390625,
0.0491943359375,
0.06719970703125,
-0.00855255126953125,
0.024200439453125,
0.017578125,
0.015777587890625,
0.031890869140625,
0.00775146484375,
-0.01727294921875,
-0.00395965576171875,
0.01438140869140625,
0.0183563232421875,
0.01532745361328125,
0.0311126708984375,
-0.039459228515625,
-0.053253173828125,
0.04541015625,
0.0037403106689453125,
-0.0090484619140625,
-0.0156402587890625,
-0.01410675048828125,
0.00010842084884643555,
0.003574371337890625,
0.021636962890625,
-0.0243072509765625,
-0.0293121337890625,
-0.0543212890625,
-0.04010009765625,
-0.049774169921875,
0.05621337890625,
-0.04376220703125,
0.0262451171875,
0.052398681640625,
-0.02447509765625,
-0.03912353515625,
-0.02069091796875,
-0.006320953369140625,
0.0193023681640625,
-0.0118865966796875,
-0.0186614990234375,
0.02435302734375,
-0.0183868408203125,
-0.0081787109375,
-0.04022216796875,
-0.005596160888671875,
-0.033599853515625,
0.007289886474609375,
-0.0022525787353515625,
-0.0185089111328125,
-0.000270843505859375,
-0.0523681640625,
-0.08868408203125,
-0.00620269775390625,
0.00860595703125,
-0.0458984375,
0.02777099609375,
-0.0313720703125,
-0.01178741455078125,
-0.0032367706298828125,
0.000904083251953125,
0.0005860328674316406,
-0.0225372314453125,
0.003665924072265625,
0.019927978515625,
0.0138092041015625,
0.01346588134765625,
0.002323150634765625,
-0.020111083984375,
0.0293731689453125,
0.0400390625,
0.0205535888671875,
0.0004799365997314453,
0.00666046142578125,
-0.0193023681640625,
0.01526641845703125,
-0.018646240234375,
-0.09747314453125,
-0.017486572265625,
-0.0297698974609375,
-0.0007276535034179688,
-0.05938720703125,
-0.0294189453125,
-0.041778564453125,
0.045562744140625,
-0.0035610198974609375,
0.002597808837890625,
0.0106658935546875,
-0.0215911865234375,
-0.017822265625,
-0.01556396484375,
-0.02288818359375,
0.018463134765625,
-0.07781982421875,
-0.0232086181640625,
0.0150604248046875,
-0.01546478271484375,
0.0009350776672363281,
-0.0328369140625,
-0.04412841796875,
0.00406646728515625,
-0.020233154296875,
0.0167236328125,
-0.020751953125,
0.0305938720703125,
-0.003551483154296875,
-0.01396942138671875,
-0.0341796875,
0.023895263671875,
-0.0194244384765625,
-0.0282745361328125,
0.044403076171875,
-0.036651611328125,
-0.04693603515625,
0.026214599609375,
0.042694091796875,
-0.017974853515625,
-0.02301025390625,
-0.008758544921875,
0.01025390625,
-0.005706787109375,
-0.005580902099609375,
0.0226898193359375,
0.02410888671875,
0.006694793701171875,
-0.041168212890625,
0.01134490966796875,
-0.0677490234375,
-0.051849365234375,
-0.022979736328125,
-0.0300750732421875,
0.015472412109375,
-0.044189453125,
0.0404052734375,
-0.0023708343505859375,
0.0039005279541015625,
0.01142120361328125,
0.01739501953125,
-0.01087188720703125,
0.006786346435546875,
-0.033721923828125,
-0.07659912109375,
0.0088043212890625,
-0.007274627685546875
] |
d7ea7f28be0437d543c20f5ae3422f8c6be325ad
|
Wordpress Stackexchange
Q: Prev/Next child navigation for current page? How can I get a Previous / Next navigation that only navigates the child pages of the current page?
By that i mean url.com/page/child1, url.com/page/child2 and so on..
I've been searching around alot but I'm still lost.
It seems like you can't do that according to wordpress (they recommend plugins..)
A: All right, here it is, fully working:
<?php
$pagelist = get_pages("child_of=".$post->post_parent."&parent=".$post->post_parent."&sort_column=menu_order&sort_order=asc");
$pages = array();
foreach ($pagelist as $page) {
$pages[] += $page->ID;
}
$current = array_search($post->ID, $pages);
$prevID = $pages[$current-1];
$nextID = $pages[$current+1];
?>
<div class="navigation">
<?php if (!empty($prevID)) { ?>
<div class="previous">
<a href="<?php echo get_permalink($prevID); ?>" title="<?php echo get_the_title($prevID); ?>">Previous</a>
</div>
<?php }
if (!empty($nextID)) { ?>
<div class="Next">
<a href="<?php echo get_permalink($nextID); ?>" title="<?php echo get_the_title($nextID); ?>">Next</a>
</div>
<?php } ?>
</div>
One little cosmetic thing needs to get fixed, and that is that the "Previous" and "Next" links always should be shown, whether or not there are any more pages...
|
Q: Prev/Next child navigation for current page? How can I get a Previous / Next navigation that only navigates the child pages of the current page?
By that i mean url.com/page/child1, url.com/page/child2 and so on..
I've been searching around alot but I'm still lost.
It seems like you can't do that according to wordpress (they recommend plugins..)
A: All right, here it is, fully working:
<?php
$pagelist = get_pages("child_of=".$post->post_parent."&parent=".$post->post_parent."&sort_column=menu_order&sort_order=asc");
$pages = array();
foreach ($pagelist as $page) {
$pages[] += $page->ID;
}
$current = array_search($post->ID, $pages);
$prevID = $pages[$current-1];
$nextID = $pages[$current+1];
?>
<div class="navigation">
<?php if (!empty($prevID)) { ?>
<div class="previous">
<a href="<?php echo get_permalink($prevID); ?>" title="<?php echo get_the_title($prevID); ?>">Previous</a>
</div>
<?php }
if (!empty($nextID)) { ?>
<div class="Next">
<a href="<?php echo get_permalink($nextID); ?>" title="<?php echo get_the_title($nextID); ?>">Next</a>
</div>
<?php } ?>
</div>
One little cosmetic thing needs to get fixed, and that is that the "Previous" and "Next" links always should be shown, whether or not there are any more pages...
A: Untested, but this should work:
First use get_pages to find all other pages (or CPT) with the same parent as the current page. Then find the 'previous' and 'next' pages.
function wpse5422_the_page_siblings(){
$post_id = get_the_ID();
$parent_id = wp_get_post_parent_id($post_id);
$post_type = get_post_type($post_id);
$sibling_list = get_pages(array(
'sort_column'=>'menu_order',
'sort_order' =>'asc',
'child_of' =>$parent_id,
'post_type'=> $post_type
));
if( !$sibling_list || is_wp_error($sibling_list) )
return false;
$pages = array();
foreach ($sibling_list as $sibling ) {
$pages[] = $sibling->ID;
}
$current = array_search($post_id, $pages);
$prevID = isset($pages[$current-1]) ? $pages[$current-1] : false;
$nextID = isset($pages[$current+1]) ? $pages[$current+1] : false;
echo wpse5422_display_prev_next($prevID, $nextID);
}
The above function must be used inside the loop - it takes the current page (or any hierarchical post type) and finds the previous and next sibling page (i.e. of same parent as current page) according to their menu order (this can be changed to date, or title).
It then uses the following function which takes two IDs as an argument and is simply responsible for producing the output:
function wpse5422_display_prev_next($prevID=false, $nextID=false){
if( empty($prevID) && empty($nextID) )
return false;
$html = '<div class="navigation">';
if( !empty($prevID) ){
$html .= '<div class="alignleft">';
$html .= '<a href="'.get_permalink($prevID).'">Previous</a>';
$html .= '</div>';
}
if( !empty($nextID) ){
$html .= '<div class="alignright">';
$html .= '<a href="'.get_permalink($nextID).'">Next</a>';
$html .= '</div>';
}
$html .= '</div><!-- .navigation -->';
return $html;
}
Where to put this code
Ideally you should create a plug-in out of it. It will work in functions.php - but really, it shouldn't be living there.
Usage
Inside the Loop, whether you want to display the page links: wpse5422_the_page_siblings();.
A: Great hack, it did what I was looking for.
I thaught some of you might be interrested in what I added, that is: alternative links
*
*to the first child page when you are browsing the parent page
*to the parent when you are browsing the first child page
the nav is not displayed when not necessary, the styling fits the one the twenty-thirteen theme applies to post navigation.
<?php // display nav only if there are child pages
if ($post->post_parent) { // applies only to child pages
$pagelist = get_pages("child_of=".$post->post_parent."&parent=".$post->post_parent."&sort_column=menu_order&sort_order=asc");
$pages = array();
foreach ($pagelist as $page) {
$pages[] += $page->ID;
}
$current = array_search($post->ID, $pages);
$prevID = $pages[$current-1];
$nextID = $pages[$current+1];
?>
<nav class="navigation post-navigation" role="navigation">
<div class="nav-links">
<?php if (!empty($prevID)) { /* if we are browsing first child, then link to parent page*/ ?>
<a rel="prev" href="<?php echo get_permalink($prevID); ?>" title="<?php echo get_the_title($prevID); ?>"><span class="meta-nav">←</span> <?php echo get_the_title($prevID); ?></a>
<?php }
else { // else, link to previous child ?>
<a rel="prev" href="<?php echo get_permalink($post->post_parent); ?>"><span class="meta-nav">←</span> <?php echo get_the_title($post->post_parent); ?></a>
<?php }
if (!empty($nextID)) { ?>
<a rel="next" href="<?php echo get_permalink($nextID); ?>" title="<?php echo get_the_title($nextID); ?>"><?php echo get_the_title($nextID); ?> <span class="meta-nav">→</span></a>
<?php } ?>
</div>
</nav>
<?php }
else { // if we are browsing parent page, then link to first child
$child_pages = get_pages("child_of=".$post->ID."&parent=".$post->ID."&sort_column=menu_order&sort_order=asc");
$first_child = $child_pages[0]; ?>
<?php if (!empty($first_child)) { ?>
<nav class="navigation post-navigation" role="navigation">
<div class="nav-links">
<a rel="next" href="<?php echo get_permalink($first_child->ID); ?>"><?php echo get_the_title($first_child->ID); ?> <span class="meta-nav">→</span></a>
</div>
A: You could use find the parent page of the current post using post->parent_page, then plug that into get_page_children,obtaining all siblings of the parent page, and then find the next and previous elements in the array that is returned.
A: If you're open to going the plugin route, which I personally am for this kind of thing, the plugin Ambrosite Next/Previous Page Link Plus is pretty awesome. It supports the functionality that you're looking for, plus a lot more.
A: To show next and previous links independent of whether or not any more pages are present you need to add some conditional statements:
(edited the pointless elseif stuff)
<div class="navigation">
<?php if (!empty($prevID)) : ?>
<div class="previous">
<a href="<?php echo get_permalink($prevID); ?>"
title="<?php echo get_the_title($prevID); ?>">Previous</a>
</div>
<?php else : ?>
<div class="previous disabled">
<a href="#">Previous</a>
</div>
<?php endif; ?>
<?php if (!empty($nextID)) : ?>
<div class="next">
<a href="<?php echo get_permalink($nextID); ?>"
title="<?php echo get_the_title($nextID); ?>">Next</a>
</div>
<?php else : ?>
<div class="next disabled">
<a href="#">Next</a>
</div>
<?php endif; ?>
</div>
A: The 'wpse5422_the_page_siblings()' solution works great, I cannot comment as my rep is too low, but my only change is to make this line:
'sort_column'=>'menu_order',
To be this:
'sort_column'=>'menu_order title',
This way if the user leaves the sort order of every page as 0, it will default to sorting alphabetical by page title.
Thanks!
|
wordpress
|
{
"language": "en",
"length": 890,
"provenance": "stackexchange_00019.jsonl.gz:420605",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54422"
}
|
[
0.0693359375,
-0.0161590576171875,
0.0404052734375,
-0.040740966796875,
0.0033740997314453125,
-0.013519287109375,
0.01282501220703125,
-0.0293731689453125,
0.0221405029296875,
-0.00167083740234375,
-0.0699462890625,
0.01128387451171875,
-0.05157470703125,
-0.0099639892578125,
-0.0198974609375,
-0.068115234375,
0.044677734375,
-0.05712890625,
0.021759033203125,
0.00153350830078125,
-0.013397216796875,
0.02362060546875,
0.08245849609375,
0.049041748046875,
0.02813720703125,
-0.03497314453125,
0.038421630859375,
-0.00940704345703125,
0.0149688720703125,
-0.0280914306640625,
0.0159149169921875,
-0.0034809112548828125,
0.003582000732421875,
0.0034236907958984375,
0.034698486328125,
-0.050079345703125,
0.0041961669921875,
0.004909515380859375,
0.03375244140625,
-0.0100860595703125,
0.0221405029296875,
0.0009350776672363281,
-0.00537872314453125,
-0.005084991455078125,
-0.036773681640625,
-0.019287109375,
0.0014181137084960938,
-0.02264404296875,
-0.0181732177734375,
0.0008602142333984375,
0.035980224609375,
0.0023059844970703125,
0.032440185546875,
0.047637939453125,
-0.02130126953125,
-0.01145172119140625,
0.014495849609375,
-0.06500244140625,
0.0283355712890625,
-0.0035877227783203125,
-0.0195770263671875,
-0.0269317626953125,
0.0247344970703125,
-0.025787353515625,
-0.015869140625,
0.007171630859375,
0.006855010986328125,
0.030792236328125,
-0.0028171539306640625,
-0.01397705078125,
0.00519561767578125,
0.0021266937255859375,
-0.0109405517578125,
-0.039398193359375,
-0.0290679931640625,
0.022003173828125,
-0.00888824462890625,
-0.047393798828125,
0.0035762786865234375,
0.0052947998046875,
-0.048583984375,
0.0119476318359375,
-0.086669921875,
-0.017578125,
0.0051727294921875,
0.007495880126953125,
-0.0390625,
-0.0025844573974609375,
-0.04742431640625,
-0.021240234375,
-0.0421142578125,
0.01509857177734375,
-0.003414154052734375,
-0.04998779296875,
-0.0467529296875,
-0.0043182373046875,
0.0178375244140625,
0.07000732421875,
-0.033782958984375,
-0.0007052421569824219,
-0.01082611083984375,
-0.012847900390625,
-0.006450653076171875,
-0.04461669921875,
0.005084991455078125,
0.002330780029296875,
0.0029468536376953125,
0.03814697265625,
0.06201171875,
0.043975830078125,
0.007732391357421875,
0.044677734375,
0.0025730133056640625,
-0.02325439453125,
-0.0257568359375,
0.0193939208984375,
-0.0169677734375,
-0.012451171875,
0.0154876708984375,
-0.0201416015625,
-0.00547027587890625,
0.009246826171875,
-0.003955841064453125,
-0.01227569580078125,
0.024566650390625,
0.00738525390625,
-0.0224761962890625,
-0.015350341796875,
0.028289794921875,
0.0482177734375,
-0.03851318359375,
-0.020904541015625,
0.047760009765625,
0.041595458984375,
0.02618408203125,
-0.037322998046875,
0.02264404296875,
-0.0292205810546875,
0.0226593017578125,
-0.01092529296875,
0.00039696693420410156,
-0.00440216064453125,
0.01226043701171875,
-0.0175018310546875,
0.0044403076171875,
0.0013275146484375,
0.00788116455078125,
0.0196990966796875,
0.019317626953125,
-0.0201873779296875,
0.0177001953125,
-0.03253173828125,
0.035675048828125,
-0.00855255126953125,
-0.0521240234375,
-0.0164642333984375,
-0.0232391357421875,
-0.010345458984375,
-0.0130767822265625,
-0.0256805419921875,
0.0269622802734375,
0.017578125,
0.03070068359375,
-0.06903076171875,
-0.08563232421875,
-0.040985107421875,
-0.0948486328125,
-0.022186279296875,
0.016876220703125,
0.0221710205078125,
0.034423828125,
-0.0501708984375,
-0.0225372314453125,
0.00255584716796875,
-0.0053558349609375,
0.0019464492797851562,
-0.013214111328125,
-0.045440673828125,
0.029754638671875,
0.045745849609375,
-0.0024261474609375,
-0.01256561279296875,
0.0004239082336425781,
0.0099334716796875,
-0.034454345703125,
0.0249481201171875,
0.01415252685546875,
0.0273284912109375,
0.00223541259765625,
0.02105712890625,
0.031097412109375,
0.0093536376953125,
-0.07427978515625,
0.00806427001953125,
0.005168914794921875,
-0.003055572509765625,
0.02154541015625,
0.01236724853515625,
0.001651763916015625,
-0.016357421875,
-0.0231475830078125,
-0.006839752197265625,
-0.0021114349365234375,
0.01377105712890625,
-0.040771484375,
0.00015234947204589844,
-0.0180206298828125,
0.037506103515625,
0.0076904296875,
0.0236968994140625,
0.003368377685546875,
0.01425933837890625,
-0.0272064208984375,
-0.051116943359375,
-0.03826904296875,
0.0205230712890625,
0.01064300537109375,
-0.023895263671875,
-0.0013628005981445312,
0.0020275115966796875,
-0.00571441650390625,
0.0292816162109375,
-0.033782958984375,
0.0007948875427246094,
0.0865478515625,
-0.0253143310546875,
-0.006198883056640625,
-0.049530029296875,
0.053680419921875,
-0.01371002197265625,
-0.052978515625,
0.049346923828125,
0.037933349609375,
0.01303863525390625,
-0.047119140625,
0.005184173583984375,
0.00856781005859375,
-0.0115966796875,
-0.0021305084228515625,
0.0300750732421875,
0.025909423828125,
0.035186767578125,
-0.025482177734375,
-0.00443267822265625,
0.0018253326416015625,
-0.061737060546875,
0.00194549560546875,
-0.0006232261657714844,
-0.0261993408203125,
0.038482666015625,
0.037933349609375,
0.045867919921875,
-0.005344390869140625,
0.076416015625,
0.0028057098388671875,
0.024322509765625,
0.02593994140625,
0.016021728515625,
-0.0209197998046875,
-0.001094818115234375,
0.00836181640625,
-0.007568359375,
-0.05859375,
0.01490020751953125,
-0.006969451904296875,
-0.0207672119140625,
0.006195068359375,
-0.00228118896484375,
0.004665374755859375,
-0.041748046875,
0.004467010498046875,
-0.004253387451171875,
0.016937255859375,
0.013885498046875,
-0.003482818603515625,
0.004192352294921875,
-0.002147674560546875,
-0.0230865478515625,
-0.002048492431640625,
-0.00952911376953125,
-0.01467132568359375,
0.0258331298828125,
0.014404296875,
-0.01403045654296875,
-0.01016998291015625,
-0.03875732421875,
0.00604248046875,
0.01261138916015625,
-0.0169830322265625,
0.0186309814453125,
0.0298004150390625,
0.0245513916015625,
-0.0491943359375,
0.05560302734375,
0.006011962890625,
-0.005321502685546875,
-0.00275421142578125,
-0.01174163818359375,
0.017059326171875,
-0.0263824462890625,
0.038604736328125,
0.046722412109375,
-0.0100250244140625,
0.01343536376953125,
-0.002727508544921875,
0.0081634521484375,
-0.016204833984375,
0.010894775390625,
-0.010589599609375,
0.004070281982421875,
-0.056243896484375,
0.01181793212890625,
0.0273284912109375,
0.03607177734375,
-0.0019130706787109375,
-0.034149169921875,
0.00794219970703125,
0.018157958984375,
-0.0640869140625,
-0.08209228515625,
-0.01265716552734375,
-0.061248779296875,
0.004680633544921875,
0.034515380859375,
-0.023773193359375,
-0.00702667236328125,
0.07366943359375,
0.011810302734375,
0.003826141357421875,
-0.042816162109375,
-0.07659912109375,
-0.07763671875,
-0.086669921875,
0.0227203369140625,
-0.00824737548828125,
0.00728607177734375,
-0.003509521484375,
0.0212554931640625,
-0.001316070556640625,
-0.00959014892578125,
-0.0028839111328125,
0.0340576171875,
-0.00626373291015625,
-0.037445068359375,
-0.022979736328125,
0.0170440673828125,
-0.01052093505859375,
0.01021575927734375,
0.015625,
0.01471710205078125,
-0.01153564453125,
0.006649017333984375,
-0.02484130859375,
0.0445556640625,
0.002777099609375,
0.01788330078125,
0.02685546875,
0.06451416015625,
0.025726318359375,
-0.004909515380859375,
-0.0462646484375,
-0.0223388671875,
-0.0823974609375,
0.022430419921875,
0.050628662109375,
0.00997161865234375,
0.00698089599609375,
-0.01580810546875,
0.00762939453125,
0.0018672943115234375,
-0.02056884765625,
-0.0180511474609375,
0.020294189453125,
0.00962066650390625,
0.025482177734375,
0.01641845703125,
0.054229736328125,
0.0081787109375,
0.037261962890625,
0.033721923828125,
0.057708740234375,
0.04364013671875,
-0.036285400390625,
-0.03790283203125,
-0.022552490234375,
0.03515625,
-0.022430419921875,
0.0226898193359375,
-0.0241546630859375,
-0.0265350341796875,
-0.0007042884826660156,
0.0765380859375,
-0.08575439453125,
-0.031829833984375,
0.017181396484375,
0.0121002197265625,
0.0274658203125,
-0.0034389495849609375,
-0.03314208984375,
-0.0305328369140625,
-0.0830078125,
0.016937255859375,
-0.0211334228515625,
-0.020233154296875,
0.00420379638671875,
0.00858306884765625,
-0.0245208740234375,
-0.0423583984375,
0.04144287109375,
0.0283966064453125,
-0.007568359375,
0.036773681640625,
-0.03607177734375,
0.026763916015625,
-0.044647216796875,
0.01342010498046875,
-0.04705810546875,
-0.00482177734375,
0.004177093505859375,
0.04754638671875,
0.020843505859375,
-0.0260467529296875,
-0.0263671875,
0.0256500244140625,
0.030670166015625,
0.0016813278198242188,
0.028656005859375,
-0.02197265625,
0.019805908203125,
0.00693511962890625,
0.021392822265625,
-0.034515380859375,
-0.0024509429931640625,
0.001453399658203125,
0.0012998580932617188,
0.005619049072265625,
-0.05731201171875,
-0.06805419921875,
-0.039031982421875,
-0.0199127197265625,
-0.0584716796875,
-0.03717041015625,
0.00823974609375,
0.0283355712890625,
0.0006341934204101562,
0.007457733154296875,
-0.017578125,
-0.07794189453125,
0.01727294921875,
-0.0021038055419921875,
-0.0462646484375,
-0.003330230712890625,
0.01425933837890625,
0.03277587890625,
-0.0291900634765625,
0.03076171875,
0.009674072265625,
0.030303955078125,
0.00007104873657226562,
0.00283050537109375,
-0.0249176025390625,
-0.03363037109375,
0.057037353515625,
-0.00821685791015625,
-0.01030731201171875,
0.027069091796875,
0.03131103515625,
-0.0004982948303222656,
-0.04473876953125,
0.0211639404296875,
-0.0183258056640625,
-0.0182647705078125,
0.019683837890625,
-0.024627685546875,
-0.030242919921875,
-0.056427001953125,
0.05975341796875,
0.0031280517578125,
0.0518798828125,
-0.052093505859375,
0.0101470947265625,
-0.0174102783203125,
0.07232666015625,
0.05535888671875,
0.05084228515625,
-0.002777099609375,
0.033905029296875,
0.037994384765625,
-0.013824462890625,
0.0162506103515625,
0.040557861328125,
0.0386962890625,
0.044677734375,
-0.01861572265625,
-0.0021495819091796875,
-0.024688720703125,
-0.007190704345703125,
0.0711669921875,
0.02813720703125,
-0.0021877288818359375,
-0.0129241943359375,
0.0012826919555664062,
0.01715087890625,
-0.020355224609375,
0.00616455078125,
0.02203369140625,
0.0245819091796875,
0.0047607421875,
-0.0113067626953125,
0.00846099853515625,
0.0246124267578125,
-0.03594970703125,
-0.0298309326171875,
0.00801849365234375,
-0.01024627685546875,
-0.0220489501953125,
0.0870361328125,
-0.0025005340576171875,
0.0411376953125,
-0.031646728515625,
-0.01374053955078125,
0.001987457275390625,
0.0247955322265625,
0.015594482421875,
-0.005748748779296875,
0.02215576171875,
0.0006690025329589844,
0.078369140625,
-0.016754150390625,
-0.031829833984375,
0.037750244140625,
0.0633544921875,
0.021820068359375,
0.01418304443359375,
-0.01412200927734375,
-0.0033550262451171875,
-0.025665283203125,
0.0416259765625,
0.04669189453125,
-0.016082763671875,
-0.0207672119140625,
0.0128326416015625,
0.023468017578125,
0.0119171142578125,
-0.01238250732421875,
0.001087188720703125,
-0.0286865234375,
0.0007658004760742188,
-0.004909515380859375,
-0.0225677490234375,
-0.01035308837890625,
-0.013458251953125,
-0.005962371826171875,
-0.01239776611328125,
0.01629638671875,
-0.0231781005859375,
0.0167083740234375,
-0.04656982421875,
-0.0276641845703125,
0.05035400390625,
-0.0123748779296875,
0.05438232421875,
-0.073486328125,
0.01415252685546875,
-0.0809326171875,
-0.00012934207916259766,
0.00988006591796875,
0.01300811767578125,
0.0027904510498046875,
0.0063323974609375,
-0.03167724609375,
-0.0179901123046875,
-0.013641357421875,
-0.04913330078125,
-0.023162841796875,
-0.0281524658203125,
0.015838623046875,
0.00847625732421875,
0.01422119140625,
0.02703857421875,
-0.017333984375,
0.034576416015625,
0.00785064697265625,
0.06475830078125,
-0.0263824462890625,
0.0816650390625,
0.033935546875,
0.0325927734375,
0.0156402587890625,
0.01198577880859375,
-0.0523681640625,
0.00775146484375,
0.0181427001953125,
0.01116943359375,
-0.02093505859375,
-0.0139312744140625,
-0.0099334716796875,
-0.01552581787109375,
0.06005859375,
-0.00806427001953125,
0.031463623046875,
0.0122222900390625,
0.020294189453125,
-0.006366729736328125,
-0.06829833984375,
0.0157623291015625,
-0.04638671875,
0.0902099609375,
-0.0024967193603515625,
0.00493621826171875,
0.0009021759033203125,
0.01125335693359375,
-0.0440673828125,
0.0271759033203125,
-0.035980224609375,
-0.0090484619140625,
-0.04168701171875,
0.03216552734375,
0.0791015625,
-0.003509521484375,
0.055633544921875,
0.017852783203125,
0.036529541015625,
0.06451416015625,
-0.0178375244140625,
0.0251617431640625,
0.05548095703125,
0.09075927734375,
0.00380706787109375,
0.01849365234375,
0.06756591796875,
-0.0252838134765625,
-0.04632568359375,
0.0044097900390625,
0.013092041015625,
0.00699615478515625,
-0.03192138671875,
-0.0003247261047363281,
-0.017913818359375,
-0.0263519287109375,
0.0238037109375,
0.0022430419921875,
-0.0177001953125,
-0.00034880638122558594,
-0.0196380615234375,
-0.0023632049560546875,
0.0103759765625,
-0.0191802978515625,
-0.0038661956787109375,
-0.02874755859375,
0.03729248046875,
0.0034275054931640625,
-0.00450897216796875,
-0.0372314453125,
-0.007404327392578125,
-0.0189666748046875,
-0.050811767578125,
-0.0092620849609375,
-0.0129241943359375,
-0.02398681640625,
-0.057830810546875,
0.004238128662109375,
0.00905609130859375,
0.033416748046875,
0.008056640625,
-0.0005674362182617188,
-0.02825927734375,
0.03509521484375,
-0.03411865234375,
0.028411865234375,
0.0124969482421875,
-0.073486328125,
-0.01557159423828125,
-0.0069732666015625,
0.015106201171875,
-0.018951416015625,
-0.05645751953125,
0.00958251953125,
-0.06854248046875,
0.00894927978515625,
-0.0106201171875,
-0.01453399658203125,
0.0562744140625,
-0.03497314453125,
-0.021453857421875,
0.0189056396484375,
-0.0031280517578125,
-0.002521514892578125,
0.0019989013671875,
-0.00726318359375,
-0.041290283203125,
-0.0056610107421875,
-0.0162811279296875,
-0.0034542083740234375,
0.0301361083984375,
-0.020294189453125,
-0.06915283203125,
0.09375,
-0.007740020751953125,
0.03594970703125,
0.00429534912109375,
0.032135009765625,
-0.025848388671875,
0.006755828857421875,
-0.0190277099609375,
0.06768798828125,
0.018829345703125,
0.026275634765625,
-0.023956298828125,
-0.0278472900390625,
0.025543212890625,
0.06280517578125,
0.0198516845703125,
0.00847625732421875,
-0.0196990966796875,
-0.0016736984252929688,
0.04144287109375,
0.00917816162109375,
-0.00844573974609375,
0.03302001953125,
0.0009851455688476562,
0.01068115234375,
0.02734375,
-0.050384521484375,
0.0187225341796875,
-0.02020263671875,
0.002552032470703125,
0.01287841796875,
0.01629638671875,
0.0115814208984375,
-0.017181396484375,
0.0135498046875,
-0.0675048828125,
0.0112152099609375,
0.035552978515625,
-0.004329681396484375,
0.0196990966796875,
0.040924072265625,
0.050323486328125,
-0.053375244140625,
0.01274871826171875,
-0.03680419921875,
0.0499267578125,
-0.009429931640625,
0.0115509033203125,
0.042388916015625,
0.0248260498046875,
0.0174102783203125,
0.00783538818359375,
0.01593017578125,
0.01361846923828125,
0.00212860107421875,
0.07366943359375,
0.04791259765625,
0.03277587890625,
-0.03997802734375,
-0.02142333984375,
0.061492919921875,
0.1097412109375,
-0.048980712890625,
-0.01126861572265625,
0.002216339111328125,
-0.0121307373046875,
0.00980377197265625,
-0.01142120361328125,
0.035400390625,
0.007099151611328125,
0.006732940673828125,
0.0020961761474609375,
-0.0172882080078125,
0.005596160888671875,
0.0240325927734375,
0.0252227783203125,
0.0296630859375,
-0.0254364013671875,
-0.02703857421875,
-0.03778076171875,
-0.00214385986328125,
0.028564453125,
0.047576904296875,
0.0144500732421875,
0.040008544921875,
-0.01751708984375,
-0.00952911376953125,
0.01393890380859375,
0.0016527175903320312,
-0.029327392578125,
-0.0105438232421875,
-0.016845703125,
-0.032745361328125,
-0.0258941650390625,
0.032501220703125,
0.063720703125,
0.03472900390625,
0.032012939453125,
-0.0160369873046875,
0.0009355545043945312,
0.0224761962890625,
0.0025730133056640625,
-0.024627685546875,
0.0019330978393554688,
0.0016927719116210938,
0.0146331787109375,
0.011871337890625,
-0.01358795166015625,
-0.02056884765625,
0.005504608154296875,
0.050018310546875,
-0.0191497802734375,
0.048858642578125,
-0.00225067138671875,
-0.0013065338134765625,
0.0016508102416992188,
-0.0098419189453125,
0.0263519287109375,
0.0014057159423828125,
-0.08648681640625,
-0.031524658203125,
-0.0291595458984375,
0.003772735595703125,
0.0224456787109375,
0.0261077880859375,
0.006717681884765625,
0.006015777587890625,
0.025146484375,
-0.006336212158203125,
-0.01026153564453125,
0.00232696533203125,
0.0149688720703125,
0.036468505859375,
0.018798828125,
0.03131103515625,
-0.01812744140625,
-0.00530242919921875,
-0.015228271484375,
0.0097808837890625,
0.049591064453125,
-0.02349853515625,
0.02783203125,
0.0301971435546875,
-0.00547027587890625,
0.0467529296875,
-0.049163818359375,
-0.037384033203125,
0.0865478515625,
-0.0272979736328125,
-0.00127410888671875,
-0.01003265380859375,
-0.08831787109375,
0.038421630859375,
0.014617919921875,
0.041900634765625,
0.04638671875,
-0.040863037109375,
0.0284576416015625,
0.005008697509765625,
0.0112152099609375,
-0.00689697265625,
0.004047393798828125,
-0.007488250732421875,
-0.00958251953125,
0.043731689453125,
0.03369140625,
-0.036529541015625,
0.0311126708984375,
0.047637939453125,
-0.031890869140625,
0.0372314453125,
-0.03173828125,
0.0592041015625,
0.047882080078125,
0.0238037109375,
-0.01763916015625,
-0.00006973743438720703,
-0.0101165771484375,
0.01062774658203125,
0.0250244140625,
-0.0031261444091796875,
0.01229095458984375,
-0.0229644775390625,
0.0160675048828125,
0.006938934326171875,
0.017059326171875,
-0.040924072265625,
0.0052032470703125,
0.019439697265625,
-0.006687164306640625,
0.032440185546875,
-0.07330322265625,
-0.02764892578125,
-0.0697021484375,
0.006256103515625,
0.04901123046875,
-0.047088623046875,
0.021392822265625,
-0.0361328125,
0.00672149658203125,
0.01494598388671875,
0.0224456787109375,
-0.057830810546875,
0.06451416015625,
-0.0105438232421875,
0.0003573894500732422,
-0.0254058837890625,
-0.005157470703125,
-0.01287078857421875,
-0.053314208984375,
-0.0044403076171875,
0.0010461807250976562,
-0.04620361328125,
0.031982421875,
-0.01024627685546875,
0.00130462646484375,
0.0235443115234375,
-0.01195526123046875,
-0.00984954833984375,
-0.024444580078125,
-0.005924224853515625,
0.037994384765625,
0.0125579833984375,
-0.036773681640625,
-0.0020198822021484375,
-0.007541656494140625,
0.006427764892578125,
0.01204681396484375,
0.0230865478515625,
-0.0200042724609375,
-0.049560546875,
0.016082763671875,
-0.031280517578125,
0.0008292198181152344,
-0.040557861328125,
-0.083984375,
0.038543701171875,
-0.00630950927734375,
-0.052947998046875,
0.01413726806640625,
0.031494140625,
-0.007781982421875,
-0.005035400390625,
0.0165863037109375,
-0.040008544921875,
0.0162200927734375,
0.003215789794921875,
0.018524169921875,
0.042694091796875,
0.00473785400390625,
0.0188446044921875,
-0.0308837890625,
0.0245513916015625,
-0.0026683807373046875,
0.006229400634765625,
-0.00011342763900756836,
0.01453399658203125,
0.0012235641479492188,
0.0245361328125,
-0.034820556640625,
0.0194091796875,
-0.01105499267578125,
0.02374267578125,
-0.0150299072265625,
-0.004638671875,
-0.015411376953125,
-0.00823211669921875,
0.06622314453125,
0.029022216796875,
0.00919342041015625,
-0.0184173583984375,
0.0035305023193359375,
-0.0033855438232421875,
-0.06658935546875,
-0.01435089111328125,
0.041015625,
-0.066162109375,
-0.0244293212890625,
0.005702972412109375,
0.00383758544921875,
-0.03155517578125,
-0.00214385986328125,
-0.022125244140625,
-0.029937744140625,
-0.01459503173828125,
0.004817962646484375,
-0.020538330078125,
0.020477294921875,
0.0701904296875,
-0.046112060546875,
0.0022945404052734375,
0.0209197998046875,
-0.005130767822265625,
0.017578125,
0.0042266845703125,
0.006683349609375,
0.032958984375,
-0.031494140625,
-0.0221710205078125,
0.0305938720703125,
0.03289794921875,
0.0104827880859375,
-0.021514892578125,
-0.02789306640625,
0.01410675048828125,
0.0003714561462402344,
0.0162353515625,
-0.0186309814453125,
0.0164947509765625,
0.01708984375,
0.04205322265625,
0.01181793212890625,
0.06689453125,
0.027130126953125,
0.038909912109375,
0.00014412403106689453,
-0.0305328369140625,
0.0181427001953125,
-0.0517578125,
-0.01397705078125,
-0.03338623046875,
-0.03509521484375,
-0.08197021484375,
0.01922607421875,
0.006916046142578125,
-0.020477294921875,
0.038787841796875
] |
4f0d3d0f92ce71d88c42eaf2e7dca53733ca31bf
|
Wordpress Stackexchange
Q: How to implement add_image_size in a plugin I created a plugin and I need to use add_image_size in it.
I know how it works in the functions.php file and for a theme, but how can I implement this in a plugin?
I want new images uploaded by WordPress users to be smaller for mobile screens by
add_image_size( 'wp_small', 60, 75, true ); // mobile
I read that you need to use init or admin_init but I don't know how to implement this.
A: Just call this function in the init action. This action is fired for both frontend and backend. So it should look like this:
add_action( 'init', 'wpse4378_add_new_image_size' );
function wpse4378_add_new_image_size() {
add_image_size( 'wp_small', 60, 75, true ); //mobile
}
|
Q: How to implement add_image_size in a plugin I created a plugin and I need to use add_image_size in it.
I know how it works in the functions.php file and for a theme, but how can I implement this in a plugin?
I want new images uploaded by WordPress users to be smaller for mobile screens by
add_image_size( 'wp_small', 60, 75, true ); // mobile
I read that you need to use init or admin_init but I don't know how to implement this.
A: Just call this function in the init action. This action is fired for both frontend and backend. So it should look like this:
add_action( 'init', 'wpse4378_add_new_image_size' );
function wpse4378_add_new_image_size() {
add_image_size( 'wp_small', 60, 75, true ); //mobile
}
A: It's better to call it in after_setup_theme instead of init action:
Codex says you should call add_image_size in functions.php so the closest action is after_setup_theme. Then you have:
add_action( 'after_setup_theme', 'your_theme_setup' );
function your_theme_setup() {
add_image_size( 'wp_small', 60, 75, true ); //mobile
}
(Also explained in user contributed notes)
|
wordpress
|
{
"language": "en",
"length": 172,
"provenance": "stackexchange_00019.jsonl.gz:420606",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54423"
}
|
[
0.01363372802734375,
-0.0094146728515625,
-0.01520538330078125,
0.03265380859375,
0.009552001953125,
-0.0313720703125,
0.05499267578125,
-0.030181884765625,
0.0047607421875,
0.0017995834350585938,
-0.03887939453125,
0.024139404296875,
-0.03558349609375,
-0.0019407272338867188,
0.0023250579833984375,
-0.0275115966796875,
0.057403564453125,
-0.03106689453125,
0.03387451171875,
-0.0014286041259765625,
-0.004261016845703125,
0.0501708984375,
0.0167694091796875,
0.053680419921875,
-0.0162506103515625,
-0.006011962890625,
0.06951904296875,
-0.0159759521484375,
-0.027130126953125,
-0.03173828125,
-0.0010356903076171875,
0.0306396484375,
0.00710296630859375,
0.013092041015625,
0.004749298095703125,
0.00738525390625,
0.0248565673828125,
-0.0108795166015625,
-0.0014429092407226562,
0.03106689453125,
0.0640869140625,
-0.029510498046875,
0.041168212890625,
0.00652313232421875,
0.014434814453125,
-0.033935546875,
0.0804443359375,
-0.038330078125,
0.0010347366333007812,
-0.042572021484375,
0.0235748291015625,
0.0012378692626953125,
0.05560302734375,
-0.030670166015625,
-0.0087432861328125,
0.0206146240234375,
-0.042724609375,
0.062286376953125,
0.029022216796875,
0.00946807861328125,
-0.0248260498046875,
0.00621795654296875,
0.00635528564453125,
-0.03302001953125,
0.026123046875,
-0.007648468017578125,
-0.015655517578125,
0.034698486328125,
-0.0072021484375,
-0.0026226043701171875,
-0.0162811279296875,
-0.0249176025390625,
-0.01812744140625,
-0.0099334716796875,
-0.036041259765625,
-0.0120391845703125,
0.04888916015625,
-0.029083251953125,
-0.0173797607421875,
-0.00032830238342285156,
0.036041259765625,
0.0206146240234375,
0.01519012451171875,
-0.035888671875,
0.041778564453125,
0.0095062255859375,
-0.00836944580078125,
-0.025054931640625,
-0.0291595458984375,
0.0026378631591796875,
-0.029022216796875,
-0.02716064453125,
0.00783538818359375,
-0.004505157470703125,
-0.0287933349609375,
-0.0103607177734375,
0.018280029296875,
0.0280914306640625,
0.0084075927734375,
0.045196533203125,
0.0180511474609375,
-0.069091796875,
0.07421875,
-0.05279541015625,
0.0231781005859375,
0.024200439453125,
-0.036376953125,
-0.0127716064453125,
0.05194091796875,
0.03759765625,
0.005680084228515625,
0.016021728515625,
-0.01837158203125,
-0.02154541015625,
0.016387939453125,
0.020843505859375,
-0.0347900390625,
0.052032470703125,
-0.00039505958557128906,
0.036346435546875,
-0.0064697265625,
0.0070648193359375,
-0.00699615478515625,
0.01087188720703125,
0.00304412841796875,
-0.00009566545486450195,
-0.01202392578125,
-0.022003173828125,
-0.01085662841796875,
0.004150390625,
-0.03167724609375,
0.043731689453125,
0.058380126953125,
-0.0033855438232421875,
-0.006610870361328125,
-0.0023174285888671875,
0.010009765625,
-0.049163818359375,
-0.0280303955078125,
0.0146331787109375,
-0.037750244140625,
-0.0127105712890625,
0.031097412109375,
-0.048980712890625,
0.00852203369140625,
0.0020046234130859375,
-0.0197906494140625,
0.0258636474609375,
0.031646728515625,
-0.0584716796875,
0.054107666015625,
-0.060516357421875,
0.01013946533203125,
0.012603759765625,
0.0120697021484375,
0.049957275390625,
0.0146026611328125,
0.0131683349609375,
-0.0418701171875,
0.006885528564453125,
-0.0080108642578125,
0.031646728515625,
0.0423583984375,
0.0216522216796875,
0.0270233154296875,
-0.038116455078125,
-0.01459503173828125,
0.0140380859375,
0.0284576416015625,
-0.006526947021484375,
0.025634765625,
0.00353240966796875,
-0.0026302337646484375,
0.005802154541015625,
-0.0008206367492675781,
0.00518035888671875,
-0.0184478759765625,
0.046417236328125,
0.027618408203125,
0.006153106689453125,
0.0033359527587890625,
-0.022247314453125,
0.11102294921875,
-0.025360107421875,
0.004901885986328125,
-0.046051025390625,
-0.00010824203491210938,
-0.04058837890625,
0.0160064697265625,
0.01432037353515625,
-0.0107421875,
0.0283203125,
-0.03802490234375,
0.0286865234375,
-0.01416778564453125,
-0.0249786376953125,
-0.0008974075317382812,
-0.0044403076171875,
-0.0172882080078125,
0.00511932373046875,
0.0249786376953125,
0.00296783447265625,
0.0197906494140625,
0.0152435302734375,
-0.0430908203125,
0.0252838134765625,
-0.0201416015625,
0.01412200927734375,
0.00766754150390625,
0.0191650390625,
-0.0011301040649414062,
0.0035552978515625,
-0.002315521240234375,
-0.037200927734375,
-0.000026047229766845703,
0.0304412841796875,
-0.004486083984375,
0.02783203125,
0.0017366409301757812,
0.037567138671875,
-0.020263671875,
-0.02471923828125,
-0.013885498046875,
0.005157470703125,
0.0240936279296875,
0.00795745849609375,
-0.0233306884765625,
-0.00989532470703125,
0.0008487701416015625,
0.0129852294921875,
-0.032257080078125,
0.0341796875,
-0.0273284912109375,
0.01175689697265625,
-0.0045166015625,
-0.032012939453125,
-0.0210723876953125,
-0.11090087890625,
0.038726806640625,
0.0657958984375,
0.0303802490234375,
0.03302001953125,
0.01299285888671875,
0.02392578125,
0.0762939453125,
0.016265869140625,
0.028411865234375,
-0.005939483642578125,
-0.00841522216796875,
-0.007640838623046875,
0.005008697509765625,
-0.01702880859375,
0.0413818359375,
-0.07171630859375,
0.01739501953125,
0.04254150390625,
-0.036346435546875,
-0.0263824462890625,
-0.0251007080078125,
0.0185699462890625,
0.0053558349609375,
0.01169586181640625,
0.011505126953125,
-0.01136016845703125,
0.01032257080078125,
0.0131988525390625,
0.005741119384765625,
0.009246826171875,
-0.0285797119140625,
0.034759521484375,
0.034698486328125,
-0.0364990234375,
0.00415802001953125,
-0.01108551025390625,
-0.048828125,
-0.0013132095336914062,
-0.0472412109375,
0.041595458984375,
0.0302886962890625,
-0.01055908203125,
-0.0265045166015625,
-0.02081298828125,
-0.049591064453125,
-0.01187896728515625,
-0.0156707763671875,
-0.0491943359375,
0.031982421875,
0.029266357421875,
0.032806396484375,
-0.0004069805145263672,
0.01666259765625,
0.04095458984375,
0.01012420654296875,
0.042327880859375,
-0.005741119384765625,
-0.00664520263671875,
0.0193328857421875,
-0.0261993408203125,
0.042633056640625,
-0.03900146484375,
0.05523681640625,
0.055267333984375,
-0.0477294921875,
0.0292510986328125,
-0.01540374755859375,
-0.032196044921875,
-0.0291748046875,
0.009918212890625,
-0.0173187255859375,
-0.0198974609375,
-0.04150390625,
0.03863525390625,
0.0132904052734375,
-0.0173797607421875,
0.002529144287109375,
-0.016510009765625,
-0.00980377197265625,
0.007843017578125,
-0.00988006591796875,
0.025848388671875,
-0.0008068084716796875,
-0.12030029296875,
-0.03497314453125,
0.0041046142578125,
-0.07745361328125,
0.0167236328125,
0.05694580078125,
-0.00591278076171875,
-0.026519775390625,
-0.028076171875,
0.024871826171875,
-0.03839111328125,
-0.0160369873046875,
-0.0275726318359375,
0.0176544189453125,
0.004589080810546875,
-0.0009756088256835938,
0.05291748046875,
0.0164947509765625,
-0.00951385498046875,
0.02301025390625,
-0.0024566650390625,
-0.004154205322265625,
0.01715087890625,
0.039337158203125,
-0.01078033447265625,
-0.01290130615234375,
0.0161895751953125,
-0.0030422210693359375,
0.0345458984375,
-0.052581787109375,
-0.0128631591796875,
-0.04937744140625,
-0.0736083984375,
-0.050048828125,
0.06915283203125,
0.051910400390625,
-0.07110595703125,
0.0158538818359375,
-0.0772705078125,
0.0207672119140625,
-0.027557373046875,
-0.040557861328125,
0.0257568359375,
0.01061248779296875,
0.0106658935546875,
0.0208587646484375,
-0.016265869140625,
0.019866943359375,
0.004657745361328125,
0.0212554931640625,
-0.01812744140625,
0.03057861328125,
0.004302978515625,
0.00792694091796875,
-0.04522705078125,
0.0159149169921875,
-0.0156707763671875,
-0.01178741455078125,
-0.0108795166015625,
0.00574493408203125,
-0.017242431640625,
0.01434326171875,
-0.043670654296875,
-0.01364898681640625,
0.013946533203125,
-0.00861358642578125,
0.0282135009765625,
-0.00516510009765625,
-0.0086822509765625,
-0.0012187957763671875,
0.04962158203125,
-0.068359375,
-0.01904296875,
-0.0160980224609375,
0.01910400390625,
-0.05206298828125,
-0.046875,
-0.037567138671875,
-0.00543212890625,
-0.040618896484375,
-0.00325775146484375,
-0.00461578369140625,
-0.0229034423828125,
-0.01261138916015625,
0.0135498046875,
-0.0306854248046875,
-0.0196075439453125,
0.0295562744140625,
-0.01146697998046875,
-0.0017118453979492188,
0.0077972412109375,
-0.0246429443359375,
0.012725830078125,
-0.0141754150390625,
-0.0174102783203125,
-0.08441162109375,
-0.0038623809814453125,
-0.047027587890625,
0.07635498046875,
0.003704071044921875,
0.0258941650390625,
-0.035125732421875,
0.03851318359375,
-0.0030269622802734375,
0.0042266845703125,
0.0005331039428710938,
0.0292510986328125,
-0.023223876953125,
-0.005382537841796875,
0.00589752197265625,
-0.0254364013671875,
0.0175933837890625,
-0.006561279296875,
-0.041259765625,
-0.01430511474609375,
-0.035003662109375,
-0.01708984375,
-0.005615234375,
-0.044342041015625,
-0.006031036376953125,
-0.0162506103515625,
-0.0204925537109375,
0.0272979736328125,
-0.01447296142578125,
0.0016374588012695312,
-0.041534423828125,
-0.020904541015625,
0.02191162109375,
0.003753662109375,
0.0243682861328125,
0.006053924560546875,
0.07989501953125,
0.0205535888671875,
-0.00780487060546875,
-0.036407470703125,
-0.006290435791015625,
0.02740478515625,
0.040069580078125,
0.01074981689453125,
0.001598358154296875,
-0.024505615234375,
0.01456451416015625,
0.036590576171875,
0.0236968994140625,
-0.032440185546875,
0.057830810546875,
-0.002094268798828125,
-0.017791748046875,
0.03656005859375,
0.0029544830322265625,
-0.0137939453125,
-0.01413726806640625,
-0.022430419921875,
0.0031948089599609375,
-0.007427215576171875,
-0.00215911865234375,
-0.0312347412109375,
0.048309326171875,
0.010986328125,
-0.057708740234375,
0.0228424072265625,
-0.011474609375,
-0.008453369140625,
-0.01348876953125,
-0.0019521713256835938,
-0.004917144775390625,
-0.00971221923828125,
0.010528564453125,
-0.002105712890625,
0.011993408203125,
-0.0226287841796875,
0.04083251953125,
-0.003387451171875,
-0.0114593505859375,
-0.0101318359375,
0.0011434555053710938,
-0.0152435302734375,
0.0107269287109375,
-0.007232666015625,
-0.057525634765625,
0.0067291259765625,
0.0219573974609375,
-0.0279541015625,
-0.0169219970703125,
0.051177978515625,
0.018890380859375,
-0.01153564453125,
-0.01434326171875,
-0.039886474609375,
-0.007549285888671875,
-0.05560302734375,
0.003597259521484375,
0.009307861328125,
-0.022918701171875,
0.039642333984375,
-0.0063629150390625,
-0.005672454833984375,
0.012420654296875,
0.0081787109375,
0.058563232421875,
0.05010986328125,
0.040740966796875,
0.01239776611328125,
-0.01444244384765625,
-0.0228271484375,
0.026580810546875,
-0.0204925537109375,
-0.006561279296875,
0.0230560302734375,
0.0252227783203125,
-0.0020751953125,
-0.0390625,
-0.03350830078125,
0.0418701171875,
0.01123046875,
0.0153656005859375,
0.0300140380859375,
-0.03594970703125,
-0.06549072265625,
-0.01177215576171875,
0.05560302734375,
0.07110595703125,
-0.06298828125,
-0.0157623291015625,
-0.01074981689453125,
-0.01629638671875,
0.0267791748046875,
0.01544189453125,
-0.0177001953125,
0.0243682861328125,
0.0205078125,
-0.034332275390625,
-0.0121307373046875,
-0.048309326171875,
0.05047607421875,
-0.002834320068359375,
-0.0033283233642578125,
-0.031829833984375,
0.0243682861328125,
-0.034454345703125,
0.0085601806640625,
-0.0211639404296875,
0.006465911865234375,
-0.033477783203125,
0.006072998046875,
0.034637451171875,
0.0139923095703125,
0.01548004150390625,
-0.047119140625,
-0.01806640625,
-0.033935546875,
0.003200531005859375,
0.0024738311767578125,
-0.00933074951171875,
-0.00055694580078125,
-0.01195526123046875,
0.006420135498046875,
-0.041290283203125,
-0.03076171875,
-0.0184478759765625,
0.0249786376953125,
0.0224151611328125,
0.0008678436279296875,
0.00188446044921875,
0.059478759765625,
0.00719451904296875,
0.041748046875,
0.0287628173828125,
0.038116455078125,
-0.017059326171875,
-0.0113372802734375,
-0.01334381103515625,
-0.02203369140625,
0.0001825094223022461,
-0.00478363037109375,
0.0081024169921875,
-0.001628875732421875,
0.0278167724609375,
0.0113525390625,
-0.0037174224853515625,
-0.01800537109375,
-0.017669677734375,
-0.028076171875,
0.04071044921875,
0.0179443359375,
0.035797119140625,
-0.0205535888671875,
-0.06573486328125,
-0.023345947265625,
-0.0018978118896484375,
0.03912353515625,
0.021484375,
-0.049072265625,
-0.0016222000122070312,
0.048004150390625,
-0.049713134765625,
0.048004150390625,
0.102783203125,
0.012359619140625,
0.06341552734375,
0.02166748046875,
0.006580352783203125,
0.0202789306640625,
-0.007663726806640625,
-0.00930023193359375,
0.0025920867919921875,
0.05401611328125,
0.00860595703125,
-0.0123291015625,
0.04693603515625,
-0.0270233154296875,
0.02813720703125,
0.006961822509765625,
0.039154052734375,
-0.049468994140625,
0.04168701171875,
0.008209228515625,
0.0301971435546875,
0.06646728515625,
-0.01195526123046875,
0.017669677734375,
-0.008331298828125,
0.05035400390625,
-0.0010318756103515625,
0.0026226043701171875,
0.0243682861328125,
-0.0194244384765625,
-0.03155517578125,
0.0107269287109375,
0.0033855438232421875,
0.0306243896484375,
-0.02838134765625,
0.018585205078125,
0.021331787109375,
0.007659912109375,
0.0021266937255859375,
0.037689208984375,
-0.021270751953125,
-0.018524169921875,
-0.03594970703125,
0.004283905029296875,
0.00789642333984375,
-0.040008544921875,
0.048828125,
-0.005405426025390625,
0.016937255859375,
0.0391845703125,
0.00783538818359375,
-0.003566741943359375,
0.005931854248046875,
-0.046844482421875,
0.040496826171875,
-0.02276611328125,
0.01493072509765625,
0.01556396484375,
-0.0994873046875,
0.0043487548828125,
-0.040740966796875,
0.035919189453125,
0.003086090087890625,
-0.01348114013671875,
0.06304931640625,
-0.04034423828125,
-0.006927490234375,
0.0272369384765625,
-0.00714111328125,
-0.0140838623046875,
-0.009552001953125,
0.0421142578125,
-0.0244140625,
-0.004787445068359375,
0.01016998291015625,
-0.00829315185546875,
0.00891876220703125,
0.0074310302734375,
-0.05047607421875,
0.0992431640625,
-0.044036865234375,
0.025970458984375,
0.005558013916015625,
0.0335693359375,
0.003448486328125,
0.016845703125,
-0.0233612060546875,
0.01194000244140625,
-0.06756591796875,
0.00872039794921875,
-0.042755126953125,
0.02178955078125,
-0.035369873046875,
0.00337982177734375,
0.07574462890625,
0.019989013671875,
-0.08349609375,
-0.0183868408203125,
0.055084228515625,
0.04443359375,
0.02313232421875,
0.06439208984375,
-0.014862060546875,
-0.06292724609375,
0.033538818359375,
0.040771484375,
0.03802490234375,
0.00411224365234375,
-0.0091094970703125,
0.01380157470703125,
-0.0117034912109375,
-0.01399993896484375,
-0.026611328125,
0.0157623291015625,
-0.01158905029296875,
-0.0279083251953125,
0.013427734375,
-0.045257568359375,
0.0170745849609375,
0.040771484375,
-0.0032138824462890625,
0.052978515625,
-0.0026454925537109375,
0.00838470458984375,
0.0216217041015625,
-0.032073974609375,
0.0193634033203125,
0.0192413330078125,
0.00650787353515625,
0.037628173828125,
0.0073394775390625,
0.013275146484375,
0.052276611328125,
-0.0133514404296875,
0.020599365234375,
0.0025005340576171875,
-0.0017795562744140625,
-0.045562744140625,
0.01111602783203125,
0.0318603515625,
0.0435791015625,
-0.03826904296875,
-0.032012939453125,
0.0080108642578125,
0.01416778564453125,
0.02227783203125,
0.004779815673828125,
0.042633056640625,
-0.057952880859375,
-0.0137786865234375,
-0.00007206201553344727,
0.00666046142578125,
0.017120361328125,
0.023101806640625,
0.0107269287109375,
0.037750244140625,
-0.05816650390625,
-0.017181396484375,
-0.028045654296875,
0.0101776123046875,
0.00438690185546875,
-0.0027294158935546875,
0.004669189453125,
0.0264434814453125,
0.050567626953125,
0.004558563232421875,
-0.040496826171875,
0.038299560546875,
0.020904541015625,
0.051483154296875,
-0.0168609619140625,
0.0210723876953125,
0.004993438720703125,
0.0186309814453125,
-0.01605224609375,
0.0164947509765625,
0.03564453125,
-0.0016927719116210938,
-0.0667724609375,
-0.00890350341796875,
0.0283966064453125,
-0.03814697265625,
-0.0020198822021484375,
-0.03033447265625,
0.02606201171875,
0.030364990234375,
-0.0007495880126953125,
0.0082855224609375,
0.0025119781494140625,
0.043060302734375,
-0.035675048828125,
0.0018405914306640625,
-0.01158905029296875,
-0.05853271484375,
0.03375244140625,
-0.002826690673828125,
0.06683349609375,
-0.0194091796875,
-0.049407958984375,
0.00981903076171875,
-0.0517578125,
-0.0662841796875,
0.0399169921875,
0.027008056640625,
-0.042938232421875,
0.055328369140625,
0.043975830078125,
-0.006839752197265625,
-0.00722503662109375,
0.0011606216430664062,
0.025970458984375,
-0.0301971435546875,
0.0175933837890625,
0.006778717041015625,
-0.047027587890625,
-0.0185394287109375,
-0.02734375,
0.0260009765625,
0.01493072509765625,
0.08465576171875,
-0.037506103515625,
0.023406982421875,
-0.0093536376953125,
-0.052215576171875,
0.042816162109375,
-0.004245758056640625,
0.0099029541015625,
0.0120697021484375,
-0.0465087890625,
-0.02545166015625,
-0.005496978759765625,
-0.028594970703125,
0.033294677734375,
-0.0477294921875,
-0.04254150390625,
-0.0132598876953125,
0.032135009765625,
0.01010894775390625,
0.01666259765625,
-0.0243072509765625,
-0.006046295166015625,
-0.0157623291015625,
-0.0191802978515625,
0.0196990966796875,
-0.013397216796875,
-0.00029468536376953125,
0.0211944580078125,
-0.011749267578125,
-0.01354217529296875,
0.0204925537109375,
-0.030670166015625,
0.0072174072265625,
0.0283050537109375,
-0.01554107666015625,
-0.0313720703125,
0.01885986328125,
-0.01143646240234375,
-0.017852783203125,
0.0122833251953125,
0.056671142578125,
0.00537109375,
-0.040191650390625,
0.06671142578125,
0.0161285400390625,
0.022308349609375,
-0.054290771484375,
-0.01837158203125,
0.06365966796875,
0.00928497314453125,
-0.0010814666748046875,
0.0004982948303222656,
-0.020599365234375,
-0.059906005859375,
0.005283355712890625,
0.01654052734375,
-0.00614166259765625,
-0.0017995834350585938,
-0.02838134765625,
0.06927490234375,
0.02716064453125,
-0.007709503173828125,
-0.06072998046875,
0.041259765625,
-0.0516357421875,
0.0732421875,
-0.0006585121154785156,
-0.0080718994140625,
0.00567626953125,
0.037445068359375,
-0.031402587890625,
-0.056610107421875,
-0.032623291015625,
0.03643798828125,
-0.047637939453125,
0.0614013671875,
0.054931640625,
-0.05780029296875,
0.00023698806762695312,
0.0845947265625,
0.054656982421875,
0.1324462890625,
-0.01203155517578125,
-0.026214599609375,
0.0309295654296875,
-0.0027484893798828125,
0.0013828277587890625,
-0.057098388671875,
-0.006298065185546875,
-0.061492919921875,
0.01471710205078125,
-0.04498291015625,
0.0199432373046875,
0.0128326416015625,
-0.032989501953125,
-0.06158447265625,
0.02459716796875,
-0.0208892822265625,
-0.0174560546875,
-0.071533203125,
0.0241241455078125,
0.0095062255859375,
0.0307464599609375,
-0.00042891502380371094,
-0.0278472900390625,
-0.016204833984375,
0.027313232421875,
-0.005214691162109375,
-0.025604248046875,
0.042327880859375,
-0.0242156982421875,
-0.02789306640625,
0.00441741943359375,
0.03302001953125,
-0.031036376953125,
0.027801513671875,
-0.00513458251953125,
0.024566650390625,
0.040771484375,
-0.02923583984375,
-0.027740478515625,
-0.0197906494140625,
-0.0303497314453125,
-0.04083251953125,
-0.05047607421875,
0.008819580078125,
0.0036487579345703125,
0.0933837890625,
0.022613525390625,
0.0079345703125,
-0.0570068359375,
-0.0030422210693359375,
-0.014190673828125,
0.00943756103515625,
-0.01264190673828125,
-0.004604339599609375,
-0.03643798828125,
-0.0033359527587890625,
-0.01904296875,
0.00860595703125,
-0.01012420654296875,
0.0311737060546875,
-0.016937255859375,
-0.03033447265625,
0.00838470458984375,
-0.007228851318359375,
-0.06939697265625,
0.035980224609375,
0.054473876953125,
-0.039276123046875,
0.01148223876953125,
-0.014007568359375,
-0.00516510009765625,
0.036102294921875,
-0.0227203369140625,
-0.004016876220703125,
0.0439453125,
-0.044403076171875,
0.0181884765625,
-0.0004734992980957031,
0.0037326812744140625,
-0.048431396484375,
0.01611328125,
-0.00933837890625,
0.027435302734375,
0.003917694091796875,
0.045654296875,
-0.009521484375,
0.0272064208984375,
0.01407623291015625,
-0.0193939208984375,
-0.026031494140625,
-0.0157623291015625,
-0.033721923828125,
0.01276397705078125,
0.001983642578125,
0.00598907470703125,
0.045806884765625,
-0.0185546875,
-0.00646209716796875,
0.01531982421875,
-0.051727294921875,
-0.0274200439453125,
-0.006603240966796875,
-0.03729248046875,
-0.00823211669921875,
-0.004047393798828125
] |
9fcbeb286f838c0da5629140d6f517f9462ca55e
|
Wordpress Stackexchange
Q: What is the advantage of separating wp_users and wp_usermeta table? I want to know why Wordpress designed their database with two tables separating users and meta from each other. Wouldn't it be better if first_name, last_name, nickname, description, and capabilities are in the wp_users table?
SO what's the advantage for doing this separation?
A: The meta table is build to allow custom user meta. If anything would be in just one table a plugin developer had to add a new column to the table for each meta data or the data had to be stored as serialized arrays/objects which would made them unsearchable.
Short: Performance and flexibility.
|
Q: What is the advantage of separating wp_users and wp_usermeta table? I want to know why Wordpress designed their database with two tables separating users and meta from each other. Wouldn't it be better if first_name, last_name, nickname, description, and capabilities are in the wp_users table?
SO what's the advantage for doing this separation?
A: The meta table is build to allow custom user meta. If anything would be in just one table a plugin developer had to add a new column to the table for each meta data or the data had to be stored as serialized arrays/objects which would made them unsearchable.
Short: Performance and flexibility.
|
wordpress
|
{
"language": "en",
"length": 108,
"provenance": "stackexchange_00019.jsonl.gz:420610",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54446"
}
|
[
0.049468994140625,
-0.01218414306640625,
-0.051727294921875,
-0.048187255859375,
0.013397216796875,
-0.04559326171875,
0.012298583984375,
0.01172637939453125,
0.005889892578125,
0.04669189453125,
0.0171051025390625,
0.01023101806640625,
0.037506103515625,
-0.0306243896484375,
-0.0018491744995117188,
0.006046295166015625,
0.0218505859375,
0.02587890625,
-0.01398468017578125,
-0.0052947998046875,
-0.00699615478515625,
0.01377105712890625,
-0.04058837890625,
-0.01068115234375,
0.044342041015625,
-0.09259033203125,
-0.01214599609375,
-0.0285186767578125,
0.0222930908203125,
-0.01201629638671875,
0.0106964111328125,
0.026336669921875,
-0.013153076171875,
-0.004150390625,
0.04583740234375,
-0.020050048828125,
0.0284423828125,
0.01395416259765625,
0.0186767578125,
0.00917816162109375,
0.0007724761962890625,
0.007740020751953125,
-0.005878448486328125,
0.0059661865234375,
-0.031524658203125,
-0.023345947265625,
0.0009264945983886719,
-0.016815185546875,
0.02362060546875,
-0.049407958984375,
-0.0199127197265625,
0.0175323486328125,
0.01448822021484375,
-0.025665283203125,
-0.00682830810546875,
0.006561279296875,
0.0006060600280761719,
-0.035675048828125,
0.0233917236328125,
0.007328033447265625,
-0.007843017578125,
-0.012420654296875,
0.0207672119140625,
-0.0180206298828125,
0.0104827880859375,
-0.036712646484375,
-0.008941650390625,
0.04071044921875,
-0.02783203125,
-0.01031494140625,
0.0243072509765625,
-0.00772857666015625,
0.0026645660400390625,
-0.023345947265625,
-0.040496826171875,
0.034271240234375,
0.007965087890625,
-0.0273590087890625,
0.0154876708984375,
-0.02935791015625,
-0.0731201171875,
-0.0306854248046875,
-0.0628662109375,
-0.04638671875,
-0.00525665283203125,
-0.025482177734375,
-0.030487060546875,
0.0321044921875,
-0.006336212158203125,
-0.004268646240234375,
-0.00795745849609375,
-0.07293701171875,
-0.0243682861328125,
0.0634765625,
0.0184783935546875,
-0.0287933349609375,
0.0364990234375,
0.06414794921875,
-0.02587890625,
-0.0177001953125,
0.043792724609375,
-0.0546875,
0.025787353515625,
-0.0293121337890625,
0.0241241455078125,
0.030426025390625,
-0.03863525390625,
-0.0274200439453125,
0.0228118896484375,
0.0227508544921875,
0.0025234222412109375,
-0.021453857421875,
0.0036163330078125,
-0.06878662109375,
0.0146331787109375,
0.01873779296875,
-0.01160430908203125,
0.042755126953125,
0.040374755859375,
-0.01374053955078125,
-0.00966644287109375,
0.006328582763671875,
-0.013702392578125,
0.0012073516845703125,
-0.0033779144287109375,
-0.0266876220703125,
-0.019744873046875,
0.0265045166015625,
-0.0743408203125,
0.06121826171875,
0.009185791015625,
-0.0301361083984375,
-0.00989532470703125,
0.052825927734375,
-0.01171875,
-0.019073486328125,
0.03125,
-0.0266876220703125,
-0.043731689453125,
0.060272216796875,
-0.023590087890625,
-0.06158447265625,
-0.0322265625,
-0.0123748779296875,
-0.05487060546875,
0.03228759765625,
0.0229034423828125,
-0.005710601806640625,
-0.041168212890625,
-0.048370361328125,
-0.06219482421875,
-0.005672454833984375,
-0.046295166015625,
0.0304718017578125,
0.0147857666015625,
0.029541015625,
-0.0367431640625,
0.020782470703125,
0.024383544921875,
0.038604736328125,
0.0035572052001953125,
0.0009126663208007812,
0.01036834716796875,
-0.010955810546875,
-0.02972412109375,
-0.0014142990112304688,
-0.014068603515625,
-0.006366729736328125,
0.024566650390625,
0.0208282470703125,
0.0089263916015625,
-0.0004992485046386719,
0.067138671875,
0.0172119140625,
-0.006160736083984375,
0.02093505859375,
-0.004108428955078125,
-0.001201629638671875,
0.03521728515625,
-0.007801055908203125,
-0.03045654296875,
-0.034271240234375,
0.053375244140625,
-0.0270843505859375,
-0.03863525390625,
0.07196044921875,
0.0087738037109375,
0.074462890625,
-0.008575439453125,
0.016143798828125,
0.01129913330078125,
0.033782958984375,
0.0001251697540283203,
0.057891845703125,
0.0267791748046875,
-0.053802490234375,
0.0100555419921875,
-0.01459503173828125,
0.0006775856018066406,
-0.050079345703125,
0.062408447265625,
0.033111572265625,
0.00988006591796875,
-0.023773193359375,
-0.07489013671875,
0.032440185546875,
-0.0265960693359375,
0.0379638671875,
-0.05853271484375,
-0.0013599395751953125,
0.03314208984375,
-0.033599853515625,
-0.037384033203125,
0.05364990234375,
0.0211334228515625,
-0.0321044921875,
0.00905609130859375,
0.042816162109375,
0.024078369140625,
0.0238494873046875,
0.033538818359375,
-0.01509857177734375,
0.0166778564453125,
0.0004811286926269531,
0.0272064208984375,
-0.004955291748046875,
-0.0051422119140625,
-0.007030487060546875,
0.033905029296875,
0.01541900634765625,
-0.0056610107421875,
0.030364990234375,
0.03619384765625,
0.061553955078125,
0.006481170654296875,
0.01525115966796875,
0.021148681640625,
-0.054718017578125,
-0.00017786026000976562,
0.0206451416015625,
0.0352783203125,
0.02813720703125,
-0.016357421875,
-0.0078887939453125,
0.035491943359375,
-0.04486083984375,
0.00289154052734375,
0.0095367431640625,
0.00287628173828125,
0.022247314453125,
0.00800323486328125,
0.00788116455078125,
0.029876708984375,
-0.0450439453125,
-0.0144500732421875,
0.04901123046875,
-0.080078125,
0.01236724853515625,
0.040863037109375,
-0.01224517822265625,
-0.029205322265625,
-0.006755828857421875,
0.07421875,
-0.047271728515625,
0.039947509765625,
-0.0021190643310546875,
0.039520263671875,
0.0281219482421875,
-0.0208587646484375,
0.01081085205078125,
0.01267242431640625,
-0.0042877197265625,
0.017852783203125,
-0.00554656982421875,
0.0089111328125,
0.0369873046875,
-0.010162353515625,
-0.01270294189453125,
0.023834228515625,
0.0109710693359375,
0.0035419464111328125,
0.007228851318359375,
-0.0099029541015625,
0.001789093017578125,
0.0014553070068359375,
-0.034454345703125,
0.0122222900390625,
0.032989501953125,
0.004268646240234375,
0.008544921875,
0.0283050537109375,
0.01474761962890625,
-0.006885528564453125,
0.0222015380859375,
0.0026607513427734375,
-0.026702880859375,
0.01018524169921875,
-0.0030803680419921875,
0.0011777877807617188,
-0.007450103759765625,
-0.0007157325744628906,
0.047027587890625,
0.028594970703125,
-0.031158447265625,
-0.01508331298828125,
-0.0153656005859375,
-0.04669189453125,
0.0189056396484375,
-0.00988006591796875,
-0.0535888671875,
0.00382232666015625,
0.038604736328125,
0.023590087890625,
0.0303192138671875,
0.0279388427734375,
-0.00426483154296875,
0.01052093505859375,
0.0517578125,
0.0242919921875,
0.01070404052734375,
-0.0382080078125,
-0.0148162841796875,
0.0100860595703125,
-0.0200958251953125,
0.0120391845703125,
0.002048492431640625,
-0.0191650390625,
0.0183563232421875,
-0.011566162109375,
-0.032958984375,
-0.044891357421875,
-0.028839111328125,
-0.0308380126953125,
0.041778564453125,
0.0017499923706054688,
0.00262451171875,
-0.00830841064453125,
0.049713134765625,
-0.010894775390625,
-0.0584716796875,
-0.049224853515625,
-0.024200439453125,
-0.005802154541015625,
-0.013427734375,
0.0027713775634765625,
0.0034008026123046875,
-0.0177154541015625,
0.0163421630859375,
0.0035877227783203125,
-0.0055999755859375,
-0.02215576171875,
-0.03179931640625,
0.0224456787109375,
0.018951416015625,
0.052886962890625,
-0.03717041015625,
-0.0494384765625,
0.057647705078125,
0.036285400390625,
-0.01247406005859375,
-0.0123748779296875,
0.009674072265625,
-0.043914794921875,
-0.0469970703125,
-0.01116180419921875,
0.027099609375,
0.005908966064453125,
-0.006488800048828125,
0.05218505859375,
0.036102294921875,
-0.0104827880859375,
-0.010650634765625,
0.028656005859375,
0.0158538818359375,
0.0426025390625,
-0.02490234375,
-0.018829345703125,
-0.0498046875,
0.0145721435546875,
-0.0335693359375,
-0.00940704345703125,
-0.0016689300537109375,
0.0007915496826171875,
0.004001617431640625,
-0.041107177734375,
0.05413818359375,
-0.00804901123046875,
0.00615692138671875,
-0.0248565673828125,
-0.0224151611328125,
-0.00569915771484375,
0.0714111328125,
-0.00943756103515625,
0.005352020263671875,
0.0374755859375,
0.00910186767578125,
-0.07427978515625,
0.01904296875,
-0.1083984375,
0.018768310546875,
-0.00891876220703125,
-0.01107025146484375,
-0.003643035888671875,
0.0011043548583984375,
-0.0260162353515625,
0.03948974609375,
0.0017004013061523438,
-0.0222015380859375,
0.0108795166015625,
0.0005183219909667969,
0.006946563720703125,
-0.033447265625,
0.021514892578125,
-0.061126708984375,
0.027496337890625,
-0.03985595703125,
-0.025054931640625,
-0.01541900634765625,
0.008819580078125,
0.0028285980224609375,
0.003574371337890625,
-0.00891876220703125,
0.002376556396484375,
0.0221405029296875,
-0.04248046875,
0.033599853515625,
-0.033416748046875,
0.00315093994140625,
0.0194549560546875,
0.02581787109375,
-0.0110626220703125,
0.0200653076171875,
0.00022459030151367188,
-0.0794677734375,
-0.033660888671875,
-0.0540771484375,
-0.053131103515625,
0.0272216796875,
-0.053497314453125,
0.0087738037109375,
-0.017364501953125,
-0.040557861328125,
-0.031951904296875,
0.0174713134765625,
0.004291534423828125,
-0.0197601318359375,
-0.06793212890625,
-0.03961181640625,
0.050933837890625,
0.0301666259765625,
-0.0129852294921875,
0.0197906494140625,
0.043365478515625,
0.0022525787353515625,
-0.04180908203125,
-0.080078125,
-0.00411224365234375,
0.034759521484375,
-0.031768798828125,
0.021636962890625,
0.0223388671875,
-0.023468017578125,
0.04144287109375,
0.0050506591796875,
0.01678466796875,
-0.041351318359375,
0.0113372802734375,
-0.01371002197265625,
-0.003879547119140625,
-0.0043487548828125,
-0.01526641845703125,
0.037628173828125,
0.003261566162109375,
0.0210418701171875,
-0.0248870849609375,
-0.0020904541015625,
0.03369140625,
0.03857421875,
-0.029510498046875,
-0.04620361328125,
-0.031829833984375,
0.026947021484375,
-0.071044921875,
0.03240966796875,
-0.02728271484375,
0.01044464111328125,
-0.0254364013671875,
-0.02398681640625,
-0.004001617431640625,
-0.01067352294921875,
-0.021820068359375,
-0.00957489013671875,
0.025665283203125,
-0.00629425048828125,
-0.01528167724609375,
-0.01316070556640625,
-0.009765625,
0.09368896484375,
0.0009493827819824219,
-0.05621337890625,
0.00106048583984375,
-0.0175933837890625,
0.04510498046875,
0.029937744140625,
0.007724761962890625,
0.07183837890625,
0.004779815673828125,
0.0005445480346679688,
-0.007022857666015625,
-0.04779052734375,
-0.00565338134765625,
-0.051971435546875,
-0.0119171142578125,
-0.025421142578125,
-0.0018310546875,
-0.0210113525390625,
0.08966064453125,
-0.0447998046875,
0.050048828125,
-0.00998687744140625,
0.0258331298828125,
0.01715087890625,
0.054779052734375,
0.01373291015625,
-0.0166015625,
-0.01482391357421875,
0.05291748046875,
0.017242431640625,
-0.043853759765625,
0.0164794921875,
0.0357666015625,
0.03741455078125,
0.0267181396484375,
-0.0301971435546875,
0.00283050537109375,
-0.01561737060546875,
-0.007350921630859375,
0.0223846435546875,
0.0145416259765625,
-0.0252532958984375,
-0.00921630859375,
0.005535125732421875,
0.00717926025390625,
-0.0204620361328125,
0.017242431640625,
0.00539398193359375,
0.01253509521484375,
0.01509857177734375,
-0.020751953125,
0.0011386871337890625,
-0.033905029296875,
-0.00621795654296875,
-0.0242462158203125,
0.0115203857421875,
-0.01528167724609375,
-0.0650634765625,
-0.03839111328125,
0.01120758056640625,
-0.005565643310546875,
0.0266571044921875,
-0.01052093505859375,
0.005462646484375,
-0.04901123046875,
0.027008056640625,
-0.09393310546875,
0.01331329345703125,
0.0119171142578125,
0.0106964111328125,
-0.0240631103515625,
-0.0010471343994140625,
0.00746917724609375,
-0.0128631591796875,
-0.01010894775390625,
-0.058929443359375,
-0.028045654296875,
-0.0282135009765625,
0.0031833648681640625,
-0.0014400482177734375,
0.007572174072265625,
0.00872039794921875,
-0.046112060546875,
0.045501708984375,
0.042327880859375,
0.02093505859375,
-0.0538330078125,
0.07843017578125,
-0.00435638427734375,
0.03662109375,
-0.016204833984375,
0.048797607421875,
0.019012451171875,
-0.00901031494140625,
0.0142822265625,
-0.0643310546875,
-0.026214599609375,
-0.0231170654296875,
-0.0216522216796875,
-0.002593994140625,
-0.0121307373046875,
-0.01148223876953125,
0.018890380859375,
-0.0039825439453125,
0.016448974609375,
-0.019500732421875,
-0.01213836669921875,
-0.0066986083984375,
0.007358551025390625,
-0.020965576171875,
0.006832122802734375,
0.02630615234375,
-0.03662109375,
-0.060394287109375,
0.023956298828125,
0.02337646484375,
0.0182037353515625,
0.00836181640625,
-0.061859130859375,
0.041046142578125,
0.048919677734375,
0.005634307861328125,
0.028106689453125,
0.004482269287109375,
0.01947021484375,
-0.003971099853515625,
-0.02960205078125,
-0.049102783203125,
0.035888671875,
0.039031982421875,
0.0019741058349609375,
-0.00428009033203125,
0.04498291015625,
-0.0009527206420898438,
0.0245361328125,
0.041534423828125,
0.0992431640625,
-0.0421142578125,
0.031036376953125,
0.030242919921875,
-0.03399658203125,
0.0010557174682617188,
0.0023136138916015625,
-0.01122283935546875,
-0.0264892578125,
0.001262664794921875,
0.0271148681640625,
-0.01244354248046875,
-0.00447845458984375,
0.01145172119140625,
-0.02813720703125,
-0.017822265625,
-0.03271484375,
0.015655517578125,
0.0296630859375,
0.0192718505859375,
0.0007476806640625,
0.0343017578125,
0.005001068115234375,
0.019989013671875,
-0.0078887939453125,
-0.029022216796875,
-0.03704833984375,
-0.015777587890625,
0.0078887939453125,
-0.045166015625,
0.034149169921875,
0.0355224609375,
0.050537109375,
0.03155517578125,
0.012237548828125,
-0.01129150390625,
-0.004375457763671875,
0.03466796875,
-0.06756591796875,
-0.035186767578125,
-0.016845703125,
0.0157012939453125,
0.032623291015625,
0.0271759033203125,
-0.007633209228515625,
-0.041412353515625,
-0.0202178955078125,
-0.0301055908203125,
0.07598876953125,
-0.0254364013671875,
-0.0157928466796875,
-0.01277923583984375,
0.039947509765625,
0.030242919921875,
0.026580810546875,
0.00218963623046875,
-0.0380859375,
-0.036468505859375,
0.015960693359375,
-0.060302734375,
-0.01061248779296875,
0.0200347900390625,
-0.0745849609375,
0.0196380615234375,
-0.0012035369873046875,
0.04974365234375,
0.00910186767578125,
-0.0204925537109375,
0.003887176513671875,
-0.03704833984375,
-0.032440185546875,
0.06597900390625,
-0.02227783203125,
0.047821044921875,
-0.030731201171875,
0.0128631591796875,
0.02191162109375,
0.01419830322265625,
0.09405517578125,
0.0278778076171875,
-0.0013303756713867188,
-0.023712158203125,
0.0185394287109375,
-0.00836181640625,
-0.05987548828125,
0.020294189453125,
0.01073455810546875,
0.034088134765625,
0.04046630859375,
0.0025787353515625,
0.039215087890625,
0.002117156982421875,
-0.0380859375,
0.03076171875,
0.0035400390625,
-0.00887298583984375,
-0.045562744140625,
0.030120849609375,
-0.006816864013671875,
-0.028411865234375,
0.00014793872833251953,
-0.018310546875,
-0.0164642333984375,
0.0250396728515625,
-0.005809783935546875,
-0.01348876953125,
-0.019805908203125,
-0.0211029052734375,
0.022979736328125,
-0.0006418228149414062,
0.040985107421875,
0.052490234375,
0.02581787109375,
0.0271759033203125,
0.030303955078125,
0.037841796875,
0.025543212890625,
-0.01404571533203125,
0.054412841796875,
-0.007617950439453125,
0.0063018798828125,
-0.07196044921875,
0.0010051727294921875,
0.057830810546875,
0.07513427734375,
-0.057586669921875,
-0.0251617431640625,
-0.0035076141357421875,
0.00737762451171875,
0.00354766845703125,
0.01464080810546875,
0.021881103515625,
0.005706787109375,
0.0223846435546875,
-0.0116119384765625,
0.0196075439453125,
-0.0018510818481445312,
-0.01183319091796875,
-0.00896453857421875,
-0.019439697265625,
0.0233917236328125,
0.0362548828125,
-0.01194000244140625,
-0.0189971923828125,
0.006374359130859375,
-0.00856781005859375,
0.024139404296875,
-0.01151275634765625,
0.0675048828125,
0.01389312744140625,
-0.043304443359375,
0.021881103515625,
-0.003040313720703125,
0.038665771484375,
-0.0819091796875,
-0.030914306640625,
0.058502197265625,
0.0537109375,
0.0101318359375,
-0.026275634765625,
0.009185791015625,
-0.00989532470703125,
-0.04876708984375,
-0.008575439453125,
0.0299072265625,
-0.0262451171875,
0.033416748046875,
-0.0413818359375,
0.02752685546875,
-0.007358551025390625,
0.0023193359375,
-0.04345703125,
0.0273590087890625,
0.0139007568359375,
-0.0052642822265625,
0.006771087646484375,
0.00550079345703125,
-0.031982421875,
0.02386474609375,
0.006870269775390625,
0.0176544189453125,
0.0202178955078125,
-0.039764404296875,
-0.003368377685546875,
-0.034759521484375,
0.0171661376953125,
-0.0042877197265625,
0.0193023681640625,
0.004703521728515625,
0.028656005859375,
0.0014333724975585938,
-0.035614013671875,
0.0025348663330078125,
0.0218353271484375,
0.0137481689453125,
0.050628662109375,
0.0015592575073242188,
0.0016717910766601562,
-0.026763916015625,
-0.005496978759765625,
-0.0199737548828125,
0.0178375244140625,
-0.00135040283203125,
0.09228515625,
-0.026519775390625,
0.01451873779296875,
-0.00798797607421875,
-0.00901031494140625,
0.0170440673828125,
-0.0253448486328125,
0.044036865234375,
0.01255035400390625,
-0.004924774169921875,
-0.018798828125,
-0.0012378692626953125,
-0.02972412109375,
0.0706787109375,
-0.028900146484375,
-0.019134521484375,
-0.0176544189453125,
0.039031982421875,
-0.039886474609375,
0.01338958740234375,
-0.027679443359375,
-0.0248260498046875,
-0.0259857177734375,
-0.00911712646484375,
0.03326416015625,
0.0197906494140625,
-0.0035381317138671875,
-0.045501708984375,
-0.0177764892578125,
-0.07275390625,
0.0128326416015625,
0.012664794921875,
0.004459381103515625,
0.01983642578125,
0.0166168212890625,
0.0163726806640625,
0.0210418701171875,
-0.0169219970703125,
0.03912353515625,
-0.0019550323486328125,
0.042266845703125,
0.0207061767578125,
-0.01092529296875,
0.03143310546875,
0.06268310546875,
0.0736083984375,
0.0221405029296875,
0.0114288330078125,
0.0308837890625,
-0.0164947509765625,
-0.02099609375,
-0.0254058837890625,
-0.025665283203125,
-0.0229339599609375,
-0.006679534912109375,
0.03131103515625,
-0.0231781005859375,
-0.0309906005859375,
-0.088623046875,
-0.0357666015625,
0.025146484375,
0.036712646484375,
-0.06842041015625,
0.03375244140625,
0.0120697021484375,
-0.042022705078125,
0.0186614990234375,
-0.040771484375,
0.0063934326171875,
0.0301361083984375,
-0.012664794921875,
-0.0276641845703125,
-0.033966064453125,
0.014923095703125,
-0.030029296875,
0.020172119140625,
0.0103302001953125,
-0.01548004150390625,
0.0265960693359375,
0.039703369140625,
0.0197601318359375,
0.0902099609375,
0.02093505859375,
-0.041259765625,
-0.0275421142578125,
0.009552001953125,
0.03485107421875,
-0.00860595703125,
-0.022430419921875,
0.015380859375,
-0.0173797607421875,
-0.0196990966796875,
0.0031299591064453125,
0.00453948974609375,
-0.04522705078125,
-0.07208251953125,
0.09808349609375,
-0.0254364013671875,
-0.023956298828125,
-0.0000756382942199707,
-0.01276397705078125,
-0.0206451416015625,
0.026641845703125,
0.0115966796875,
-0.0244293212890625,
-0.0027027130126953125,
0.039947509765625,
0.02886962890625,
0.0029811859130859375,
0.01111602783203125,
0.0155181884765625,
-0.0355224609375,
0.033172607421875,
0.0241851806640625,
0.007389068603515625,
-0.02294921875,
0.045318603515625,
-0.010345458984375,
0.023223876953125,
-0.01421356201171875,
0.033050537109375,
0.00012826919555664062,
-0.00304412841796875,
-0.013153076171875,
-0.018157958984375,
0.00897979736328125,
-0.0018215179443359375,
0.0176239013671875,
0.054443359375,
0.0003294944763183594,
-0.0301513671875,
-0.03228759765625,
-0.050018310546875,
0.0287322998046875,
-0.0280303955078125,
-0.005374908447265625,
-0.07794189453125,
-0.00972747802734375,
0.01186370849609375,
-0.0287933349609375,
0.06365966796875,
-0.027801513671875,
-0.0333251953125,
0.0298309326171875,
0.029022216796875,
0.007038116455078125,
-0.06842041015625,
-0.0187225341796875,
0.01605224609375,
-0.041748046875,
-0.067626953125,
0.002941131591796875,
0.032806396484375,
-0.0595703125,
-0.049163818359375,
0.01219940185546875,
-0.041046142578125,
-0.0051116943359375,
0.03497314453125,
0.0012712478637695312,
0.018310546875,
-0.0304718017578125,
-0.0489501953125,
0.037017822265625,
0.031982421875,
-0.0006337165832519531,
0.0389404296875,
-0.0194549560546875,
0.050140380859375,
0.0082244873046875,
-0.041534423828125,
0.0190887451171875,
-0.0111846923828125,
-0.0176544189453125,
0.05938720703125,
-0.005443572998046875,
-0.045562744140625,
-0.00020301342010498047,
0.008209228515625,
-0.0103912353515625,
0.0235137939453125,
0.029144287109375,
-0.04791259765625,
0.010040283203125,
-0.0014982223510742188,
0.032958984375,
0.015716552734375
] |
bf4e2e2e03cfa3d34632e1133a057085b4ddb2c1
|
Wordpress Stackexchange
Q: Functions.php code that only runs on localhost? I would like to run an add_action in functions.php only if the theme is being loaded from my localhost development site. How would I get this to run only on localhost?
function livereload(){
?>
// mycode
<?php
}
add_action('headway_body_close', 'livereload');
A: A rather safe way is marking your local environment as such in your local wp-config.php.
Example:
// wp-config.php
define( 'WPSE54453_IS_LOCAL_SERVER', TRUE );
// functions.php
defined( 'WPSE54453_IS_LOCAL_SERVER' )
&& WPSE54453_IS_LOCAL_SERVER
&& add_action( 'headway_body_close', 'livereload' );
This is also a question of readability. You can see immediately what the code does.
|
Q: Functions.php code that only runs on localhost? I would like to run an add_action in functions.php only if the theme is being loaded from my localhost development site. How would I get this to run only on localhost?
function livereload(){
?>
// mycode
<?php
}
add_action('headway_body_close', 'livereload');
A: A rather safe way is marking your local environment as such in your local wp-config.php.
Example:
// wp-config.php
define( 'WPSE54453_IS_LOCAL_SERVER', TRUE );
// functions.php
defined( 'WPSE54453_IS_LOCAL_SERVER' )
&& WPSE54453_IS_LOCAL_SERVER
&& add_action( 'headway_body_close', 'livereload' );
This is also a question of readability. You can see immediately what the code does.
A: This is the corect answer
if ( $_SERVER["SERVER_ADDR"] == '127.0.0.1' ) {
function livereload(){
?>
// mycode
<?php
}
add_action('headway_body_close', 'livereload');
}
A: The easiest way to do it to check IP address of an user. If it equals to 127.0.0.1, then this user running the site on localhost.
if ( $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) {
function livereload(){
?>
// mycode
<?php
}
add_action('headway_body_close', 'livereload');
}
UPDATE: or as mentioned @Tommixoft you can check server IP address.
if ( $_SERVER['SERVER_ADDR'] == '127.0.0.1' ) {
function livereload(){
?>
// mycode
<?php
}
add_action('headway_body_close', 'livereload');
}
|
wordpress
|
{
"language": "en",
"length": 193,
"provenance": "stackexchange_00019.jsonl.gz:420612",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54453"
}
|
[
0.059478759765625,
0.00939178466796875,
0.0028533935546875,
-0.0870361328125,
0.0099945068359375,
-0.00719451904296875,
0.0015535354614257812,
0.0055084228515625,
-0.003757476806640625,
0.0079803466796875,
-0.0118255615234375,
0.03753662109375,
-0.037322998046875,
-0.0257415771484375,
0.0173492431640625,
-0.0194854736328125,
0.041748046875,
-0.0289306640625,
0.0159454345703125,
-0.0174102783203125,
-0.005767822265625,
0.028472900390625,
0.01004791259765625,
0.06597900390625,
0.0304718017578125,
-0.053985595703125,
0.055511474609375,
0.00579071044921875,
0.011871337890625,
-0.0034503936767578125,
0.0254669189453125,
0.0021953582763671875,
-0.0135955810546875,
0.035491943359375,
-0.0095367431640625,
-0.00970458984375,
0.02545166015625,
0.004245758056640625,
0.0013294219970703125,
0.049041748046875,
0.005924224853515625,
-0.00513458251953125,
-0.03619384765625,
0.06890869140625,
-0.032196044921875,
-0.055206298828125,
0.0304412841796875,
-0.030303955078125,
-0.00051116943359375,
0.006435394287109375,
-0.0265655517578125,
0.030548095703125,
-0.0142364501953125,
0.00907135009765625,
0.01177215576171875,
-0.00843048095703125,
-0.06396484375,
0.0158538818359375,
0.036895751953125,
0.0301361083984375,
-0.0037899017333984375,
-0.053863525390625,
0.0222930908203125,
-0.0172576904296875,
0.0013790130615234375,
0.0009164810180664062,
0.01483154296875,
0.01271820068359375,
-0.0206298828125,
0.003650665283203125,
0.0192718505859375,
-0.0239105224609375,
-0.0103607177734375,
-0.006473541259765625,
-0.005584716796875,
-0.01898193359375,
0.0063629150390625,
-0.01727294921875,
0.00629425048828125,
0.0151824951171875,
-0.0016527175903320312,
-0.041412353515625,
-0.0214996337890625,
-0.010223388671875,
0.005168914794921875,
0.0276031494140625,
-0.0019388198852539062,
-0.018768310546875,
-0.0263671875,
-0.01560211181640625,
-0.034576416015625,
-0.0131988525390625,
-0.0078277587890625,
-0.0253753662109375,
-0.021942138671875,
-0.0224609375,
-0.00830841064453125,
-0.0295562744140625,
0.011932373046875,
-0.009002685546875,
0.045318603515625,
-0.060089111328125,
0.031646728515625,
-0.0193939208984375,
0.01275634765625,
0.10009765625,
-0.00957489013671875,
-0.0185394287109375,
0.00286102294921875,
-0.0115814208984375,
0.034912109375,
-0.06903076171875,
-0.0234527587890625,
-0.0035877227783203125,
-0.0105133056640625,
-0.0074005126953125,
-0.0751953125,
0.0238189697265625,
-0.01068115234375,
-0.00522613525390625,
0.024627685546875,
0.03271484375,
-0.0111846923828125,
-0.0054931640625,
0.0091400146484375,
-0.0024929046630859375,
-0.04888916015625,
-0.0074615478515625,
0.0361328125,
0.0016813278198242188,
-0.06549072265625,
0.01090240478515625,
0.07623291015625,
0.01282501220703125,
0.013763427734375,
-0.020843505859375,
0.06707763671875,
-0.0066986083984375,
-0.0038127899169921875,
0.03936767578125,
0.0162811279296875,
-0.040435791015625,
-0.0283355712890625,
0.020294189453125,
0.016448974609375,
-0.0020465850830078125,
0.0218353271484375,
0.031585693359375,
-0.016571044921875,
-0.016754150390625,
0.01355743408203125,
-0.0020580291748046875,
0.0308380126953125,
0.00739288330078125,
0.004779815673828125,
0.01861572265625,
0.0291900634765625,
-0.0033893585205078125,
-0.035003662109375,
0.00794219970703125,
-0.02093505859375,
-0.0092620849609375,
-0.0030059814453125,
-0.0501708984375,
-0.06488037109375,
0.0088348388671875,
-0.005645751953125,
0.0009927749633789062,
0.01065826416015625,
0.03924560546875,
-0.0009555816650390625,
-0.0179901123046875,
0.041107177734375,
0.00145721435546875,
-0.0161590576171875,
0.004241943359375,
0.007110595703125,
0.02435302734375,
0.018768310546875,
-0.007671356201171875,
-0.006610870361328125,
-0.028900146484375,
0.05914306640625,
-0.01226806640625,
-0.054718017578125,
0.03729248046875,
0.0006918907165527344,
0.05657958984375,
0.0248260498046875,
0.003978729248046875,
0.0187530517578125,
0.01073455810546875,
0.036407470703125,
-0.04266357421875,
-0.00707244873046875,
-0.0192413330078125,
-0.01445770263671875,
-0.00215911865234375,
-0.015899658203125,
0.0224456787109375,
0.0167083740234375,
-0.0184173583984375,
0.046356201171875,
-0.0007481575012207031,
-0.0204315185546875,
0.0189056396484375,
-0.035369873046875,
0.0157470703125,
0.0234375,
0.016754150390625,
-0.006107330322265625,
0.016510009765625,
-0.0010395050048828125,
-0.083740234375,
-0.037811279296875,
0.051910400390625,
-0.044464111328125,
0.03662109375,
-0.01317596435546875,
0.020599365234375,
-0.011688232421875,
-0.033203125,
0.0007538795471191406,
-0.029266357421875,
-0.003627777099609375,
0.01103973388671875,
-0.045318603515625,
0.0106658935546875,
-0.0026760101318359375,
0.0027980804443359375,
0.0246429443359375,
0.051544189453125,
-0.007213592529296875,
0.00856781005859375,
-0.02862548828125,
-0.00200653076171875,
-0.032440185546875,
-0.052703857421875,
-0.00470733642578125,
0.057586669921875,
0.0301513671875,
-0.01270294189453125,
0.00836181640625,
0.0401611328125,
0.0345458984375,
-0.01110076904296875,
0.01172637939453125,
0.0154571533203125,
0.0066680908203125,
-0.006183624267578125,
-0.053924560546875,
-0.04669189453125,
0.044586181640625,
-0.0831298828125,
0.0163116455078125,
0.029998779296875,
-0.018707275390625,
-0.030120849609375,
-0.0162200927734375,
0.007686614990234375,
0.0120086669921875,
-0.0204010009765625,
-0.0347900390625,
-0.0005426406860351562,
0.002010345458984375,
-0.031280517578125,
-0.01033782958984375,
-0.0135040283203125,
-0.018524169921875,
-0.0203704833984375,
0.035400390625,
-0.006252288818359375,
-0.00901031494140625,
0.05364990234375,
-0.00992584228515625,
-0.01279449462890625,
-0.032440185546875,
0.00940704345703125,
-0.034332275390625,
0.0235748291015625,
-0.01861572265625,
0.02471923828125,
0.028350830078125,
-0.0209197998046875,
0.0023975372314453125,
-0.0231170654296875,
0.034698486328125,
-0.0148773193359375,
0.04632568359375,
0.0014514923095703125,
0.0144500732421875,
0.0123138427734375,
-0.023223876953125,
0.0384521484375,
0.046630859375,
-0.0460205078125,
0.056243896484375,
0.0145416259765625,
-0.0147857666015625,
0.0197906494140625,
0.0288848876953125,
0.04034423828125,
0.01007843017578125,
-0.0140380859375,
-0.01113128662109375,
0.0016393661499023438,
0.012176513671875,
-0.021881103515625,
-0.03594970703125,
-0.0095062255859375,
-0.0565185546875,
-0.0282135009765625,
0.01297760009765625,
-0.0171966552734375,
-0.0289306640625,
-0.050994873046875,
-0.03662109375,
-0.017333984375,
-0.1246337890625,
-0.0802001953125,
-0.0311431884765625,
0.00943756103515625,
0.011566162109375,
-0.0213470458984375,
0.01335906982421875,
-0.0162811279296875,
-0.032562255859375,
0.01229095458984375,
-0.0204620361328125,
-0.0238494873046875,
0.0069580078125,
-0.054046630859375,
-0.02862548828125,
-0.02630615234375,
0.01806640625,
0.0012969970703125,
0.004669189453125,
0.08331298828125,
0.01593017578125,
-0.0267181396484375,
0.036102294921875,
0.0091094970703125,
-0.00957489013671875,
0.03826904296875,
-0.0116424560546875,
-0.01259613037109375,
0.0269927978515625,
-0.00005745887756347656,
0.004947662353515625,
-0.0082550048828125,
0.0239715576171875,
-0.03350830078125,
-0.0130615234375,
-0.0244903564453125,
-0.01006317138671875,
0.048187255859375,
0.0107421875,
-0.031707763671875,
0.0229949951171875,
-0.062744140625,
-0.07269287109375,
0.0113525390625,
-0.072509765625,
0.032257080078125,
0.059173583984375,
-0.0295867919921875,
-0.012237548828125,
0.00890350341796875,
0.059112548828125,
0.0291900634765625,
0.0174407958984375,
0.0229339599609375,
0.029693603515625,
0.00943756103515625,
0.0259857177734375,
-0.055755615234375,
0.0843505859375,
0.005596160888671875,
-0.032928466796875,
0.0274505615234375,
0.003498077392578125,
-0.01503753662109375,
-0.012420654296875,
-0.091064453125,
0.006305694580078125,
0.0013284683227539062,
-0.00637054443359375,
0.0411376953125,
0.002803802490234375,
0.0082550048828125,
-0.020111083984375,
0.018280029296875,
-0.025482177734375,
-0.009063720703125,
0.02374267578125,
0.01004791259765625,
-0.056732177734375,
-0.014007568359375,
-0.0711669921875,
0.007843017578125,
-0.015777587890625,
-0.031646728515625,
-0.035186767578125,
-0.01049041748046875,
-0.016448974609375,
-0.01474761962890625,
-0.0007228851318359375,
-0.0250396728515625,
0.0236663818359375,
-0.0250701904296875,
0.0092620849609375,
0.0192718505859375,
-0.04779052734375,
0.01727294921875,
-0.007434844970703125,
-0.041229248046875,
-0.07281494140625,
-0.00457000732421875,
-0.0251922607421875,
0.0259552001953125,
0.01166534423828125,
-0.020294189453125,
0.00592803955078125,
0.035888671875,
-0.0139312744140625,
0.0469970703125,
0.006786346435546875,
0.00800323486328125,
0.0081634521484375,
0.0088348388671875,
0.0294952392578125,
-0.02117919921875,
-0.01479339599609375,
0.018341064453125,
-0.034759521484375,
0.046539306640625,
0.00701141357421875,
0.0305633544921875,
0.031524658203125,
-0.04296875,
0.004024505615234375,
-0.0214996337890625,
0.046539306640625,
0.045806884765625,
0.0164794921875,
0.01386260986328125,
-0.034881591796875,
0.0154266357421875,
0.016571044921875,
-0.0222930908203125,
-0.007045745849609375,
0.006549835205078125,
0.058258056640625,
0.01509857177734375,
-0.01033782958984375,
0.01473236083984375,
0.030181884765625,
0.02642822265625,
-0.0024929046630859375,
0.01776123046875,
-0.03753662109375,
-0.0283203125,
0.080810546875,
-0.0263824462890625,
0.009613037109375,
-0.015106201171875,
0.04364013671875,
0.0058135986328125,
0.0127410888671875,
-0.001735687255859375,
0.009521484375,
0.01512908935546875,
-0.00785064697265625,
0.0114288330078125,
-0.040802001953125,
0.048187255859375,
0.01222991943359375,
-0.0059814453125,
0.0199432373046875,
0.003765106201171875,
-0.003963470458984375,
-0.00766754150390625,
-0.055999755859375,
0.057830810546875,
0.0280609130859375,
-0.0010061264038085938,
0.022674560546875,
0.0157470703125,
-0.00443267822265625,
0.02520751953125,
0.01399993896484375,
0.00371551513671875,
0.0277252197265625,
0.0182647705078125,
-0.00170135498046875,
-0.003948211669921875,
0.0025119781494140625,
0.0205078125,
-0.0028362274169921875,
-0.0322265625,
-0.0372314453125,
0.0245361328125,
0.0220489501953125,
-0.00762939453125,
0.0006899833679199219,
0.0164947509765625,
-0.0014209747314453125,
0.01456451416015625,
0.0116119384765625,
0.023681640625,
-0.0347900390625,
-0.0006933212280273438,
-0.0076904296875,
0.0029544830322265625,
-0.02484130859375,
0.0271148681640625,
-0.0188446044921875,
-0.00469207763671875,
-0.0007390975952148438,
-0.004184722900390625,
0.01265716552734375,
0.022430419921875,
-0.002864837646484375,
0.0218048095703125,
0.0118408203125,
0.00717926025390625,
-0.02764892578125,
0.0408935546875,
-0.0101776123046875,
0.01134490966796875,
0.046173095703125,
0.0183868408203125,
-0.002414703369140625,
-0.0076446533203125,
0.0038166046142578125,
-0.0227508544921875,
-0.042236328125,
0.0361328125,
-0.01171875,
-0.049591064453125,
-0.057952880859375,
-0.03570556640625,
0.040924072265625,
0.00778961181640625,
-0.0019588470458984375,
0.06103515625,
0.04541015625,
0.051422119140625,
0.08575439453125,
-0.032073974609375,
0.01367950439453125,
0.028106689453125,
-0.0390625,
-0.0289306640625,
-0.0180511474609375,
0.051971435546875,
0.02447509765625,
-0.01381683349609375,
-0.050537109375,
0.006793975830078125,
0.007007598876953125,
-0.0014848709106445312,
-0.01007843017578125,
-0.0222015380859375,
-0.0241546630859375,
-0.0088958740234375,
0.0714111328125,
0.01184844970703125,
-0.068115234375,
-0.00689697265625,
-0.02825927734375,
0.005695343017578125,
-0.01201629638671875,
-0.0252685546875,
-0.0321044921875,
-0.01436614990234375,
0.039398193359375,
0.0005793571472167969,
-0.01505279541015625,
-0.046661376953125,
0.00717926025390625,
0.0299224853515625,
0.0372314453125,
0.006168365478515625,
-0.0211639404296875,
0.06890869140625,
0.01010894775390625,
0.06396484375,
0.0297393798828125,
0.055755615234375,
-0.00267791748046875,
-0.045562744140625,
0.0215301513671875,
-0.03131103515625,
-0.0279541015625,
-0.01435089111328125,
-0.040618896484375,
0.005405426025390625,
0.07177734375,
-0.01507568359375,
0.008575439453125,
-0.013885498046875,
-0.013153076171875,
-0.0262298583984375,
0.0382080078125,
-0.013336181640625,
0.039093017578125,
-0.04583740234375,
-0.0292816162109375,
-0.005863189697265625,
0.01250457763671875,
0.0062713623046875,
0.01270294189453125,
-0.015838623046875,
0.0201263427734375,
0.019561767578125,
-0.047332763671875,
0.028900146484375,
0.0648193359375,
0.03179931640625,
0.06915283203125,
0.0186309814453125,
0.0308837890625,
0.025482177734375,
0.04345703125,
-0.037017822265625,
-0.070068359375,
0.012176513671875,
0.02197265625,
0.003726959228515625,
0.01183319091796875,
-0.009918212890625,
0.022918701171875,
0.0186614990234375,
0.06988525390625,
-0.042327880859375,
0.0199432373046875,
0.027435302734375,
-0.0123443603515625,
0.004230499267578125,
-0.0269622802734375,
0.00997161865234375,
-0.02471923828125,
0.07818603515625,
0.0312347412109375,
-0.00603485107421875,
0.042449951171875,
0.0085296630859375,
0.015899658203125,
0.006755828857421875,
0.035064697265625,
-0.0010480880737304688,
-0.021636962890625,
-0.0264129638671875,
0.0246429443359375,
-0.01128387451171875,
-0.040252685546875,
-0.0035991668701171875,
0.00553131103515625,
-0.0301361083984375,
-0.08453369140625,
-0.0127716064453125,
0.013153076171875,
0.0004031658172607422,
-0.0147247314453125,
-0.0079193115234375,
0.0300140380859375,
0.04833984375,
-0.03875732421875,
0.03350830078125,
0.0123748779296875,
0.023681640625,
-0.048980712890625,
-0.037139892578125,
-0.01023101806640625,
0.0160675048828125,
-0.0574951171875,
0.0208587646484375,
-0.0295562744140625,
-0.015869140625,
0.007755279541015625,
-0.034820556640625,
0.006988525390625,
-0.022552490234375,
-0.0191650390625,
0.01323699951171875,
-0.01959228515625,
0.0122833251953125,
-0.00542449951171875,
0.003631591796875,
-0.0604248046875,
-0.04742431640625,
-0.0004105567932128906,
-0.06689453125,
-0.0217437744140625,
-0.03466796875,
0.00182342529296875,
0.094970703125,
-0.042999267578125,
-0.0325927734375,
0.048126220703125,
0.057342529296875,
-0.03973388671875,
0.037078857421875,
-0.042633056640625,
0.08087158203125,
0.026947021484375,
0.0091094970703125,
-0.02227783203125,
0.01451873779296875,
-0.0013856887817382812,
-0.0145416259765625,
0.019866943359375,
0.0134735107421875,
0.0115814208984375,
-0.01459503173828125,
-0.013671875,
0.03192138671875,
-0.033966064453125,
0.001010894775390625,
-0.0435791015625,
0.025665283203125,
0.00820159912109375,
-0.053497314453125,
0.011962890625,
0.01044464111328125,
-0.03717041015625,
-0.0025424957275390625,
0.00984954833984375,
0.016082763671875,
-0.03466796875,
0.012359619140625,
0.0281524658203125,
-0.0330810546875,
-0.025482177734375,
0.0109710693359375,
-0.006061553955078125,
0.046051025390625,
0.0005517005920410156,
-0.0183563232421875,
-0.04718017578125,
-0.01419830322265625,
0.0272064208984375,
-0.00983428955078125,
-0.0114898681640625,
0.027679443359375,
0.032257080078125,
-0.023956298828125,
-0.03173828125,
-0.016845703125,
-0.004199981689453125,
-0.027435302734375,
0.05029296875,
0.06439208984375,
0.034820556640625,
0.0246124267578125,
0.0404052734375,
0.006824493408203125,
0.053436279296875,
-0.05291748046875,
-0.0206298828125,
-0.005096435546875,
-0.0006031990051269531,
-0.001071929931640625,
-0.004352569580078125,
0.004665374755859375,
0.004032135009765625,
0.032806396484375,
0.0035495758056640625,
-0.0011320114135742188,
-0.0081329345703125,
-0.01108551025390625,
0.00494384765625,
0.040130615234375,
0.00936126708984375,
0.01177978515625,
-0.0303192138671875,
-0.00281524658203125,
0.0222625732421875,
0.040069580078125,
-0.0038700103759765625,
0.0306243896484375,
-0.00342559814453125,
-0.0195465087890625,
-0.0181121826171875,
0.049468994140625,
-0.04547119140625,
0.03082275390625,
-0.06304931640625,
-0.05535888671875,
-0.0286407470703125,
0.0667724609375,
0.041412353515625,
0.0287322998046875,
0.03326416015625,
0.0244903564453125,
0.026092529296875,
0.01459503173828125,
0.06512451171875,
-0.007061004638671875,
-0.049285888671875,
-0.036407470703125,
-0.005218505859375,
0.01499176025390625,
0.0029144287109375,
0.0197601318359375,
0.042449951171875,
-0.0086517333984375,
-0.032958984375,
0.01480865478515625,
-0.0056304931640625,
-0.028167724609375,
0.053009033203125,
-0.008209228515625,
0.05853271484375,
0.0166778564453125,
-0.006221771240234375,
0.0002446174621582031,
0.037689208984375,
-0.04156494140625,
-0.0008826255798339844,
0.03497314453125,
-0.0163726806640625,
0.0355224609375,
0.01100921630859375,
-0.00872039794921875,
0.0306396484375,
0.00853729248046875,
-0.0303802490234375,
0.01256561279296875,
0.0426025390625,
-0.018585205078125,
-0.01953125,
-0.03564453125,
-0.051544189453125,
0.09490966796875,
0.035614013671875,
0.13330078125,
-0.07763671875,
0.054473876953125,
0.04620361328125,
0.0225982666015625,
0.0025272369384765625,
0.028717041015625,
-0.010040283203125,
-0.007778167724609375,
0.0340576171875,
-0.01425933837890625,
-0.060638427734375,
-0.012115478515625,
0.0090484619140625,
-0.020355224609375,
0.0231781005859375,
-0.0283660888671875,
0.021759033203125,
-0.022796630859375,
0.0743408203125,
-0.01102447509765625,
-0.0250244140625,
-0.0228424072265625,
-0.01702880859375,
0.0176544189453125,
0.047332763671875,
0.0288238525390625,
0.0241546630859375,
-0.02667236328125,
-0.0447998046875,
0.0278778076171875,
-0.0537109375,
-0.0158233642578125,
0.0211639404296875,
0.01285552978515625,
-0.01319122314453125,
0.007175445556640625,
-0.0204925537109375,
0.0192718505859375,
0.0117034912109375,
0.020965576171875,
0.0111083984375,
-0.026763916015625,
-0.0021266937255859375,
0.0218658447265625,
0.04229736328125,
-0.005344390869140625,
0.0008902549743652344,
0.013885498046875,
-0.0099945068359375,
0.0025310516357421875,
-0.024017333984375,
-0.0167083740234375,
-0.039703369140625,
0.007259368896484375,
0.031890869140625,
-0.008209228515625,
-0.01471710205078125,
-0.0078887939453125,
-0.003986358642578125,
0.0278472900390625,
-0.03302001953125,
-0.00562286376953125,
-0.044281005859375,
-0.0251617431640625,
0.07977294921875,
-0.03814697265625,
0.0279083251953125,
-0.017608642578125,
-0.00827789306640625,
-0.032318115234375,
-0.0322265625,
-0.00555419921875,
0.06640625,
0.006923675537109375,
0.0073699951171875,
0.036163330078125,
0.00542449951171875,
-0.01580810546875,
0.02508544921875,
0.00428009033203125,
0.0728759765625,
-0.021270751953125,
-0.0298919677734375,
0.0704345703125,
-0.04241943359375,
-0.0162200927734375,
-0.009521484375,
-0.003154754638671875,
-0.040435791015625,
0.002674102783203125,
0.00876617431640625,
-0.004314422607421875,
0.028228759765625,
-0.018280029296875,
-0.034027099609375,
0.006526947021484375,
0.0140533447265625,
-0.04010009765625,
-0.02978515625,
0.014068603515625,
0.004146575927734375,
-0.003200531005859375,
-0.0225830078125,
-0.00852203369140625,
-0.0230255126953125,
0.01128387451171875,
-0.0189208984375,
0.01288604736328125,
0.0236968994140625,
0.0008196830749511719,
0.0197906494140625,
0.031494140625,
0.042327880859375,
-0.0521240234375,
0.0012302398681640625,
-0.016082763671875,
0.05230712890625,
0.06170654296875,
-0.0210723876953125,
0.09051513671875,
0.0031032562255859375,
0.003986358642578125,
-0.0052337646484375,
-0.0390625,
-0.032196044921875,
-0.0416259765625,
0.09906005859375,
0.007488250732421875,
0.02362060546875,
-0.01181793212890625,
-0.0731201171875,
-0.023773193359375,
-0.01181793212890625,
0.0031280517578125,
0.0299072265625,
-0.06658935546875,
0.015838623046875,
0.00742340087890625,
-0.0243072509765625,
0.05517578125,
-0.02410888671875,
-0.0288848876953125,
0.0160980224609375,
-0.00023984909057617188,
0.00035119056701660156,
-0.0419921875,
-0.03515625,
0.0792236328125,
-0.04034423828125,
0.01282501220703125,
0.02386474609375,
0.01163482666015625,
0.0555419921875,
0.0716552734375,
0.039154052734375,
0.010955810546875,
-0.0184478759765625,
-0.0013179779052734375,
0.041595458984375,
0.0360107421875,
-0.00012993812561035156,
-0.06036376953125,
-0.0120697021484375,
0.02825927734375,
0.009185791015625,
0.038543701171875,
-0.0014715194702148438,
0.0098114013671875,
-0.0015420913696289062,
0.0254364013671875,
-0.042877197265625,
0.0256195068359375,
-0.00609588623046875,
-0.00733184814453125,
-0.016876220703125,
0.032073974609375,
0.04156494140625,
-0.002349853515625,
-0.00714874267578125,
-0.00021338462829589844,
-0.033294677734375,
-0.069580078125,
0.0322265625,
-0.0012121200561523438,
-0.0005083084106445312,
0.038482666015625
] |
3bdb5d659ef2b418c0fe688feb06556dce493df6
|
Wordpress Stackexchange
Q: What is theme-compat? I have noticed that wp-includes/theme-compat directory.
So, what is it?
Is it a theme?
A: The theme-compat directory is comprised of a set of deprecated (since WordPress 3.0) files that WordPress used to use as fallback template-part files, in case the active Theme failed to include them.
In other words, if a Theme used the get_header() template tag, but failed to include a header.php template-part file, WordPress would fall back to /wp-includes/theme-compat/header.php.
The template-part files in theme_compat are deprecated, unmaintained, incredibly old (by core/current-Theme standards), and should not be relied upon by any current Theme.
|
Q: What is theme-compat? I have noticed that wp-includes/theme-compat directory.
So, what is it?
Is it a theme?
A: The theme-compat directory is comprised of a set of deprecated (since WordPress 3.0) files that WordPress used to use as fallback template-part files, in case the active Theme failed to include them.
In other words, if a Theme used the get_header() template tag, but failed to include a header.php template-part file, WordPress would fall back to /wp-includes/theme-compat/header.php.
The template-part files in theme_compat are deprecated, unmaintained, incredibly old (by core/current-Theme standards), and should not be relied upon by any current Theme.
|
wordpress
|
{
"language": "en",
"length": 99,
"provenance": "stackexchange_00019.jsonl.gz:420623",
"question_score": "15",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54503"
}
|
[
0.0201873779296875,
-0.047210693359375,
-0.0008730888366699219,
-0.06719970703125,
-0.034820556640625,
-0.01348876953125,
-0.016876220703125,
0.029083251953125,
-0.0076904296875,
0.03289794921875,
-0.01549530029296875,
0.03558349609375,
0.0008282661437988281,
0.0106964111328125,
0.002994537353515625,
-0.00766754150390625,
0.020050048828125,
-0.0308074951171875,
0.01451873779296875,
-0.0070953369140625,
-0.0072174072265625,
-0.0069580078125,
-0.00244903564453125,
0.0210723876953125,
-0.0141143798828125,
0.020263671875,
0.057342529296875,
-0.006847381591796875,
-0.01255035400390625,
-0.0167694091796875,
0.00983428955078125,
0.00727081298828125,
0.01385498046875,
0.02587890625,
-0.006664276123046875,
0.00749969482421875,
0.005672454833984375,
0.0162353515625,
0.0195465087890625,
-0.0135345458984375,
-0.0080413818359375,
0.0024585723876953125,
0.0192413330078125,
0.0176849365234375,
-0.03179931640625,
-0.017608642578125,
-0.00919342041015625,
-0.02069091796875,
0.042694091796875,
-0.00984954833984375,
0.016204833984375,
0.0079345703125,
0.01032257080078125,
-0.016937255859375,
-0.027984619140625,
0.00864410400390625,
0.0199737548828125,
0.0017795562744140625,
0.040069580078125,
-0.0506591796875,
-0.0477294921875,
-0.027801513671875,
0.049652099609375,
0.00849151611328125,
0.009429931640625,
0.01479339599609375,
-0.035491943359375,
0.0195465087890625,
-0.0361328125,
0.01206207275390625,
0.010650634765625,
-0.055694580078125,
0.00452423095703125,
-0.066650390625,
0.02801513671875,
0.0208282470703125,
-0.048736572265625,
-0.052581787109375,
0.0287322998046875,
0.0157623291015625,
-0.00730133056640625,
-0.026336669921875,
-0.034698486328125,
-0.04296875,
0.048553466796875,
0.006923675537109375,
-0.005847930908203125,
-0.0177154541015625,
0.0013494491577148438,
-0.036865234375,
-0.00424957275390625,
0.023468017578125,
-0.0472412109375,
0.02337646484375,
-0.00579833984375,
-0.0235595703125,
0.02886962890625,
0.031982421875,
-0.0240936279296875,
-0.010101318359375,
0.0113677978515625,
-0.040313720703125,
0.00916290283203125,
-0.0164794921875,
-0.0173492431640625,
-0.004512786865234375,
-0.007572174072265625,
0.01494598388671875,
-0.005374908447265625,
0.03955078125,
-0.01366424560546875,
-0.041961669921875,
0.022491455078125,
-0.0579833984375,
-0.0088653564453125,
0.053009033203125,
0.013916015625,
0.0290069580078125,
0.033447265625,
0.036224365234375,
0.015594482421875,
0.0386962890625,
0.03985595703125,
-0.061614990234375,
0.0251922607421875,
0.016265869140625,
-0.0075225830078125,
-0.0638427734375,
-0.0007252693176269531,
0.03973388671875,
-0.006031036376953125,
-0.0118560791015625,
-0.0177459716796875,
0.00042939186096191406,
-0.032501220703125,
-0.031097412109375,
0.032623291015625,
0.018890380859375,
0.012939453125,
-0.0017690658569335938,
0.032684326171875,
-0.027069091796875,
-0.003448486328125,
0.0202178955078125,
0.00927734375,
-0.036529541015625,
0.00823974609375,
0.04302978515625,
0.0025920867919921875,
-0.0019512176513671875,
0.07720947265625,
-0.0296173095703125,
0.0146331787109375,
-0.0127105712890625,
0.0124969482421875,
-0.05133056640625,
-0.037384033203125,
-0.01861572265625,
0.035919189453125,
-0.00548553466796875,
-0.0077056884765625,
-0.021240234375,
-0.0208892822265625,
-0.023712158203125,
-0.07159423828125,
0.0169830322265625,
0.040008544921875,
-0.0026454925537109375,
0.033905029296875,
0.00530242919921875,
0.01438140869140625,
-0.0213470458984375,
0.019989013671875,
0.05029296875,
0.044219970703125,
0.046966552734375,
0.035675048828125,
-0.03985595703125,
0.0206146240234375,
0.07623291015625,
0.016265869140625,
0.0076446533203125,
0.049407958984375,
-0.0242462158203125,
-0.064697265625,
-0.005245208740234375,
0.01309967041015625,
0.0308837890625,
0.0168304443359375,
0.002105712890625,
0.058135986328125,
0.03033447265625,
-0.0002008676528930664,
0.04052734375,
-0.01242828369140625,
-0.02838134765625,
-0.0302886962890625,
0.0217132568359375,
-0.0364990234375,
-0.02154541015625,
0.01081085205078125,
0.048370361328125,
-0.0015325546264648438,
-0.0005965232849121094,
-0.06396484375,
0.0330810546875,
-0.01580810546875,
0.0445556640625,
0.0193634033203125,
0.007770538330078125,
0.00372314453125,
0.01861572265625,
-0.0135498046875,
-0.01554107666015625,
-0.038238525390625,
0.0555419921875,
-0.0217742919921875,
-0.002429962158203125,
0.007541656494140625,
0.0075836181640625,
0.0019207000732421875,
-0.0007352828979492188,
-0.0149078369140625,
-0.00730133056640625,
0.0799560546875,
0.0478515625,
-0.0300750732421875,
-0.00988006591796875,
0.042144775390625,
0.039276123046875,
-0.038330078125,
0.01776123046875,
0.0079498291015625,
0.01102447509765625,
-0.048614501953125,
-0.0194549560546875,
-0.01503753662109375,
-0.00856781005859375,
0.0008268356323242188,
0.05535888671875,
0.0308074951171875,
0.047332763671875,
-0.01507568359375,
-0.0181732177734375,
0.09173583984375,
-0.03741455078125,
-0.01515960693359375,
-0.00445556640625,
0.01403045654296875,
0.03997802734375,
0.058685302734375,
-0.0305938720703125,
-0.00383758544921875,
-0.04376220703125,
-0.0210418701171875,
0.00786590576171875,
-0.004486083984375,
0.011383056640625,
-0.038665771484375,
0.015228271484375,
0.00554656982421875,
-0.0006036758422851562,
-0.03033447265625,
0.00782012939453125,
0.036346435546875,
0.016326904296875,
0.045928955078125,
0.03265380859375,
-0.007312774658203125,
-0.0162506103515625,
0.0023593902587890625,
0.022918701171875,
-0.0021839141845703125,
0.07501220703125,
0.0114288330078125,
0.03167724609375,
-0.004673004150390625,
-0.044769287109375,
-0.0038204193115234375,
0.0390625,
-0.01326751708984375,
0.01515960693359375,
-0.01288604736328125,
-0.0182342529296875,
-0.01690673828125,
-0.0282135009765625,
0.006000518798828125,
0.0156707763671875,
0.0069732666015625,
-0.00034618377685546875,
0.004802703857421875,
0.051177978515625,
0.0184478759765625,
0.0216064453125,
0.0250244140625,
-0.005374908447265625,
0.0091705322265625,
0.004486083984375,
-0.005947113037109375,
-0.03350830078125,
0.002838134765625,
0.01099395751953125,
-0.0161590576171875,
-0.0491943359375,
0.025299072265625,
-0.0220794677734375,
0.04425048828125,
0.0302276611328125,
0.01479339599609375,
-0.0084075927734375,
-0.037261962890625,
-0.0110931396484375,
0.03033447265625,
0.017974853515625,
-0.0086669921875,
-0.032958984375,
-0.005764007568359375,
0.0009908676147460938,
-0.07708740234375,
-0.061798095703125,
0.02972412109375,
-0.01346588134765625,
0.00811004638671875,
-0.00270843505859375,
-0.01029205322265625,
-0.0246734619140625,
0.016998291015625,
-0.01142120361328125,
-0.002117156982421875,
-0.01763916015625,
-0.05804443359375,
-0.07080078125,
-0.10491943359375,
-0.0131683349609375,
-0.005527496337890625,
0.0280609130859375,
-0.01326751708984375,
0.07916259765625,
0.003246307373046875,
-0.01511383056640625,
0.0157623291015625,
0.01326751708984375,
-0.008331298828125,
-0.0024623870849609375,
0.0440673828125,
-0.01580810546875,
-0.00516510009765625,
0.0185394287109375,
0.0036334991455078125,
0.0097808837890625,
-0.01438140869140625,
-0.040069580078125,
-0.0220947265625,
-0.03216552734375,
-0.01515960693359375,
0.06561279296875,
0.034393310546875,
-0.07745361328125,
0.01427459716796875,
-0.09173583984375,
-0.047576904296875,
-0.00417327880859375,
-0.053741455078125,
0.0643310546875,
0.0457763671875,
-0.018890380859375,
0.0061798095703125,
0.0070648193359375,
0.016571044921875,
-0.00379180908203125,
0.01861572265625,
-0.04107666015625,
0.050048828125,
0.004657745361328125,
0.020660400390625,
-0.03485107421875,
-0.0019197463989257812,
-0.0257720947265625,
0.0194549560546875,
-0.0000845193862915039,
-0.0032367706298828125,
-0.032073974609375,
0.060028076171875,
-0.0236663818359375,
-0.021087646484375,
0.0219268798828125,
-0.025390625,
0.0362548828125,
-0.01261138916015625,
-0.0027923583984375,
-0.005016326904296875,
0.060791015625,
-0.03924560546875,
-0.029632568359375,
-0.005512237548828125,
0.0113983154296875,
-0.00333404541015625,
0.01337432861328125,
-0.00704193115234375,
-0.030792236328125,
-0.009674072265625,
0.035552978515625,
0.021697998046875,
-0.0025539398193359375,
-0.0219879150390625,
-0.007610321044921875,
-0.00601959228515625,
0.00785064697265625,
0.0279388427734375,
0.0030345916748046875,
0.004482269287109375,
0.03729248046875,
-0.00974273681640625,
0.0081634521484375,
0.003620147705078125,
-0.03192138671875,
-0.039764404296875,
0.0030498504638671875,
-0.024932861328125,
0.01129150390625,
0.041015625,
-0.035064697265625,
0.0135498046875,
0.0171356201171875,
0.067138671875,
0.09259033203125,
-0.007175445556640625,
-0.0518798828125,
-0.019561767578125,
0.024749755859375,
0.05267333984375,
0.0039520263671875,
0.00688934326171875,
0.01070404052734375,
-0.05487060546875,
0.0084991455078125,
-0.0202789306640625,
-0.004741668701171875,
0.0341796875,
-0.04498291015625,
0.053802490234375,
0.0010166168212890625,
0.00998687744140625,
0.063720703125,
-0.00170135498046875,
0.005889892578125,
-0.034820556640625,
0.030364990234375,
0.0278167724609375,
0.0226593017578125,
0.018035888671875,
0.015777587890625,
0.04132080078125,
0.0159149169921875,
-0.034698486328125,
-0.06793212890625,
0.00896453857421875,
0.051605224609375,
0.0166015625,
-0.0036258697509765625,
0.005519866943359375,
-0.05523681640625,
0.054534912109375,
0.042205810546875,
-0.03656005859375,
0.043365478515625,
0.0118408203125,
0.0145111083984375,
-0.027801513671875,
-0.0084075927734375,
-0.019989013671875,
0.017669677734375,
0.0289306640625,
-0.00795745849609375,
-0.018646240234375,
0.007114410400390625,
0.049072265625,
0.018829345703125,
-0.040802001953125,
-0.06781005859375,
-0.062286376953125,
0.0054931640625,
-0.01020050048828125,
0.047515869140625,
-0.01165771484375,
0.004856109619140625,
0.057525634765625,
0.035308837890625,
0.003398895263671875,
0.0413818359375,
0.0233001708984375,
-0.004428863525390625,
0.031768798828125,
0.037322998046875,
-0.0033740997314453125,
-0.0033435821533203125,
-0.01155853271484375,
0.0274810791015625,
0.0093231201171875,
-0.048553466796875,
-0.0025424957275390625,
-0.0257110595703125,
0.0229034423828125,
0.014862060546875,
-0.022613525390625,
0.05145263671875,
0.033966064453125,
-0.03509521484375,
-0.0180816650390625,
-0.036712646484375,
-0.0333251953125,
-0.05548095703125,
-0.0003910064697265625,
-0.0011234283447265625,
-0.005859375,
0.06402587890625,
-0.01100921630859375,
0.0304718017578125,
0.020172119140625,
-0.02740478515625,
-0.011322021484375,
-0.00942230224609375,
0.051025390625,
0.0181884765625,
-0.014862060546875,
0.005672454833984375,
0.0260467529296875,
0.0111846923828125,
-0.036376953125,
-0.02496337890625,
0.01094818115234375,
0.045623779296875,
-0.04345703125,
-0.0198516845703125,
0.029449462890625,
-0.0189971923828125,
-0.00839996337890625,
-0.00439453125,
-0.00543212890625,
-0.017974853515625,
0.005035400390625,
-0.01448822021484375,
-0.0144500732421875,
0.00003141164779663086,
-0.0229339599609375,
0.04229736328125,
-0.052978515625,
-0.00803375244140625,
0.06378173828125,
-0.0767822265625,
0.009307861328125,
0.0203704833984375,
-0.046356201171875,
0.00525665283203125,
0.030670166015625,
-0.07073974609375,
-0.049713134765625,
-0.01247406005859375,
-0.0269927978515625,
0.035614013671875,
-0.0207672119140625,
0.0012598037719726562,
-0.0006794929504394531,
-0.0230712890625,
-0.0019207000732421875,
0.01448822021484375,
0.01404571533203125,
-0.0109405517578125,
-0.0755615234375,
0.0271759033203125,
-0.05548095703125,
-0.0106048583984375,
-0.0250396728515625,
-0.052520751953125,
-0.053131103515625,
-0.00914764404296875,
0.0139923095703125,
-0.003513336181640625,
0.0142669677734375,
0.022552490234375,
-0.0179290771484375,
0.082275390625,
0.0208892822265625,
0.0611572265625,
-0.04119873046875,
0.08465576171875,
0.0002942085266113281,
0.0245513916015625,
-0.01515960693359375,
0.037353515625,
0.0292510986328125,
-0.0012865066528320312,
-0.006290435791015625,
-0.011199951171875,
0.0140380859375,
-0.004947662353515625,
-0.0023441314697265625,
0.01200103759765625,
0.076904296875,
0.021087646484375,
-0.0097808837890625,
-0.01349639892578125,
0.01023101806640625,
-0.01131439208984375,
0.00638580322265625,
-0.018768310546875,
-0.045684814453125,
0.0034732818603515625,
-0.03289794921875,
-0.0085296630859375,
0.019500732421875,
-0.04339599609375,
0.037933349609375,
0.0019006729125976562,
0.00604248046875,
0.045166015625,
-0.06884765625,
0.07366943359375,
0.055511474609375,
0.0362548828125,
0.04534912109375,
-0.0243988037109375,
0.01349639892578125,
-0.0016260147094726562,
0.05804443359375,
0.00891876220703125,
-0.0299224853515625,
0.060302734375,
0.0200347900390625,
-0.022705078125,
0.02294921875,
-0.037933349609375,
0.0202789306640625,
0.03472900390625,
0.07012939453125,
-0.042999267578125,
-0.0156402587890625,
0.011627197265625,
-0.0325927734375,
0.0227203369140625,
0.00160980224609375,
-0.004436492919921875,
-0.028076171875,
0.02020263671875,
0.00878143310546875,
0.0010223388671875,
0.01067352294921875,
-0.0124969482421875,
-0.03790283203125,
0.01280975341796875,
-0.01195526123046875,
0.0085296630859375,
0.004711151123046875,
-0.02618408203125,
-0.0023326873779296875,
-0.0165863037109375,
-0.03106689453125,
0.0249481201171875,
-0.051025390625,
0.0094146728515625,
-0.0215301513671875,
0.0137939453125,
-0.0222625732421875,
0.007049560546875,
-0.00830841064453125,
0.05462646484375,
-0.0117645263671875,
0.05694580078125,
-0.02166748046875,
0.03399658203125,
0.028656005859375,
0.031524658203125,
-0.00748443603515625,
-0.00995635986328125,
0.01091766357421875,
0.05694580078125,
0.00409698486328125,
0.01386260986328125,
-0.00006508827209472656,
-0.002826690673828125,
-0.003086090087890625,
-0.007137298583984375,
0.050201416015625,
-0.0255889892578125,
-0.011749267578125,
0.02349853515625,
0.0020771026611328125,
0.0009150505065917969,
0.017333984375,
0.0394287109375,
-0.038421630859375,
-0.01019287109375,
0.00909423828125,
-0.03375244140625,
-0.00516510009765625,
0.0211029052734375,
-0.0306549072265625,
0.0634765625,
-0.0311737060546875,
-0.00907135009765625,
0.025665283203125,
0.029571533203125,
-0.00746917724609375,
0.009857177734375,
-0.025299072265625,
0.0445556640625,
-0.0146331787109375,
0.028656005859375,
-0.028594970703125,
0.0226898193359375,
-0.0006880760192871094,
-0.0015497207641601562,
0.001132965087890625,
-0.006908416748046875,
-0.00612640380859375,
-0.00013875961303710938,
0.015716552734375,
0.0085906982421875,
-0.0099945068359375,
0.0273284912109375,
-0.03143310546875,
-0.0338134765625,
-0.05413818359375,
-0.0116119384765625,
0.007686614990234375,
-0.020355224609375,
-0.05413818359375,
-0.005649566650390625,
0.006076812744140625,
-0.0018606185913085938,
0.029083251953125,
-0.007503509521484375,
-0.02374267578125,
0.007747650146484375,
0.00421905517578125,
-0.0243377685546875,
0.0259246826171875,
-0.0191650390625,
-0.0146331787109375,
-0.025177001953125,
0.03509521484375,
-0.015411376953125,
0.032318115234375,
-0.0211029052734375,
0.032623291015625,
0.006824493408203125,
0.0106201171875,
0.078369140625,
-0.024810791015625,
-0.00021183490753173828,
0.03399658203125,
-0.02734375,
0.050628662109375,
-0.00876617431640625,
0.0182342529296875,
-0.047271728515625,
0.06756591796875,
-0.005702972412109375,
0.028411865234375,
-0.05487060546875,
-0.05767822265625,
0.006805419921875,
-0.00594329833984375,
0.0079803466796875,
-0.00022685527801513672,
-0.0079498291015625,
-0.05047607421875,
0.004779815673828125,
-0.0189971923828125,
-0.014801025390625,
0.024261474609375,
-0.03369140625,
0.01244354248046875,
0.057891845703125,
0.020416259765625,
0.01329803466796875,
-0.04791259765625,
0.033203125,
0.0193939208984375,
0.028350830078125,
-0.01172637939453125,
0.072021484375,
0.024444580078125,
-0.006725311279296875,
-0.00043773651123046875,
0.044647216796875,
0.00731658935546875,
0.0013742446899414062,
-0.01251220703125,
-0.021484375,
-0.007526397705078125,
0.0251007080078125,
0.02606201171875,
-0.00460052490234375,
0.025848388671875,
0.00020170211791992188,
-0.0418701171875,
0.004673004150390625,
0.0245819091796875,
-0.03167724609375,
-0.00684356689453125,
-0.04486083984375,
0.0401611328125,
0.04058837890625,
0.015899658203125,
0.0196990966796875,
-0.00449371337890625,
0.0692138671875,
-0.013031005859375,
0.031005859375,
-0.005893707275390625,
0.0038623809814453125,
0.0355224609375,
-0.03973388671875,
-0.0110321044921875,
-0.00400543212890625,
-0.061279296875,
-0.0164337158203125,
-0.033050537109375,
-0.005329132080078125,
0.01351165771484375,
0.0440673828125,
-0.0030765533447265625,
-0.0018672943115234375,
0.004657745361328125,
0.0083465576171875,
-0.01031494140625,
-0.0030956268310546875,
0.00797271728515625,
0.004913330078125,
0.03009033203125,
0.012298583984375,
-0.021697998046875,
-0.035736083984375,
0.005634307861328125,
0.03125,
0.018524169921875,
0.07318115234375,
-0.0283050537109375,
0.0234527587890625,
-0.0018825531005859375,
0.04632568359375,
-0.034332275390625,
-0.013336181640625,
0.08612060546875,
0.007549285888671875,
0.007648468017578125,
-0.03851318359375,
-0.05303955078125,
-0.0404052734375,
0.036712646484375,
-0.06561279296875,
-0.02874755859375,
0.003917694091796875,
0.031707763671875,
-0.025604248046875,
-0.01262664794921875,
-0.008941650390625,
-0.03424072265625,
-0.004001617431640625,
0.03094482421875,
0.00429534912109375,
0.026214599609375,
-0.01555633544921875,
0.0024433135986328125,
-0.006252288818359375,
-0.0535888671875,
0.0070648193359375,
-0.021331787109375,
0.020904541015625,
0.051788330078125,
0.0016078948974609375,
-0.054290771484375,
0.0159149169921875,
-0.015838623046875,
0.007228851318359375,
-0.01035308837890625,
0.06268310546875,
-0.0006594657897949219,
-0.036285400390625,
-0.026763916015625,
0.0297088623046875,
0.01544189453125,
-0.01184844970703125,
0.0148468017578125,
-0.0150604248046875,
-0.0149993896484375,
0.042877197265625,
-0.0169677734375,
-0.0220489501953125,
-0.0193023681640625,
-0.004207611083984375,
0.049346923828125,
-0.02435302734375,
0.0056610107421875,
-0.1162109375,
0.023712158203125,
0.0257110595703125,
0.002300262451171875,
-0.056304931640625,
0.046295166015625,
-0.0250396728515625,
0.037994384765625,
-0.00316619873046875,
0.00470733642578125,
0.0016393661499023438,
0.0179595947265625,
-0.03369140625,
0.001529693603515625,
-0.005229949951171875,
0.00958251953125,
0.0333251953125,
0.01413726806640625,
0.038970947265625,
-0.006900787353515625,
-0.01983642578125,
0.031494140625,
-0.0023059844970703125,
0.0927734375,
-0.080078125,
-0.020660400390625,
0.034332275390625,
-0.0220184326171875,
0.00423431396484375,
-0.0576171875,
-0.021453857421875,
-0.07244873046875,
0.017059326171875,
0.007537841796875,
-0.0209197998046875,
-0.027069091796875,
-0.05072021484375,
-0.06109619140625,
0.046142578125,
0.013916015625,
-0.0377197265625,
-0.061004638671875,
-0.048309326171875,
-0.0125579833984375,
-0.03106689453125,
-0.038604736328125,
-0.033111572265625,
-0.0102386474609375,
0.11505126953125,
0.0236663818359375,
0.01611328125,
0.036651611328125,
0.021728515625,
-0.03704833984375,
-0.0058135986328125,
-0.0273590087890625,
0.0026912689208984375,
0.01534271240234375,
0.0014495849609375,
0.0224456787109375,
0.061309814453125,
-0.0186614990234375,
-0.0236968994140625,
-0.043426513671875,
-0.0352783203125,
0.00030922889709472656,
-0.027313232421875,
-0.01345062255859375,
-0.049102783203125,
0.027313232421875,
-0.01235198974609375,
-0.0016412734985351562,
0.0223236083984375,
-0.038360595703125,
-0.002910614013671875,
-0.00963592529296875,
0.022918701171875,
0.0197601318359375,
-0.0418701171875,
0.00908660888671875,
0.003753662109375,
-0.04638671875,
0.01343536376953125,
-0.0259246826171875,
-0.049285888671875,
0.014892578125,
-0.072509765625,
-0.051544189453125,
0.0110626220703125,
-0.045684814453125,
0.0096282958984375,
0.01548004150390625,
0.039154052734375,
-0.0283660888671875,
0.057586669921875,
0.0182952880859375,
0.0226898193359375,
0.019622802734375,
0.046173095703125,
-0.05230712890625,
-0.0122222900390625,
0.0169219970703125,
-0.0009226799011230469,
-0.01337432861328125,
-0.0106658935546875,
0.0258636474609375,
0.02716064453125,
-0.01383209228515625,
0.0094146728515625,
-0.0100250244140625,
0.05322265625,
-0.023162841796875,
0.09832763671875,
-0.013763427734375,
0.03497314453125,
-0.02496337890625,
0.0472412109375,
-0.044708251953125,
0.0026264190673828125,
-0.0187835693359375,
-0.0185089111328125,
0.0173797607421875,
-0.0406494140625,
0.0165557861328125,
-0.04510498046875,
0.041412353515625,
-0.01776123046875,
-0.0299530029296875,
0.032623291015625
] |
f2732e15a978e57ac5de38aaa768e33df546d7b6
|
Wordpress Stackexchange
Q: What is the action hook for save media-form on gallery tab? I want to save a meta data to post parent when the media-form on gallery tab is saved( The submission button is "Save All Changes"). Which action hook can I use?
A: For updates it is 'edit_attachment' and for new attachments 'add_attachment'.
There is no action dedicated to images coming from the gallery tab, but you could check the global array $_FILES. If there is a $_FILES['async-upload'] it is probably a request from the media popup.
|
Q: What is the action hook for save media-form on gallery tab? I want to save a meta data to post parent when the media-form on gallery tab is saved( The submission button is "Save All Changes"). Which action hook can I use?
A: For updates it is 'edit_attachment' and for new attachments 'add_attachment'.
There is no action dedicated to images coming from the gallery tab, but you could check the global array $_FILES. If there is a $_FILES['async-upload'] it is probably a request from the media popup.
|
wordpress
|
{
"language": "en",
"length": 88,
"provenance": "stackexchange_00019.jsonl.gz:420632",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54531"
}
|
[
0.0106201171875,
-0.0038433074951171875,
-0.023223876953125,
0.0029964447021484375,
-0.0106353759765625,
-0.0299835205078125,
0.0404052734375,
-0.013153076171875,
0.0222320556640625,
0.047210693359375,
0.020416259765625,
-0.01392364501953125,
0.0299530029296875,
-0.035675048828125,
-0.04229736328125,
0.011260986328125,
0.03485107421875,
-0.0188140869140625,
0.053466796875,
0.01554107666015625,
0.00228118896484375,
0.04150390625,
0.0574951171875,
-0.003711700439453125,
0.0157928466796875,
0.0216217041015625,
-0.001331329345703125,
-0.0193939208984375,
0.01274871826171875,
0.00039958953857421875,
0.00922393798828125,
-0.0054931640625,
0.0285491943359375,
0.0044403076171875,
-0.0081634521484375,
0.0229339599609375,
0.033843994140625,
-0.0094451904296875,
0.001529693603515625,
0.031524658203125,
0.037353515625,
-0.0154266357421875,
-0.041168212890625,
0.0011882781982421875,
-0.027801513671875,
-0.00695037841796875,
0.0008516311645507812,
-0.017578125,
0.01113128662109375,
-0.0035953521728515625,
-0.0010347366333007812,
-0.0210113525390625,
0.0016698837280273438,
0.01328277587890625,
-0.01073455810546875,
-0.0171356201171875,
-0.0226593017578125,
0.00510406494140625,
0.0298614501953125,
0.020050048828125,
-0.0192413330078125,
-0.0226898193359375,
0.01367950439453125,
-0.0311737060546875,
0.0277099609375,
-0.026123046875,
-0.038604736328125,
0.031982421875,
-0.041046142578125,
0.0243377685546875,
0.0433349609375,
-0.047149658203125,
0.01380157470703125,
-0.025054931640625,
0.018280029296875,
0.0085906982421875,
0.0030994415283203125,
0.0128021240234375,
0.003536224365234375,
0.01861572265625,
0.0164642333984375,
-0.017974853515625,
0.0290374755859375,
-0.035064697265625,
0.0214996337890625,
0.0021343231201171875,
-0.01441192626953125,
-0.0161895751953125,
-0.023590087890625,
-0.0146331787109375,
-0.0183563232421875,
-0.045623779296875,
-0.0161895751953125,
0.0155029296875,
-0.003330230712890625,
-0.0321044921875,
0.01016998291015625,
0.0221710205078125,
-0.0037593841552734375,
-0.0076751708984375,
-0.0035953521728515625,
-0.039276123046875,
-0.0029048919677734375,
-0.01187896728515625,
0.00676727294921875,
-0.016143798828125,
-0.01910400390625,
-0.07122802734375,
0.007080078125,
0.0231475830078125,
-0.05078125,
0.0265655517578125,
-0.01175689697265625,
0.0129241943359375,
-0.012969970703125,
-0.0149993896484375,
-0.06756591796875,
0.06591796875,
-0.0157623291015625,
0.0418701171875,
-0.00206756591796875,
0.005825042724609375,
0.01641845703125,
-0.0256805419921875,
0.0093231201171875,
-0.0081329345703125,
-0.038421630859375,
-0.01025390625,
0.01442718505859375,
0.0197296142578125,
-0.01334381103515625,
0.0049591064453125,
0.0323486328125,
0.018310546875,
-0.00705718994140625,
-0.01285552978515625,
0.00042557716369628906,
-0.04010009765625,
0.0044403076171875,
0.00579833984375,
-0.0122833251953125,
-0.053802490234375,
-0.0032939910888671875,
0.016845703125,
0.028076171875,
-0.0108184814453125,
-0.0024242401123046875,
0.02301025390625,
0.043609619140625,
-0.00582122802734375,
0.01541900634765625,
-0.024871826171875,
0.043182373046875,
0.01336669921875,
-0.004215240478515625,
0.00390625,
0.06854248046875,
-0.03314208984375,
-0.0306549072265625,
-0.06268310546875,
0.00921630859375,
0.00859832763671875,
0.0609130859375,
-0.0165863037109375,
-0.025299072265625,
-0.027740478515625,
-0.05718994140625,
-0.0137786865234375,
0.03173828125,
0.00496673583984375,
0.0243072509765625,
-0.01299285888671875,
0.0316162109375,
0.0162200927734375,
-0.00772857666015625,
0.0285491943359375,
-0.034271240234375,
0.036102294921875,
0.0116119384765625,
0.00839996337890625,
0.00930023193359375,
-0.03387451171875,
0.0280914306640625,
0.01300048828125,
-0.00014662742614746094,
0.041656494140625,
0.01413726806640625,
0.02264404296875,
-0.0243072509765625,
0.0212554931640625,
-0.0054168701171875,
0.069091796875,
-0.023712158203125,
0.01062774658203125,
0.0011129379272460938,
0.00943756103515625,
0.0019512176513671875,
0.037200927734375,
-0.00719451904296875,
-0.048675537109375,
-0.0028400421142578125,
0.008941650390625,
-0.00811767578125,
0.006923675537109375,
-0.05279541015625,
0.00940704345703125,
-0.02838134765625,
0.032196044921875,
-0.0679931640625,
0.04302978515625,
0.040191650390625,
-0.001667022705078125,
-0.040557861328125,
0.026611328125,
0.0430908203125,
-0.015289306640625,
-0.0633544921875,
0.020172119140625,
0.0028972625732421875,
0.06103515625,
-0.0236663818359375,
-0.0117645263671875,
-0.0318603515625,
-0.06964111328125,
0.0181121826171875,
0.0005030632019042969,
-0.040008544921875,
-0.0259552001953125,
-0.030181884765625,
0.006328582763671875,
-0.0640869140625,
0.050048828125,
-0.013824462890625,
-0.03692626953125,
-0.05029296875,
-0.01849365234375,
-0.04412841796875,
-0.0810546875,
0.00684356689453125,
0.0650634765625,
0.0122222900390625,
0.030120849609375,
0.006473541259765625,
0.06494140625,
0.0447998046875,
0.048553466796875,
0.0309906005859375,
0.0200042724609375,
-0.0165252685546875,
0.028778076171875,
-0.01800537109375,
0.0227203369140625,
0.018341064453125,
-0.0261383056640625,
0.0061798095703125,
0.0263519287109375,
-0.0172119140625,
-0.023162841796875,
-0.03936767578125,
0.033233642578125,
0.005611419677734375,
-0.0155181884765625,
-0.0288848876953125,
0.001953125,
0.01555633544921875,
-0.0000807046890258789,
0.02935791015625,
0.01381683349609375,
-0.02398681640625,
-0.01416015625,
0.026397705078125,
0.01123046875,
0.0142364501953125,
0.0595703125,
0.0013494491577148438,
0.027069091796875,
-0.0019130706787109375,
-0.0447998046875,
0.0124053955078125,
0.038848876953125,
-0.02679443359375,
0.0172576904296875,
-0.00147247314453125,
-0.014495849609375,
0.002227783203125,
-0.045684814453125,
0.007770538330078125,
-0.047393798828125,
-0.016632080078125,
-0.032562255859375,
0.0173492431640625,
-0.024017333984375,
-0.03369140625,
0.0011425018310546875,
0.007183074951171875,
-0.059326171875,
-0.019805908203125,
0.0275726318359375,
-0.00453948974609375,
0.002689361572265625,
0.054779052734375,
0.047088623046875,
-0.037017822265625,
0.035858154296875,
-0.010498046875,
-0.060821533203125,
-0.039581298828125,
0.036468505859375,
0.006374359130859375,
-0.072265625,
0.0008683204650878906,
0.0120391845703125,
0.007030487060546875,
0.01419830322265625,
-0.044403076171875,
-0.0421142578125,
-0.04486083984375,
-0.02935791015625,
-0.09649658203125,
-0.060577392578125,
-0.00548553466796875,
-0.095703125,
0.0030727386474609375,
-0.0272216796875,
-0.04461669921875,
-0.014373779296875,
0.023834228515625,
0.008453369140625,
-0.04864501953125,
0.03155517578125,
0.01470184326171875,
0.0085906982421875,
-0.0146484375,
0.0148773193359375,
-0.0022373199462890625,
0.04193115234375,
0.004100799560546875,
0.049163818359375,
-0.007781982421875,
-0.0282745361328125,
0.00894927978515625,
-0.0716552734375,
-0.0016584396362304688,
0.016754150390625,
0.00824737548828125,
-0.058013916015625,
0.0033283233642578125,
-0.0037288665771484375,
0.035400390625,
0.0105133056640625,
0.0047607421875,
0.0032291412353515625,
-0.027618408203125,
-0.046966552734375,
0.000919342041015625,
0.05279541015625,
0.0223236083984375,
-0.03466796875,
0.06622314453125,
-0.051177978515625,
-0.0008740425109863281,
-0.0345458984375,
-0.04461669921875,
-0.01471710205078125,
0.02984619140625,
0.006107330322265625,
-0.0020904541015625,
-0.00849151611328125,
0.0010042190551757812,
0.0189971923828125,
0.0206756591796875,
-0.005840301513671875,
0.02606201171875,
-0.03076171875,
-0.0161285400390625,
-0.0266571044921875,
0.0005178451538085938,
-0.01338958740234375,
0.027252197265625,
-0.0097808837890625,
0.01432037353515625,
0.00327301025390625,
0.024688720703125,
0.002155303955078125,
-0.037750244140625,
0.001834869384765625,
-0.0660400390625,
0.080810546875,
-0.09765625,
-0.002704620361328125,
-0.07098388671875,
0.06756591796875,
-0.03631591796875,
-0.0212860107421875,
-0.001544952392578125,
0.01045989990234375,
0.0004470348358154297,
-0.018341064453125,
-0.00965118408203125,
-0.0161285400390625,
-0.036865234375,
0.018463134765625,
0.01409912109375,
-0.022491455078125,
-0.0023021697998046875,
-0.0008940696716308594,
-0.01519012451171875,
-0.029541015625,
0.041259765625,
-0.015777587890625,
-0.01824951171875,
0.04522705078125,
-0.0183868408203125,
0.0004763603210449219,
-0.018585205078125,
0.0071868896484375,
-0.11956787109375,
-0.019775390625,
-0.0189361572265625,
0.08697509765625,
0.01006317138671875,
-0.03326416015625,
-0.0408935546875,
0.051971435546875,
0.0178680419921875,
0.03399658203125,
0.01282501220703125,
-0.016571044921875,
0.011199951171875,
-0.01580810546875,
0.0222930908203125,
-0.029541015625,
-0.01554107666015625,
-0.01837158203125,
-0.025360107421875,
-0.01413726806640625,
-0.01507568359375,
-0.0206146240234375,
0.00511932373046875,
-0.01204681396484375,
-0.053497314453125,
-0.028656005859375,
-0.022857666015625,
0.0025157928466796875,
-0.0034313201904296875,
-0.005619049072265625,
-0.0457763671875,
-0.063232421875,
-0.0102996826171875,
-0.036468505859375,
0.006305694580078125,
0.0274505615234375,
0.08966064453125,
0.023040771484375,
0.0205230712890625,
-0.07061767578125,
-0.01451873779296875,
0.031646728515625,
-0.0118408203125,
0.01430511474609375,
-0.004398345947265625,
-0.0306396484375,
0.042022705078125,
-0.00849151611328125,
0.0286865234375,
-0.045440673828125,
0.05267333984375,
-0.00439453125,
0.007251739501953125,
0.00603485107421875,
-0.02105712890625,
0.0247955322265625,
-0.01409912109375,
-0.04144287109375,
0.011474609375,
-0.02545166015625,
0.0218658447265625,
-0.013763427734375,
0.058746337890625,
-0.0287628173828125,
-0.00817108154296875,
-0.0184478759765625,
0.027099609375,
0.04437255859375,
0.046356201171875,
-0.0163116455078125,
0.0171356201171875,
0.01812744140625,
-0.0008363723754882812,
-0.0307159423828125,
-0.01548004150390625,
-0.046234130859375,
0.0168609619140625,
-0.018585205078125,
-0.0083465576171875,
-0.007785797119140625,
0.02166748046875,
-0.0843505859375,
-0.02740478515625,
-0.044281005859375,
-0.06011962890625,
0.03271484375,
0.0546875,
0.0254669189453125,
0.01139068603515625,
0.03363037109375,
0.0253143310546875,
-0.0228729248046875,
-0.02935791015625,
0.009552001953125,
-0.000537872314453125,
-0.0556640625,
0.005748748779296875,
0.002288818359375,
-0.0261077880859375,
0.0007948875427246094,
0.00618743896484375,
0.0015649795532226562,
-0.0213165283203125,
-0.00862884521484375,
-0.00901031494140625,
0.009521484375,
-0.00457763671875,
0.040740966796875,
-0.02227783203125,
0.0173797607421875,
-0.03302001953125,
0.033905029296875,
-0.0273284912109375,
0.0433349609375,
0.0276031494140625,
0.0090484619140625,
0.0235443115234375,
-0.034912109375,
0.00844573974609375,
-0.03851318359375,
0.00042629241943359375,
0.00791168212890625,
-0.047576904296875,
-0.050201416015625,
0.0077667236328125,
0.0107421875,
-0.0017910003662109375,
-0.045989990234375,
0.007122039794921875,
0.00859832763671875,
0.036285400390625,
0.044464111328125,
-0.01039886474609375,
-0.0217132568359375,
0.02490234375,
0.020965576171875,
-0.010101318359375,
0.014984130859375,
0.019775390625,
-0.01361846923828125,
-0.02618408203125,
-0.014129638671875,
-0.01421356201171875,
0.06842041015625,
-0.009307861328125,
0.012603759765625,
-0.054901123046875,
0.033355712890625,
-0.065673828125,
0.006488800048828125,
0.04583740234375,
0.0218353271484375,
0.026275634765625,
-0.0236358642578125,
-0.004581451416015625,
-0.0175628662109375,
0.01537322998046875,
-0.030517578125,
0.0025119781494140625,
-0.032012939453125,
-0.0177154541015625,
0.020416259765625,
-0.00023996829986572266,
0.0184478759765625,
0.0291748046875,
0.0102386474609375,
-0.038238525390625,
0.00968170166015625,
0.0002732276916503906,
0.05413818359375,
-0.03314208984375,
0.022186279296875,
-0.0023193359375,
-0.00899505615234375,
-0.061431884765625,
0.01113128662109375,
-0.019256591796875,
-0.0273895263671875,
-0.0019702911376953125,
0.038970947265625,
-0.0032176971435546875,
0.0052642822265625,
0.025848388671875,
0.0014181137084960938,
-0.001148223876953125,
-0.00421142578125,
-0.01079559326171875,
-0.01641845703125,
0.044769287109375,
0.015655517578125,
0.00354766845703125,
0.017852783203125,
-0.03558349609375,
0.0287017822265625,
-0.0042877197265625,
-0.034515380859375,
0.057098388671875,
-0.037506103515625,
0.036346435546875,
0.031524658203125,
-0.028076171875,
0.040374755859375,
0.04656982421875,
0.0035800933837890625,
0.048431396484375,
0.0160980224609375,
0.01401519775390625,
0.035247802734375,
0.051300048828125,
-0.0098419189453125,
-0.04229736328125,
0.053131103515625,
0.023162841796875,
-0.0156707763671875,
0.051116943359375,
-0.025604248046875,
0.01557159423828125,
-0.00885009765625,
0.039947509765625,
-0.005458831787109375,
0.014984130859375,
0.0114593505859375,
-0.0028858184814453125,
0.05267333984375,
-0.0269775390625,
0.0203704833984375,
0.005992889404296875,
0.00547027587890625,
-0.018096923828125,
-0.041839599609375,
-0.0220794677734375,
-0.0286865234375,
-0.00356292724609375,
-0.004058837890625,
0.0073089599609375,
-0.00707244873046875,
-0.0067596435546875,
-0.06207275390625,
0.01505279541015625,
-0.06109619140625,
-0.00310516357421875,
0.01397705078125,
-0.0204010009765625,
-0.00977325439453125,
-0.054779052734375,
-0.0166015625,
-0.024169921875,
-0.008819580078125,
-0.024688720703125,
0.01343536376953125,
0.064697265625,
0.040069580078125,
-0.006591796875,
-0.00786590576171875,
0.0117034912109375,
0.0185394287109375,
-0.08502197265625,
-0.0075531005859375,
0.013946533203125,
0.003612518310546875,
-0.02557373046875,
0.0369873046875,
-0.05908203125,
0.00139617919921875,
-0.004077911376953125,
-0.033477783203125,
0.0243988037109375,
-0.0552978515625,
-0.006633758544921875,
0.00922393798828125,
-0.0025577545166015625,
0.01424407958984375,
0.00658416748046875,
-0.00969696044921875,
-0.030426025390625,
-0.0098876953125,
-0.0123138427734375,
-0.04608154296875,
-0.02276611328125,
-0.027008056640625,
-0.08392333984375,
0.0919189453125,
0.0193634033203125,
0.04168701171875,
0.0090484619140625,
0.0380859375,
-0.044036865234375,
-0.003292083740234375,
-0.0294342041015625,
0.033599853515625,
0.032440185546875,
0.0018339157104492188,
-0.002780914306640625,
0.000446319580078125,
0.003520965576171875,
0.007457733154296875,
0.03228759765625,
0.0149078369140625,
-0.0633544921875,
0.0023403167724609375,
0.04766845703125,
-0.000362396240234375,
-0.006061553955078125,
0.08258056640625,
-0.01036834716796875,
-0.029571533203125,
0.01288604736328125,
-0.00745391845703125,
0.0139617919921875,
-0.01007843017578125,
-0.01959228515625,
0.0202178955078125,
-0.007282257080078125,
-0.027252197265625,
-0.0369873046875,
0.03851318359375,
-0.0095062255859375,
-0.0321044921875,
0.00817108154296875,
-0.02996826171875,
-0.0034618377685546875,
0.007045745849609375,
-0.01284027099609375,
-0.0305633544921875,
0.0005311965942382812,
-0.0246734619140625,
0.0243682861328125,
-0.007701873779296875,
0.0180816650390625,
0.00262451171875,
0.006397247314453125,
0.027862548828125,
0.00893402099609375,
0.0017805099487304688,
0.0406494140625,
-0.010009765625,
0.0289459228515625,
0.00022673606872558594,
0.0017366409301757812,
-0.050201416015625,
0.0224151611328125,
0.0318603515625,
0.034759521484375,
-0.033721923828125,
-0.053466796875,
0.00934600830078125,
0.0015697479248046875,
-0.0023670196533203125,
0.0202484130859375,
0.01226043701171875,
-0.0340576171875,
0.025146484375,
-0.00402069091796875,
-0.01549530029296875,
-0.004711151123046875,
0.042449951171875,
0.0011243820190429688,
0.005340576171875,
-0.0124664306640625,
-0.035919189453125,
-0.0276031494140625,
-0.01483917236328125,
-0.01013946533203125,
0.018463134765625,
0.037994384765625,
0.0304412841796875,
0.0243072509765625,
-0.016510009765625,
-0.044891357421875,
0.034271240234375,
-0.01255035400390625,
0.06982421875,
-0.07208251953125,
-0.0153656005859375,
0.021759033203125,
0.04986572265625,
0.05377197265625,
0.08380126953125,
0.07708740234375,
0.046722412109375,
-0.0119781494140625,
0.036834716796875,
0.06341552734375,
-0.022705078125,
0.02984619140625,
-0.04827880859375,
0.059967041015625,
0.022308349609375,
0.0113983154296875,
-0.0281829833984375,
-0.0288543701171875,
0.09197998046875,
-0.044830322265625,
0.044647216796875,
-0.019317626953125,
-0.0188446044921875,
0.048797607421875,
-0.01947021484375,
0.0758056640625,
0.0014133453369140625,
-0.044219970703125,
-0.004650115966796875,
-0.01910400390625,
-0.046539306640625,
0.01207733154296875,
0.03253173828125,
-0.0452880859375,
0.042877197265625,
-0.054840087890625,
-0.0238494873046875,
0.025299072265625,
-0.00894927978515625,
-0.0092315673828125,
0.01873779296875,
-0.0014810562133789062,
-0.0138397216796875,
-0.040557861328125,
-0.0146331787109375,
-0.01305389404296875,
0.01458740234375,
-0.00113677978515625,
0.083251953125,
-0.0242919921875,
0.014495849609375,
0.0107269287109375,
0.0230255126953125,
-0.0204620361328125,
-0.0008821487426757812,
0.01371002197265625,
-0.01995849609375,
-0.0018978118896484375,
-0.0126800537109375,
0.00962066650390625,
0.008880615234375,
0.03173828125,
-0.01085662841796875,
-0.025909423828125,
-0.0088958740234375,
0.022003173828125,
0.0152740478515625,
0.025909423828125,
-0.0013360977172851562,
-0.01849365234375,
0.0002562999725341797,
-0.0025730133056640625,
0.029693603515625,
0.039398193359375,
-0.024627685546875,
0.029388427734375,
-0.004291534423828125,
0.0028400421142578125,
-0.0162811279296875,
0.0190277099609375,
-0.01093292236328125,
0.032928466796875,
-0.06610107421875,
-0.0111541748046875,
0.004222869873046875,
-0.01177978515625,
0.034881591796875,
0.00577545166015625,
0.031829833984375,
0.014801025390625,
-0.03204345703125,
-0.0014209747314453125,
0.0377197265625,
0.00798797607421875,
-0.0272216796875,
-0.00409698486328125,
0.03302001953125,
-0.04083251953125,
-0.0091552734375,
-0.040679931640625,
-0.0258636474609375,
-0.067138671875,
-0.01128387451171875,
0.0305328369140625,
-0.043792724609375,
-0.00872802734375,
-0.035125732421875,
-0.005462646484375,
0.0455322265625,
0.0141143798828125,
-0.03350830078125,
0.01544189453125,
-0.020233154296875,
0.01480865478515625,
0.02178955078125,
-0.00643157958984375,
-0.004058837890625,
0.06402587890625,
-0.00930023193359375,
-0.048614501953125,
-0.01468658447265625,
0.038848876953125,
-0.038421630859375,
0.01438140869140625,
0.006458282470703125,
-0.0277099609375,
0.0009026527404785156,
0.0194549560546875,
0.032684326171875,
0.06304931640625,
0.047943115234375,
-0.065185546875,
-0.045318603515625,
0.027862548828125,
0.07305908203125,
0.033538818359375,
-0.041534423828125,
0.053955078125,
0.01325225830078125,
-0.0247802734375,
-0.0159759521484375,
-0.01216888427734375,
-0.042205810546875,
-0.08575439453125,
0.04437255859375,
-0.0023059844970703125,
-0.0303955078125,
-0.0154571533203125,
0.044830322265625,
0.0007734298706054688,
0.00621795654296875,
0.0007662773132324219,
0.01049041748046875,
0.01534271240234375,
-0.0029201507568359375,
0.0010251998901367188,
-0.006221771240234375,
0.01042938232421875,
-0.003551483154296875,
-0.051849365234375,
0.0147857666015625,
0.0031223297119140625,
-0.006214141845703125,
0.0278472900390625,
-0.034210205078125,
0.060150146484375,
0.0284881591796875,
-0.05474853515625,
-0.0011768341064453125,
0.003154754638671875,
-0.002964019775390625,
-0.0163421630859375,
-0.03271484375,
-0.0067138671875,
-0.00038623809814453125,
0.054840087890625,
0.04290771484375,
0.000232696533203125,
-0.042205810546875,
0.04827880859375,
0.0114593505859375,
-0.051055908203125,
0.0204010009765625,
0.0292510986328125,
-0.02923583984375,
-0.0153045654296875,
0.008209228515625,
0.00762176513671875,
-0.044097900390625,
0.0186614990234375,
-0.0025157928466796875,
-0.0216827392578125,
0.06719970703125,
-0.006671905517578125,
0.0160064697265625,
-0.02801513671875,
0.09393310546875,
-0.04278564453125,
0.019439697265625,
0.0458984375,
0.0034694671630859375,
0.07867431640625,
0.09271240234375,
0.0562744140625,
0.034271240234375,
-0.047271728515625,
0.004131317138671875,
0.02813720703125,
-0.006008148193359375,
-0.0244140625,
-0.0340576171875,
-0.003143310546875,
-0.0012712478637695312,
-0.005519866943359375,
-0.0027294158935546875,
0.013671875,
0.0160064697265625,
-0.0189208984375,
0.061004638671875,
-0.047027587890625,
-0.0131988525390625,
-0.0311126708984375,
0.00518798828125,
-0.0003497600555419922,
0.0302734375,
0.0677490234375,
-0.006481170654296875,
0.0021648406982421875,
-0.0012254714965820312,
-0.01641845703125,
-0.06689453125,
0.046875,
0.01024627685546875,
-0.01483154296875,
0.03851318359375
] |
249b27f97dc5338ff916d20f206726fa71630aed
|
Wordpress Stackexchange
Q: Add extra fields to Add New Category page I need to add an extra field to the Add New Category page. Currently it only has fields for Name, Slug, and Description. Essentially, I need to have a second description text box.
I use the current Description field at the bottom of each category page, but now I need to have additional information specific to the category (and different from the bottom) displayed at the top.
How can I add this additional field?
Below is what I am trying to achieve:
A: If you want a plugin solution, advanced custom fields can do this.
|
Q: Add extra fields to Add New Category page I need to add an extra field to the Add New Category page. Currently it only has fields for Name, Slug, and Description. Essentially, I need to have a second description text box.
I use the current Description field at the bottom of each category page, but now I need to have additional information specific to the category (and different from the bottom) displayed at the top.
How can I add this additional field?
Below is what I am trying to achieve:
A: If you want a plugin solution, advanced custom fields can do this.
A: Ended up solving this with bainternet's plugin at http://en.bainternet.info/2012/wordpress-taxonomies-extra-fields-the-easy-way
|
wordpress
|
{
"language": "en",
"length": 114,
"provenance": "stackexchange_00019.jsonl.gz:420650",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54584"
}
|
[
0.0484619140625,
0.01229095458984375,
-0.03424072265625,
-0.07525634765625,
0.037628173828125,
-0.0257720947265625,
-0.006694793701171875,
0.005191802978515625,
-0.06591796875,
0.0030574798583984375,
-0.042022705078125,
0.049346923828125,
-0.0148773193359375,
-0.0182037353515625,
0.04730224609375,
-0.038818359375,
0.0092315673828125,
-0.004360198974609375,
0.01432037353515625,
-0.016021728515625,
0.01282501220703125,
-0.0038509368896484375,
0.022186279296875,
-0.0036373138427734375,
0.0161590576171875,
-0.0361328125,
0.0250701904296875,
-0.02593994140625,
0.02288818359375,
-0.012359619140625,
0.01453399658203125,
-0.00797271728515625,
0.008270263671875,
0.01629638671875,
0.00077056884765625,
0.00952911376953125,
0.02960205078125,
-0.0016231536865234375,
0.009490966796875,
0.048095703125,
0.0394287109375,
-0.029083251953125,
0.06707763671875,
0.0250396728515625,
0.0240631103515625,
-0.0292510986328125,
0.035369873046875,
-0.0650634765625,
0.004909515380859375,
-0.07135009765625,
0.00038170814514160156,
-0.0158538818359375,
0.027252197265625,
-0.048004150390625,
-0.0244903564453125,
-0.006412506103515625,
-0.01873779296875,
0.026519775390625,
0.033843994140625,
-0.007595062255859375,
-0.0282440185546875,
-0.0156707763671875,
0.01279449462890625,
-0.01947021484375,
0.00186920166015625,
-0.011260986328125,
-0.01110076904296875,
0.0180206298828125,
-0.0399169921875,
-0.0108642578125,
0.051116943359375,
-0.0430908203125,
0.010711669921875,
-0.0021610260009765625,
-0.0092010498046875,
-0.0160064697265625,
0.0288238525390625,
-0.002437591552734375,
0.009735107421875,
0.00737762451171875,
-0.0294647216796875,
0.0103302001953125,
0.006313323974609375,
-0.062286376953125,
0.002056121826171875,
-0.03814697265625,
-0.02471923828125,
0.01384735107421875,
-0.0244598388671875,
-0.01448822021484375,
-0.0129852294921875,
-0.08709716796875,
-0.03240966796875,
0.049285888671875,
0.029571533203125,
-0.01384735107421875,
0.0010986328125,
0.0308074951171875,
0.0169830322265625,
0.059478759765625,
-0.0110321044921875,
-0.041534423828125,
0.06634521484375,
-0.06097412109375,
0.0280303955078125,
0.014251708984375,
-0.02703857421875,
-0.06903076171875,
0.037994384765625,
0.0220947265625,
-0.0189666748046875,
0.04296875,
0.033172607421875,
-0.002201080322265625,
-0.005199432373046875,
0.0163421630859375,
0.0301513671875,
0.0286712646484375,
-0.007213592529296875,
0.033050537109375,
0.0050811767578125,
0.0115966796875,
-0.0174713134765625,
-0.0194854736328125,
-0.0107879638671875,
-0.037841796875,
-0.02716064453125,
0.020172119140625,
0.03997802734375,
-0.03985595703125,
-0.0252532958984375,
0.039398193359375,
0.046844482421875,
0.0170745849609375,
0.0020694732666015625,
0.01031494140625,
-0.004878997802734375,
-0.017120361328125,
0.001735687255859375,
0.0197296142578125,
-0.03277587890625,
-0.0212860107421875,
0.042755126953125,
-0.01861572265625,
0.01605224609375,
-0.00885009765625,
-0.006900787353515625,
0.043304443359375,
0.027435302734375,
-0.012664794921875,
0.04296875,
-0.062164306640625,
0.031219482421875,
0.01256561279296875,
-0.03570556640625,
-0.006298065185546875,
-0.022216796875,
-0.0106048583984375,
-0.0053253173828125,
-0.01265716552734375,
0.026397705078125,
0.01445770263671875,
0.01220703125,
-0.0692138671875,
-0.062164306640625,
-0.038970947265625,
-0.0732421875,
-0.003566741943359375,
0.0211639404296875,
-0.0138702392578125,
0.0179290771484375,
0.0180511474609375,
-0.00803375244140625,
-0.006839752197265625,
0.0102386474609375,
0.006908416748046875,
-0.008575439453125,
0.00931549072265625,
0.03240966796875,
0.0006976127624511719,
-0.0203094482421875,
-0.03985595703125,
0.052764892578125,
-0.0201416015625,
-0.0654296875,
0.06036376953125,
-0.006420135498046875,
0.0931396484375,
0.03619384765625,
0.0158233642578125,
0.004619598388671875,
-0.0273284912109375,
-0.032073974609375,
-0.005420684814453125,
-0.01190948486328125,
0.00656890869140625,
-0.010009765625,
0.0298309326171875,
-0.00971221923828125,
-0.00269317626953125,
-0.037689208984375,
0.0199127197265625,
-0.025482177734375,
0.045562744140625,
0.042938232421875,
-0.0178985595703125,
0.01165008544921875,
0.004642486572265625,
0.01849365234375,
0.0086212158203125,
0.00023925304412841797,
-0.03436279296875,
0.01369476318359375,
-0.03216552734375,
-0.056304931640625,
-0.00356292724609375,
-0.015106201171875,
-0.0005936622619628906,
0.0089111328125,
-0.0095672607421875,
0.00897216796875,
0.002902984619140625,
-0.0036525726318359375,
0.01629638671875,
0.026275634765625,
0.002262115478515625,
-0.027130126953125,
-0.0178070068359375,
0.01045989990234375,
0.01241302490234375,
-0.039398193359375,
0.035308837890625,
0.06817626953125,
0.0308837890625,
-0.023101806640625,
0.0287628173828125,
0.0290679931640625,
-0.04498291015625,
-0.027557373046875,
0.0323486328125,
0.01558685302734375,
-0.015716552734375,
-0.00917816162109375,
0.0295257568359375,
0.0640869140625,
0.007282257080078125,
0.00717926025390625,
0.01465606689453125,
0.00458526611328125,
0.061309814453125,
0.023101806640625,
0.0194091796875,
-0.01006317138671875,
-0.0335693359375,
0.0242767333984375,
0.0178680419921875,
-0.0297698974609375,
-0.0399169921875,
0.0099945068359375,
-0.011810302734375,
0.0266571044921875,
-0.0272216796875,
-0.045562744140625,
0.01030731201171875,
0.031768798828125,
0.0103302001953125,
0.035430908203125,
0.029632568359375,
-0.0257568359375,
0.002819061279296875,
0.00904083251953125,
-0.01080322265625,
-0.005039215087890625,
-0.00476837158203125,
-0.029815673828125,
0.0081024169921875,
-0.0169677734375,
0.0160675048828125,
-0.025848388671875,
-0.024566650390625,
-0.0177459716796875,
0.031982421875,
0.0255584716796875,
-0.013763427734375,
-0.0195465087890625,
-0.0577392578125,
0.01412200927734375,
-0.0130615234375,
-0.043609619140625,
-0.032958984375,
0.004398345947265625,
0.006999969482421875,
-0.033538818359375,
0.0007781982421875,
-0.022369384765625,
-0.0234222412109375,
-0.0073699951171875,
-0.0200958251953125,
0.0220794677734375,
-0.039703369140625,
0.002521514892578125,
0.040740966796875,
-0.0151214599609375,
-0.00502777099609375,
-0.0105743408203125,
-0.0157318115234375,
-0.020416259765625,
-0.005970001220703125,
-0.005550384521484375,
-0.00013256072998046875,
-0.0284576416015625,
0.056365966796875,
0.032958984375,
0.01380157470703125,
0.025634765625,
-0.029998779296875,
0.0156402587890625,
0.02362060546875,
-0.034423828125,
-0.049652099609375,
-0.027557373046875,
-0.03680419921875,
-0.00962066650390625,
0.048431396484375,
-0.02490234375,
-0.016876220703125,
0.07733154296875,
0.01357269287109375,
0.0002237558364868164,
-0.056976318359375,
-0.0311279296875,
-0.07012939453125,
-0.042236328125,
-0.040771484375,
-0.0019588470458984375,
-0.01202392578125,
0.005016326904296875,
0.06439208984375,
0.007526397705078125,
-0.032562255859375,
-0.00681304931640625,
-0.0269927978515625,
-0.018310546875,
0.00865936279296875,
-0.0150604248046875,
-0.0117950439453125,
0.0251922607421875,
0.0077972412109375,
0.0148773193359375,
0.02850341796875,
-0.006988525390625,
-0.016021728515625,
-0.057098388671875,
0.033447265625,
-0.036376953125,
0.0091400146484375,
0.07757568359375,
-0.0020885467529296875,
-0.029022216796875,
-0.032257080078125,
0.0037593841552734375,
0.005054473876953125,
-0.01824951171875,
-0.059906005859375,
-0.01763916015625,
-0.007221221923828125,
-0.031524658203125,
0.0086669921875,
-0.029083251953125,
-0.00833892822265625,
0.00975799560546875,
-0.0076904296875,
-0.011016845703125,
-0.0300750732421875,
-0.05804443359375,
0.0033092498779296875,
-0.0300140380859375,
-0.057647705078125,
0.0275421142578125,
-0.024505615234375,
0.001926422119140625,
0.01215362548828125,
0.0138702392578125,
0.029388427734375,
-0.0609130859375,
0.01274871826171875,
-0.0653076171875,
0.035980224609375,
-0.042022705078125,
-0.004688262939453125,
-0.006443023681640625,
0.09088134765625,
-0.03466796875,
-0.04302978515625,
0.0052947998046875,
0.014434814453125,
-0.0092926025390625,
0.006290435791015625,
-0.0142974853515625,
-0.032501220703125,
-0.0211334228515625,
-0.0010786056518554688,
0.004909515380859375,
-0.030609130859375,
-0.0193023681640625,
0.072265625,
-0.0249786376953125,
-0.00617218017578125,
0.0322265625,
-0.038482666015625,
0.001956939697265625,
0.0219268798828125,
-0.00713348388671875,
0.0046539306640625,
-0.033660888671875,
-0.020355224609375,
-0.052276611328125,
-0.0152587890625,
0.0147552490234375,
0.0213165283203125,
-0.0232696533203125,
0.00518798828125,
-0.00927734375,
0.04620361328125,
0.007843017578125,
0.00927734375,
0.0190277099609375,
0.00394439697265625,
0.013885498046875,
0.0011138916015625,
0.00736236572265625,
-0.0236358642578125,
-0.00036716461181640625,
-0.024505615234375,
-0.00432586669921875,
0.024810791015625,
-0.042205810546875,
0.01117706298828125,
-0.024139404296875,
-0.0224151611328125,
0.00913238525390625,
-0.029022216796875,
-0.008148193359375,
0.00832366943359375,
-0.00690460205078125,
0.00482940673828125,
-0.0264892578125,
0.023529052734375,
0.0120391845703125,
0.006900787353515625,
-0.01959228515625,
0.02154541015625,
0.06597900390625,
0.0166015625,
-0.00982666015625,
-0.08123779296875,
0.005306243896484375,
0.04412841796875,
0.012847900390625,
0.00905609130859375,
-0.006092071533203125,
-0.029266357421875,
0.045654296875,
0.01108551025390625,
-0.00015151500701904297,
-0.041717529296875,
0.049957275390625,
-0.0238037109375,
-0.037628173828125,
0.0255126953125,
-0.045379638671875,
0.04010009765625,
-0.0168914794921875,
-0.041900634765625,
0.0308380126953125,
-0.0479736328125,
0.01751708984375,
0.00423431396484375,
0.049774169921875,
-0.0170440673828125,
0.001949310302734375,
-0.00791168212890625,
0.049285888671875,
0.05682373046875,
0.050750732421875,
-0.00962066650390625,
0.00042057037353515625,
-0.01367950439453125,
-0.0290985107421875,
-0.03729248046875,
-0.067626953125,
-0.0110626220703125,
-0.03155517578125,
-0.01163482666015625,
-0.031341552734375,
0.01497650146484375,
-0.0081939697265625,
0.02008056640625,
-0.0229644775390625,
-0.0526123046875,
-0.00554656982421875,
-0.034332275390625,
0.01934814453125,
0.048004150390625,
0.039459228515625,
-0.00925445556640625,
-0.00244140625,
0.034820556640625,
0.01522064208984375,
0.035614013671875,
0.003063201904296875,
0.019195556640625,
0.002838134765625,
0.017669677734375,
-0.016265869140625,
-0.02264404296875,
0.06622314453125,
-0.01493072509765625,
0.01558685302734375,
-0.007457733154296875,
0.0273284912109375,
0.0225830078125,
0.00977325439453125,
0.0203704833984375,
0.0038928985595703125,
-0.005321502685546875,
-0.0197296142578125,
-0.017669677734375,
-0.040435791015625,
0.0018320083618164062,
0.003200531005859375,
0.04522705078125,
0.0026950836181640625,
-0.0294647216796875,
0.031768798828125,
-0.0157928466796875,
0.0021724700927734375,
-0.02789306640625,
0.01715087890625,
0.00821685791015625,
0.025543212890625,
0.005401611328125,
-0.02178955078125,
0.0031261444091796875,
-0.005245208740234375,
0.01239776611328125,
-0.0263214111328125,
0.046173095703125,
0.027252197265625,
0.031890869140625,
-0.016510009765625,
-0.024017333984375,
-0.0694580078125,
-0.014404296875,
0.00750732421875,
-0.036102294921875,
-0.045257568359375,
0.01067352294921875,
-0.01342010498046875,
-0.00989532470703125,
-0.00738525390625,
0.056610107421875,
-0.0171661376953125,
-0.024261474609375,
-0.0080108642578125,
0.00992584228515625,
0.01389312744140625,
0.0010833740234375,
0.041046142578125,
-0.035980224609375,
-0.022491455078125,
-0.055419921875,
-0.03485107421875,
0.00966644287109375,
-0.017608642578125,
0.0127716064453125,
0.017608642578125,
0.032867431640625,
-0.006519317626953125,
-0.035797119140625,
-0.032501220703125,
-0.006378173828125,
0.033538818359375,
0.012359619140625,
-0.011962890625,
-0.0007214546203613281,
0.01202392578125,
0.038360595703125,
0.004367828369140625,
-0.011077880859375,
0.0012063980102539062,
-0.0271148681640625,
0.00836181640625,
-0.037139892578125,
-0.035888671875,
0.000980377197265625,
-0.061859130859375,
0.005584716796875,
0.0389404296875,
-0.0134124755859375,
0.004444122314453125,
0.0018625259399414062,
0.016143798828125,
-0.005153656005859375,
0.01384735107421875,
-0.005214691162109375,
-0.0294952392578125,
0.0491943359375,
-0.01105499267578125,
0.07598876953125,
-0.003841400146484375,
-0.00021851062774658203,
0.03277587890625,
-0.046722412109375,
0.07366943359375,
0.0274200439453125,
-0.061920166015625,
0.059844970703125,
0.024169921875,
-0.01204681396484375,
0.014923095703125,
-0.0030517578125,
0.007602691650390625,
-0.016204833984375,
-0.007007598876953125,
-0.002593994140625,
0.0100860595703125,
0.0679931640625,
0.008087158203125,
-0.0146942138671875,
0.056304931640625,
-0.0272369384765625,
-0.0005536079406738281,
0.026580810546875,
0.058807373046875,
-0.063720703125,
0.01861572265625,
0.0183868408203125,
-0.00524139404296875,
0.0211181640625,
-0.00001239776611328125,
0.0161895751953125,
0.0308990478515625,
0.0142059326171875,
-0.0160675048828125,
-0.0195770263671875,
0.00630950927734375,
-0.01812744140625,
-0.02740478515625,
0.003643035888671875,
0.0116424560546875,
0.02984619140625,
-0.005313873291015625,
0.022552490234375,
-0.00450897216796875,
0.03485107421875,
0.0019245147705078125,
-0.03594970703125,
0.03448486328125,
-0.04254150390625,
-0.042510986328125,
0.02337646484375,
-0.045013427734375,
0.0166778564453125,
0.033447265625,
0.016693115234375,
0.0401611328125,
0.0125274658203125,
0.02435302734375,
-0.0101165771484375,
-0.027679443359375,
0.00634765625,
0.03607177734375,
-0.0096893310546875,
0.000766754150390625,
-0.00318145751953125,
-0.0105743408203125,
-0.00988006591796875,
-0.008819580078125,
-0.01059722900390625,
-0.0219879150390625,
-0.030029296875,
0.066650390625,
-0.031494140625,
-0.017181396484375,
0.00429534912109375,
0.0155029296875,
0.008514404296875,
0.00928497314453125,
0.0209503173828125,
-0.0220184326171875,
0.002529144287109375,
0.0215606689453125,
0.002349853515625,
0.005176544189453125,
0.024749755859375,
-0.09332275390625,
0.0860595703125,
0.03173828125,
0.0293731689453125,
-0.01513671875,
0.035614013671875,
-0.04974365234375,
-0.002300262451171875,
-0.0179290771484375,
0.0633544921875,
0.045135498046875,
0.01322174072265625,
-0.057342529296875,
-0.034088134765625,
-0.004611968994140625,
0.07049560546875,
0.07366943359375,
0.014617919921875,
0.025177001953125,
0.01410675048828125,
0.052215576171875,
0.01033782958984375,
-0.049285888671875,
0.01151275634765625,
0.0257110595703125,
-0.037750244140625,
0.044769287109375,
0.034332275390625,
0.042999267578125,
-0.00942230224609375,
0.01122283935546875,
0.035614013671875,
0.01103973388671875,
0.011322021484375,
-0.006443023681640625,
0.025299072265625,
-0.006519317626953125,
-0.01395416259765625,
0.00580596923828125,
-0.0192413330078125,
-0.00817108154296875,
0.0413818359375,
0.0172882080078125,
-0.0181732177734375,
0.03985595703125,
-0.0296630859375,
0.055450439453125,
0.00799560546875,
0.044403076171875,
0.041290283203125,
0.0084075927734375,
0.06463623046875,
0.03656005859375,
0.039581298828125,
0.0380859375,
0.00433349609375,
0.0609130859375,
0.016693115234375,
0.0294342041015625,
-0.0273895263671875,
0.0142364501953125,
0.0017499923706054688,
0.06536865234375,
-0.0546875,
-0.016143798828125,
0.006954193115234375,
0.0090484619140625,
0.0175323486328125,
0.0066375732421875,
0.04052734375,
0.0228424072265625,
0.044647216796875,
-0.06842041015625,
0.00394439697265625,
0.0220947265625,
0.04217529296875,
-0.01551055908203125,
-0.02728271484375,
-0.0531005859375,
-0.0298919677734375,
-0.06329345703125,
0.0227203369140625,
0.0007915496826171875,
0.051513671875,
0.036834716796875,
0.04119873046875,
0.019317626953125,
-0.0253753662109375,
-0.00371551513671875,
0.02166748046875,
0.0237579345703125,
0.006282806396484375,
-0.006103515625,
-0.00020742416381835938,
-0.006740570068359375,
0.01253509521484375,
-0.002422332763671875,
-0.006053924560546875,
0.0164031982421875,
0.050262451171875,
0.0219573974609375,
-0.024566650390625,
0.0273895263671875,
-0.0038013458251953125,
0.00038743019104003906,
-0.058563232421875,
0.037841796875,
0.041961669921875,
0.01387786865234375,
0.012969970703125,
-0.0300445556640625,
0.08270263671875,
-0.00617218017578125,
-0.0311279296875,
0.0249786376953125,
-0.0560302734375,
0.10223388671875,
0.0217742919921875,
0.09124755859375,
0.03131103515625,
-0.1031494140625,
-0.0132293701171875,
-0.06005859375,
-0.058746337890625,
0.07476806640625,
0.061614990234375,
-0.03631591796875,
0.005329132080078125,
0.050537109375,
-0.037322998046875,
0.0185089111328125,
0.01824951171875,
0.01560211181640625,
-0.0031108856201171875,
0.002841949462890625,
0.0014543533325195312,
-0.01953125,
0.00046253204345703125,
0.0246124267578125,
0.003681182861328125,
0.011260986328125,
0.018310546875,
0.0227813720703125,
0.0120697021484375,
-0.013397216796875,
0.0201873779296875,
-0.004695892333984375,
-0.03204345703125,
0.036041259765625,
0.052764892578125,
0.0204925537109375,
-0.03582763671875,
-0.0296478271484375,
0.027679443359375,
0.025177001953125,
-0.0150299072265625,
0.03076171875,
-0.007701873779296875,
-0.0012760162353515625,
-0.02862548828125,
0.00788116455078125,
-0.022979736328125,
-0.012847900390625,
-0.027252197265625,
-0.02117919921875,
0.0253753662109375,
-0.00862884521484375,
-0.0131378173828125,
0.012542724609375,
0.02117919921875,
0.0230255126953125,
0.0099029541015625,
0.0220489501953125,
0.0003848075866699219,
0.034637451171875,
-0.00632476806640625,
0.0019817352294921875,
0.044464111328125,
-0.00830841064453125,
0.04217529296875,
0.007190704345703125,
0.05462646484375,
0.03485107421875,
-0.0250396728515625,
-0.031494140625,
0.005950927734375,
0.00865936279296875,
-0.0297698974609375,
-0.00885009765625,
-0.0002949237823486328,
-0.01503753662109375,
0.006771087646484375,
0.0097198486328125,
-0.04248046875,
-0.05914306640625,
0.004604339599609375,
0.0198974609375,
-0.042327880859375,
-0.0172882080078125,
-0.068603515625,
0.00046825408935546875,
0.046844482421875,
0.005138397216796875,
-0.05712890625,
0.0276031494140625,
-0.0197601318359375,
0.04473876953125,
-0.01433563232421875,
-0.0216217041015625,
0.0174560546875,
0.037628173828125,
-0.043121337890625,
0.02728271484375,
-0.031768798828125,
-0.047943115234375,
-0.0237884521484375,
0.0181427001953125,
0.0189056396484375,
-0.026824951171875,
0.0097503662109375,
0.0406494140625,
0.041473388671875,
0.08056640625,
0.04595947265625,
-0.01244354248046875,
0.0227203369140625,
0.009796142578125,
-0.03558349609375,
-0.042388916015625,
0.0155487060546875,
-0.006252288818359375,
-0.01430511474609375,
-0.0244293212890625,
0.0214996337890625,
0.018402099609375,
-0.015960693359375,
-0.04632568359375,
0.035552978515625,
-0.01352691650390625,
-0.022216796875,
-0.0192108154296875,
0.004150390625,
-0.029876708984375,
0.036468505859375,
0.00311279296875,
-0.01027679443359375,
0.005252838134765625,
0.033966064453125,
0.0357666015625,
-0.006885528564453125,
0.048583984375,
0.01107025146484375,
-0.0772705078125,
0.0032672882080078125,
-0.0119781494140625,
0.059234619140625,
0.031402587890625,
-0.0298309326171875,
0.0020580291748046875,
0.00983428955078125,
-0.0753173828125,
-0.08697509765625,
-0.043548583984375,
0.0200042724609375,
0.0090179443359375,
-0.046173095703125,
-0.0443115234375,
-0.029937744140625,
0.0506591796875,
0.019989013671875,
0.01544189453125,
-0.0099945068359375,
-0.0186920166015625,
-0.043060302734375,
0.01169586181640625,
-0.0066986083984375,
-0.0136566162109375,
-0.04034423828125,
0.0170745849609375,
0.0174102783203125,
-0.00505828857421875,
-0.0222930908203125,
0.02630615234375,
-0.00943756103515625,
-0.00951385498046875,
0.056427001953125,
0.0119476318359375,
-0.047576904296875,
0.0151824951171875,
0.0618896484375,
-0.064208984375,
-0.050537109375,
0.0010271072387695312,
0.00041365623474121094,
-0.007404327392578125,
-0.05078125,
-0.063720703125,
-0.0204010009765625,
-0.0223388671875,
0.035003662109375,
-0.044403076171875,
0.08447265625,
-0.0550537109375,
0.02960205078125,
-0.0293426513671875,
0.036407470703125,
0.00946044921875,
0.030242919921875,
-0.049041748046875,
0.0738525390625,
0.0352783203125,
0.0655517578125,
0.010955810546875,
-0.0004978179931640625,
-0.005584716796875,
0.060791015625,
0.01263427734375,
-0.038330078125,
0.0406494140625,
-0.054962158203125,
-0.0078125,
0.030426025390625,
-0.040283203125,
-0.0241241455078125,
0.0167083740234375,
0.033172607421875,
0.0014629364013671875,
0.0155487060546875
] |
696ce050e33855f5080062ad51809feecc234cba
|
Wordpress Stackexchange
Q: Customize WordPress>Error Page Is there a way to customize the WordPress>error page template so that the user isn't shown just a blank screen with text?
I'm not talking about 404, but when WordPress displays an error.
I'd like to style this page to match my theme.
A: You're probably talking about theming wp_die(), which is the function that produces those grey error pages with a white box of text in them.
For a plugin solution, you could try this plugin, which says it does what you want. Not sure about version support though--it says it only works up to 3.1.4.
For a programatic solution, you'll want to hook into the filter "wp_die_handler". So you can do:
add_filter('wp_die_handler', 'my_die_handler');
As far as code for the my_die_handler function, you could start by looking at the default die handler -- the function is called _default_wp_die_handler, and it starts on line 2796 of the core file /wp-includes/functions.php. You can copy the whole function to your plugin file (or your theme's functions file), rename it my_die_handler, and customize it from there.
|
Q: Customize WordPress>Error Page Is there a way to customize the WordPress>error page template so that the user isn't shown just a blank screen with text?
I'm not talking about 404, but when WordPress displays an error.
I'd like to style this page to match my theme.
A: You're probably talking about theming wp_die(), which is the function that produces those grey error pages with a white box of text in them.
For a plugin solution, you could try this plugin, which says it does what you want. Not sure about version support though--it says it only works up to 3.1.4.
For a programatic solution, you'll want to hook into the filter "wp_die_handler". So you can do:
add_filter('wp_die_handler', 'my_die_handler');
As far as code for the my_die_handler function, you could start by looking at the default die handler -- the function is called _default_wp_die_handler, and it starts on line 2796 of the core file /wp-includes/functions.php. You can copy the whole function to your plugin file (or your theme's functions file), rename it my_die_handler, and customize it from there.
A: You can set up a custom die handler:
add_filter('wp_die_handler', 'get_custom_die_handler' );
function get_custom_die_handler() {
return 'custom_die_handler';
}
function custom_die_handler( $message, $title="", $args = array() ) {
echo '<html><body>';
echo '<h1>Error:</h1>';
echo $message; /* No escaping, to match the default behaviour */
echo '</body></html>';
die();
}
Notice that you need to create two functions: both your custom die handler, and a function that returns the name of your custom die handler.
You can look at _default_wp_die_handler for inspiration on what to put in the contents of custom_die_handler, you can find it in wp-includes/functions.php. Don't forget to call die();.
Reference:
*
*http://www.velvetblues.com/web-development-blog/custom-wordpress-comment-error-page/
|
wordpress
|
{
"language": "en",
"length": 278,
"provenance": "stackexchange_00019.jsonl.gz:420658",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54600"
}
|
[
0.0889892578125,
-0.0036983489990234375,
0.00986480712890625,
-0.08251953125,
-0.00957489013671875,
-0.00782012939453125,
-0.0228729248046875,
-0.0284576416015625,
-0.020233154296875,
0.0210418701171875,
-0.00989532470703125,
0.0223236083984375,
-0.006099700927734375,
-0.0157318115234375,
-0.004924774169921875,
-0.032989501953125,
0.0220184326171875,
0.01265716552734375,
0.049896240234375,
-0.01326751708984375,
0.0014028549194335938,
-0.00643157958984375,
0.04718017578125,
0.00881195068359375,
0.00971221923828125,
-0.00634002685546875,
0.082275390625,
-0.01091766357421875,
0.0194549560546875,
-0.0179595947265625,
0.0264892578125,
-0.017913818359375,
0.038970947265625,
0.012908935546875,
-0.03594970703125,
0.0128173828125,
-0.0135040283203125,
-0.00342559814453125,
-0.037017822265625,
0.050323486328125,
0.022430419921875,
-0.012115478515625,
0.05169677734375,
-0.01074981689453125,
0.01232147216796875,
-0.0217437744140625,
0.04290771484375,
-0.0207977294921875,
0.016326904296875,
0.00902557373046875,
-0.0154876708984375,
-0.00948333740234375,
-0.00010520219802856445,
-0.017669677734375,
-0.015777587890625,
-0.027496337890625,
-0.017242431640625,
0.037109375,
0.034454345703125,
0.003559112548828125,
-0.017181396484375,
-0.010162353515625,
0.00936126708984375,
-0.01543426513671875,
-0.00701904296875,
-0.0056915283203125,
-0.019927978515625,
0.0130157470703125,
-0.01348114013671875,
0.00554656982421875,
0.020538330078125,
-0.0023021697998046875,
0.006259918212890625,
-0.0142364501953125,
-0.01041412353515625,
0.0164947509765625,
-0.016998291015625,
0.0150604248046875,
0.021240234375,
0.003570556640625,
0.052947998046875,
-0.0286865234375,
0.059417724609375,
-0.0208892822265625,
0.017578125,
-0.00505828857421875,
0.015899658203125,
-0.0141448974609375,
-0.02276611328125,
-0.03204345703125,
-0.0259246826171875,
-0.0156402587890625,
-0.0192108154296875,
-0.0038509368896484375,
-0.027862548828125,
-0.009796142578125,
-0.0233917236328125,
-0.01108551025390625,
-0.01288604736328125,
0.01849365234375,
0.0011777877807617188,
-0.026336669921875,
0.04205322265625,
-0.019561767578125,
-0.0026111602783203125,
0.0509033203125,
0.01934814453125,
0.0167999267578125,
0.0098724365234375,
0.004947662353515625,
0.0043182373046875,
-0.006664276123046875,
-0.054443359375,
-0.02679443359375,
-0.045379638671875,
0.064697265625,
-0.0096282958984375,
-0.051055908203125,
-0.013427734375,
-0.0010986328125,
-0.0142364501953125,
0.0042724609375,
0.0374755859375,
-0.00798797607421875,
0.00031566619873046875,
-0.00429534912109375,
-0.0085906982421875,
-0.052520751953125,
0.08642578125,
-0.040252685546875,
-0.04595947265625,
0.034637451171875,
0.045166015625,
0.00833892822265625,
0.027008056640625,
-0.0041046142578125,
0.045623779296875,
-0.01107025146484375,
0.0011568069458007812,
0.006893157958984375,
0.01334381103515625,
-0.034271240234375,
-0.0318603515625,
-0.00048041343688964844,
0.01393890380859375,
0.02435302734375,
0.03155517578125,
0.0033779144287109375,
0.0022182464599609375,
-0.033905029296875,
0.0004324913024902344,
0.005290985107421875,
-0.00318145751953125,
0.01438140869140625,
0.01496124267578125,
0.006938934326171875,
-0.00392913818359375,
-0.00003838539123535156,
-0.00531005859375,
0.00902557373046875,
0.0237579345703125,
0.0157012939453125,
0.024078369140625,
0.00026226043701171875,
-0.00213623046875,
-0.027557373046875,
-0.0343017578125,
0.00351715087890625,
0.01523590087890625,
0.01146697998046875,
0.0018129348754882812,
0.0185394287109375,
-0.016448974609375,
-0.017730712890625,
-0.00887298583984375,
-0.0157623291015625,
-0.041412353515625,
0.06396484375,
0.0222320556640625,
0.001293182373046875,
0.01434326171875,
-0.04644775390625,
0.0789794921875,
0.01467132568359375,
-0.05828857421875,
0.01026153564453125,
0.00928497314453125,
0.0343017578125,
0.020050048828125,
0.00986480712890625,
0.043548583984375,
0.00794219970703125,
-0.004268646240234375,
0.02191162109375,
-0.010986328125,
-0.05865478515625,
-0.002399444580078125,
-0.0184326171875,
-0.014373779296875,
0.0297393798828125,
-0.040008544921875,
0.0294952392578125,
-0.0176544189453125,
0.0005278587341308594,
-0.0523681640625,
0.01201629638671875,
-0.0238800048828125,
0.046417236328125,
0.01110076904296875,
0.0128936767578125,
-0.002613067626953125,
0.006069183349609375,
-0.040679931640625,
0.040130615234375,
-0.0258941650390625,
-0.0132293701171875,
-0.01268768310546875,
0.039459228515625,
0.0162506103515625,
0.02313232421875,
0.00804901123046875,
-0.027618408203125,
0.017913818359375,
-0.0009179115295410156,
0.006195068359375,
-0.037567138671875,
0.0010232925415039062,
-0.0185394287109375,
-0.00621795654296875,
0.0081787109375,
-0.006275177001953125,
0.021270751953125,
0.032135009765625,
0.0115966796875,
-0.04327392578125,
-0.0185546875,
-0.0207672119140625,
-0.04779052734375,
-0.0079803466796875,
0.0574951171875,
0.047088623046875,
0.023468017578125,
-0.006404876708984375,
-0.0236663818359375,
0.054443359375,
-0.04638671875,
0.01517486572265625,
-0.0098724365234375,
-0.016571044921875,
-0.025848388671875,
-0.0041656494140625,
-0.0203399658203125,
0.0308837890625,
-0.0777587890625,
0.005138397216796875,
0.01983642578125,
-0.044647216796875,
-0.037811279296875,
-0.0015039443969726562,
0.011199951171875,
0.00839996337890625,
0.0157623291015625,
0.0200958251953125,
-0.0010938644409179688,
0.0223388671875,
-0.001842498779296875,
0.01026153564453125,
-0.00933837890625,
-0.03515625,
0.0099334716796875,
0.02099609375,
-0.0195465087890625,
-0.005832672119140625,
-0.008636474609375,
-0.00225830078125,
0.03582763671875,
-0.01561737060546875,
0.0019931793212890625,
-0.00018739700317382812,
-0.0114288330078125,
-0.0025844573974609375,
0.01450347900390625,
-0.041900634765625,
-0.00528717041015625,
0.00853729248046875,
-0.06591796875,
-0.0004534721374511719,
0.04168701171875,
0.05291748046875,
-0.0175018310546875,
-0.0038738250732421875,
0.0309295654296875,
-0.032257080078125,
0.06707763671875,
0.01526641845703125,
-0.0380859375,
-0.005481719970703125,
-0.069091796875,
0.06451416015625,
-0.06866455078125,
-0.0027313232421875,
0.0677490234375,
-0.03448486328125,
0.00658416748046875,
0.0005159378051757812,
0.0316162109375,
-0.0178985595703125,
0.0245513916015625,
0.012359619140625,
-0.0452880859375,
-0.00027108192443847656,
-0.0188446044921875,
0.012176513671875,
0.06561279296875,
-0.0087432861328125,
-0.04901123046875,
-0.003139495849609375,
0.031890869140625,
-0.020782470703125,
-0.06298828125,
0.038543701171875,
-0.011199951171875,
-0.01389312744140625,
0.005756378173828125,
-0.005214691162109375,
-0.0241851806640625,
0.022308349609375,
-0.01334381103515625,
-0.06219482421875,
-0.0421142578125,
-0.0282135009765625,
-0.06536865234375,
-0.0416259765625,
0.0399169921875,
0.00971221923828125,
0.0167694091796875,
-0.0042724609375,
0.068115234375,
0.018035888671875,
-0.036468505859375,
-0.00553131103515625,
0.040557861328125,
-0.0167694091796875,
-0.01324462890625,
0.01253509521484375,
0.009521484375,
0.0244140625,
0.0164794921875,
-0.005352020263671875,
0.036865234375,
-0.026275634765625,
-0.0279083251953125,
-0.0394287109375,
-0.0184783935546875,
-0.05462646484375,
0.0711669921875,
0.0738525390625,
-0.046783447265625,
-0.01224517822265625,
-0.0501708984375,
-0.07525634765625,
0.0443115234375,
-0.055206298828125,
0.0455322265625,
0.026336669921875,
-0.0247802734375,
0.015289306640625,
0.024322509765625,
0.016998291015625,
-0.00800323486328125,
0.00978851318359375,
0.00121307373046875,
0.0006761550903320312,
-0.0001277923583984375,
0.0160675048828125,
-0.02679443359375,
0.017791748046875,
-0.0206146240234375,
-0.0079193115234375,
-0.0013589859008789062,
-0.015838623046875,
-0.0109405517578125,
-0.0262451171875,
-0.0435791015625,
-0.07537841796875,
0.034576416015625,
-0.06268310546875,
-0.0139007568359375,
-0.01255035400390625,
-0.0011644363403320312,
0.060089111328125,
0.10882568359375,
0.0011129379272460938,
-0.00931549072265625,
-0.01837158203125,
-0.005985260009765625,
0.0169677734375,
-0.006809234619140625,
0.0017423629760742188,
-0.006649017333984375,
-0.08953857421875,
-0.00034928321838378906,
0.0121612548828125,
-0.029815673828125,
-0.020263671875,
0.061920166015625,
-0.0408935546875,
-0.0268707275390625,
0.00537872314453125,
-0.0312347412109375,
-0.0190277099609375,
0.041046142578125,
-0.0421142578125,
0.01163482666015625,
0.005523681640625,
-0.04205322265625,
-0.07977294921875,
-0.02862548828125,
-0.0193023681640625,
0.0721435546875,
0.038818359375,
-0.056060791015625,
0.001544952392578125,
0.054443359375,
0.051910400390625,
0.051971435546875,
0.0301055908203125,
-0.04034423828125,
0.06329345703125,
-0.006755828857421875,
0.04315185546875,
-0.020416259765625,
0.04058837890625,
0.019073486328125,
-0.08245849609375,
0.035552978515625,
-0.01554107666015625,
0.0220184326171875,
0.053680419921875,
-0.077392578125,
-0.060302734375,
-0.058319091796875,
-0.0185699462890625,
-0.00640869140625,
0.01439666748046875,
-0.0187530517578125,
-0.05426025390625,
-0.0494384765625,
0.0197906494140625,
-0.0164337158203125,
-0.01467132568359375,
0.01290130615234375,
0.040130615234375,
0.0256805419921875,
-0.0162200927734375,
-0.00249481201171875,
0.0005240440368652344,
0.031219482421875,
-0.007740020751953125,
-0.0115509033203125,
-0.0131072998046875,
-0.033935546875,
0.051361083984375,
-0.0141143798828125,
-0.007083892822265625,
-0.03350830078125,
0.07073974609375,
-0.031646728515625,
-0.03765869140625,
0.0305633544921875,
-0.057403564453125,
0.0160369873046875,
0.05181884765625,
-0.007770538330078125,
-0.024505615234375,
0.02093505859375,
0.039520263671875,
-0.04425048828125,
0.0148162841796875,
-0.0160369873046875,
-0.00711822509765625,
-0.005008697509765625,
0.00301361083984375,
0.0269927978515625,
0.043792724609375,
-0.005855560302734375,
-0.0012359619140625,
-0.0081329345703125,
-0.0231475830078125,
0.0199127197265625,
-0.00974273681640625,
0.01270294189453125,
0.006824493408203125,
0.022705078125,
-0.0205078125,
-0.0101318359375,
-0.009918212890625,
0.0799560546875,
0.0202484130859375,
-0.03656005859375,
-0.0179443359375,
-0.008575439453125,
-0.004184722900390625,
-0.005832672119140625,
0.010101318359375,
0.0136566162109375,
0.0251312255859375,
-0.02032470703125,
-0.00637054443359375,
0.031494140625,
0.0103912353515625,
-0.0283050537109375,
0.04193115234375,
0.0305938720703125,
-0.0215301513671875,
-0.026763916015625,
0.040985107421875,
0.0460205078125,
-0.0247039794921875,
-0.0128936767578125,
0.0033740997314453125,
0.01378631591796875,
0.054473876953125,
0.01369476318359375,
-0.0225067138671875,
-0.0122528076171875,
0.046783447265625,
0.01464080810546875,
-0.0185546875,
-0.036590576171875,
-0.018310546875,
0.006847381591796875,
-0.07049560546875,
-0.00885009765625,
0.06304931640625,
0.007511138916015625,
-0.00371551513671875,
0.03271484375,
-0.04852294921875,
-0.057037353515625,
-0.0295562744140625,
0.0026531219482421875,
0.03948974609375,
-0.04046630859375,
-0.0018815994262695312,
0.038116455078125,
-0.0259857177734375,
-0.0170135498046875,
0.039703369140625,
-0.052947998046875,
-0.0310516357421875,
-0.00986480712890625,
0.0136566162109375,
0.0047454833984375,
-0.0101470947265625,
-0.05255126953125,
-0.038543701171875,
-0.007503509521484375,
0.0270843505859375,
0.044189453125,
-0.04071044921875,
0.0034332275390625,
-0.011962890625,
0.003082275390625,
-0.02862548828125,
0.016265869140625,
0.053192138671875,
0.0273590087890625,
-0.046051025390625,
0.01250457763671875,
-0.0400390625,
-0.0260467529296875,
-0.03094482421875,
-0.04498291015625,
-0.05157470703125,
-0.00032901763916015625,
-0.005611419677734375,
0.0202178955078125,
-0.002956390380859375,
-0.001399993896484375,
-0.028045654296875,
0.015716552734375,
0.00670623779296875,
0.0223541259765625,
-0.025146484375,
0.0160064697265625,
0.00785064697265625,
0.015655517578125,
-0.0020351409912109375,
0.01013946533203125,
0.040435791015625,
-0.0225372314453125,
0.00769805908203125,
-0.01441192626953125,
-0.02313232421875,
-0.0308380126953125,
0.00650787353515625,
0.057891845703125,
0.07659912109375,
-0.00446319580078125,
0.0004601478576660156,
-0.0009851455688476562,
0.0058135986328125,
-0.01544952392578125,
0.00439453125,
0.0022754669189453125,
-0.016021728515625,
0.036773681640625,
-0.04193115234375,
-0.049560546875,
0.004169464111328125,
-0.0177459716796875,
0.0185394287109375,
0.01065826416015625,
-0.0102691650390625,
0.000009238719940185547,
-0.048095703125,
0.07293701171875,
0.04443359375,
-0.0003330707550048828,
0.0121002197265625,
0.002681732177734375,
-0.0079193115234375,
-0.026763916015625,
-0.01395416259765625,
-0.0182952880859375,
0.0021762847900390625,
0.03717041015625,
-0.0014104843139648438,
-0.0176239013671875,
0.0247955322265625,
-0.009063720703125,
0.03411865234375,
0.05072021484375,
0.08892822265625,
-0.0682373046875,
0.002956390380859375,
0.01360321044921875,
-0.06451416015625,
0.0096588134765625,
-0.039276123046875,
0.0303192138671875,
-0.0178375244140625,
0.07293701171875,
0.0197296142578125,
-0.0148162841796875,
0.01611328125,
-0.02801513671875,
-0.006298065185546875,
-0.04351806640625,
0.06512451171875,
0.01904296875,
-0.004970550537109375,
0.039764404296875,
-0.024200439453125,
0.05938720703125,
-0.0021533966064453125,
0.00998687744140625,
-0.0484619140625,
-0.01885986328125,
-0.03533935546875,
-0.039825439453125,
-0.0203094482421875,
-0.0175323486328125,
-0.0218963623046875,
-0.01117706298828125,
0.003543853759765625,
0.04522705078125,
-0.028778076171875,
-0.0027599334716796875,
0.0046844482421875,
-0.00550079345703125,
0.01554107666015625,
-0.01708984375,
-0.0037860870361328125,
0.01354217529296875,
-0.051605224609375,
0.0076446533203125,
-0.0207061767578125,
0.011505126953125,
-0.00902557373046875,
0.00437164306640625,
0.10577392578125,
-0.03778076171875,
-0.026214599609375,
0.03369140625,
0.0019741058349609375,
-0.03875732421875,
-0.011199951171875,
0.030548095703125,
-0.0236968994140625,
0.005596160888671875,
-0.0006260871887207031,
-0.00909423828125,
-0.0135650634765625,
0.004520416259765625,
-0.0259246826171875,
0.06878662109375,
-0.002140045166015625,
-0.0005698204040527344,
0.0232696533203125,
0.031494140625,
-0.0236358642578125,
0.024322509765625,
-0.01983642578125,
0.060882568359375,
-0.00821685791015625,
0.08282470703125,
-0.029022216796875,
0.0022563934326171875,
0.046600341796875,
0.027374267578125,
0.0283203125,
0.00696563720703125,
0.0009198188781738281,
-0.0074005126953125,
0.0002034902572631836,
0.0023746490478515625,
-0.0189056396484375,
0.030731201171875,
-0.037994384765625,
0.0289154052734375,
-0.029296875,
-0.051971435546875,
0.0163726806640625,
-0.017120361328125,
-0.0584716796875,
-0.01448822021484375,
0.0037326812744140625,
-0.00943756103515625,
0.0234375,
0.021240234375,
-0.060577392578125,
0.00836181640625,
0.036590576171875,
-0.0249176025390625,
-0.0088043212890625,
0.05865478515625,
0.06243896484375,
-0.0657958984375,
-0.00212860107421875,
-0.038848876953125,
0.05767822265625,
-0.011016845703125,
-0.0082855224609375,
-0.01934814453125,
-0.00777435302734375,
-0.0269622802734375,
0.01690673828125,
-0.0186004638671875,
0.048370361328125,
-0.0010128021240234375,
0.0213165283203125,
0.0087127685546875,
0.006649017333984375,
-0.0232391357421875,
0.00954437255859375,
0.035369873046875,
0.021759033203125,
-0.027252197265625,
-0.044158935546875,
0.006908416748046875,
0.0140228271484375,
0.0275115966796875,
0.01067352294921875,
0.055145263671875,
-0.04803466796875,
-0.00592041015625,
-0.011016845703125,
-0.00803375244140625,
-0.005352020263671875,
-0.01378631591796875,
-0.0264434814453125,
-0.01140594482421875,
0.031402587890625,
0.0301361083984375,
0.00655364990234375,
-0.0206451416015625,
0.023162841796875,
0.03778076171875,
-0.0178375244140625,
0.0308380126953125,
-0.0364990234375,
0.004852294921875,
-0.0165252685546875,
0.01500701904296875,
0.01219940185546875,
0.0156707763671875,
-0.01216888427734375,
0.0142669677734375,
-0.041412353515625,
0.0270233154296875,
-0.01325225830078125,
-0.0194549560546875,
0.0217132568359375,
0.0343017578125,
-0.007724761962890625,
-0.034393310546875,
-0.0089569091796875,
-0.0233001708984375,
-0.0022830963134765625,
-0.0292510986328125,
0.02490234375,
0.0104827880859375,
-0.0033435821533203125,
0.01007843017578125,
0.033233642578125,
0.00748443603515625,
-0.0137939453125,
0.03424072265625,
0.0019168853759765625,
-0.02392578125,
0.017364501953125,
-0.0384521484375,
0.052001953125,
0.0130462646484375,
-0.10455322265625,
-0.04327392578125,
-0.01245880126953125,
0.00981903076171875,
0.018341064453125,
0.03912353515625,
0.0019931793212890625,
0.00684356689453125,
0.0213470458984375,
0.0142822265625,
0.0118865966796875,
-0.00992584228515625,
-0.0150604248046875,
-0.0087890625,
0.034912109375,
0.01116180419921875,
-0.04736328125,
-0.032745361328125,
-0.016876220703125,
0.05523681640625,
-0.0224761962890625,
0.0986328125,
-0.04571533203125,
0.00496673583984375,
-0.01222991943359375,
0.0040130615234375,
-0.005100250244140625,
-0.0026397705078125,
-0.01019287109375,
0.032501220703125,
0.023193359375,
-0.016021728515625,
-0.042633056640625,
0.0626220703125,
-0.016357421875,
-0.003955841064453125,
0.032073974609375,
-0.0231781005859375,
-0.00843048095703125,
0.0189361572265625,
0.0253753662109375,
-0.00469207763671875,
-0.028656005859375,
-0.021759033203125,
0.0199432373046875,
0.0203704833984375,
0.0219268798828125,
-0.040008544921875,
0.00792694091796875,
-0.01456451416015625,
-0.0217437744140625,
0.031707763671875,
-0.00830078125,
0.0545654296875,
0.03204345703125,
-0.06500244140625,
-0.0006694793701171875,
-0.0024566650390625,
-0.0127105712890625,
0.0181427001953125,
0.007472991943359375,
0.02166748046875,
-0.01387786865234375,
0.04168701171875,
-0.00751495361328125,
-0.078369140625,
-0.01629638671875,
-0.0203094482421875,
-0.03485107421875,
-0.03045654296875,
0.0277099609375,
-0.030242919921875,
-0.02197265625,
-0.0093841552734375,
0.00905609130859375,
-0.00392913818359375,
0.015899658203125,
0.042816162109375,
0.006374359130859375,
0.0204010009765625,
-0.0281982421875,
0.0298004150390625,
0.00899505615234375,
-0.05621337890625,
-0.004261016845703125,
0.005001068115234375,
0.026519775390625,
0.0015783309936523438,
-0.0032558441162109375,
0.00244903564453125,
0.027374267578125,
-0.036468505859375,
-0.024658203125,
-0.0278167724609375,
0.011932373046875,
-0.0347900390625,
-0.0191802978515625,
0.031158447265625,
0.01177215576171875,
-0.0179595947265625,
-0.022064208984375,
-0.055145263671875,
0.047760009765625,
-0.0706787109375,
-0.0189971923828125,
0.018310546875,
-0.0035305023193359375,
-0.0004115104675292969,
-0.04833984375,
0.00044465065002441406,
-0.05908203125,
0.0207672119140625,
0.0526123046875,
-0.042999267578125,
-0.019744873046875,
-0.0557861328125,
-0.0634765625,
0.06304931640625,
0.014984130859375,
-0.04168701171875,
-0.004833221435546875,
-0.01007843017578125,
-0.004039764404296875,
-0.022918701171875,
-0.00643157958984375,
0.006259918212890625,
-0.021728515625,
0.009185791015625,
0.028076171875,
-0.004802703857421875,
0.0107269287109375,
0.026123046875,
-0.0654296875,
0.027923583984375,
0.0177459716796875,
0.0159149169921875,
0.0162353515625,
-0.010101318359375,
0.01552581787109375,
0.04254150390625,
-0.035888671875,
-0.03436279296875,
-0.02386474609375,
-0.0204315185546875,
-0.0181884765625,
-0.045196533203125,
0.0193634033203125,
-0.01507568359375,
0.04107666015625,
-0.018524169921875,
0.00826263427734375,
-0.0002663135528564453,
-0.0523681640625,
-0.049407958984375,
0.01224517822265625,
-0.0201568603515625,
0.00290679931640625,
-0.0721435546875,
-0.00922393798828125,
0.0203704833984375,
-0.0543212890625,
0.0024890899658203125,
0.0092010498046875,
-0.042999267578125,
0.0179290771484375,
-0.001216888427734375,
-0.0156402587890625,
-0.04266357421875,
-0.037139892578125,
0.10992431640625,
-0.045013427734375,
0.004848480224609375,
0.022979736328125,
0.027587890625,
0.05023193359375,
0.019866943359375,
-0.04412841796875,
0.02154541015625,
-0.0892333984375,
0.0237579345703125,
-0.0631103515625,
0.051239013671875,
-0.09344482421875,
0.0284881591796875,
0.0174713134765625,
0.003993988037109375,
-0.02313232421875,
0.01202392578125,
0.046722412109375,
-0.015777587890625,
-0.033294677734375,
0.0233306884765625,
-0.0266876220703125,
0.01175689697265625,
-0.01548004150390625,
0.0213165283203125,
-0.025299072265625,
0.0091400146484375,
0.0187225341796875,
-0.044464111328125,
0.011444091796875,
0.002208709716796875,
0.0191497802734375,
-0.015472412109375,
0.0287322998046875,
0.04571533203125,
-0.003963470458984375,
0.01189422607421875
] |
e02031eaa73bc34634d1459affd3174d2be35659
|
Wordpress Stackexchange
Q: Content generator for development site Does anybody knows good plugin which can generate dummy posts/tags/categories/users and write dummy comments? I want to generate some content on my development (localhost) site.
A: I always use the Theme Unit Test that Theme Reviewers use to evaluate themes for the Repo. It's got pretty much everything you need to style/worry about.
And if I need to create batch content in a different way, then I use WP Dummy Content
|
Q: Content generator for development site Does anybody knows good plugin which can generate dummy posts/tags/categories/users and write dummy comments? I want to generate some content on my development (localhost) site.
A: I always use the Theme Unit Test that Theme Reviewers use to evaluate themes for the Repo. It's got pretty much everything you need to style/worry about.
And if I need to create batch content in a different way, then I use WP Dummy Content
|
wordpress
|
{
"language": "en",
"length": 77,
"provenance": "stackexchange_00019.jsonl.gz:420660",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54613"
}
|
[
-0.025115966796875,
-0.033477783203125,
-0.051483154296875,
-0.01329803466796875,
-0.0243072509765625,
-0.02215576171875,
-0.00954437255859375,
0.033233642578125,
-0.026397705078125,
0.032958984375,
0.0157470703125,
0.00885009765625,
-0.0174102783203125,
-0.031402587890625,
-0.01288604736328125,
-0.0086822509765625,
-0.00687408447265625,
0.03460693359375,
0.0218658447265625,
-0.03009033203125,
0.01178741455078125,
-0.03680419921875,
-0.0214996337890625,
0.0562744140625,
0.03326416015625,
-0.004535675048828125,
0.0771484375,
-0.0222625732421875,
0.036712646484375,
-0.00849151611328125,
0.0303955078125,
-0.032806396484375,
0.01253509521484375,
0.00658416748046875,
0.005947113037109375,
0.002750396728515625,
0.0323486328125,
-0.018035888671875,
0.00611114501953125,
0.0273895263671875,
0.00390625,
-0.0098114013671875,
0.01421356201171875,
-0.0218505859375,
0.00881195068359375,
-0.0199737548828125,
0.0139312744140625,
-0.057708740234375,
0.0335693359375,
-0.033203125,
-0.003814697265625,
0.0309295654296875,
0.0012788772583007812,
0.0024280548095703125,
-0.0132904052734375,
0.0106658935546875,
-0.066650390625,
0.003704071044921875,
0.04022216796875,
-0.0216522216796875,
0.0013265609741210938,
-0.059051513671875,
0.0386962890625,
0.03192138671875,
0.01519012451171875,
-0.00844573974609375,
0.022125244140625,
0.006984710693359375,
-0.0013113021850585938,
0.03533935546875,
0.045623779296875,
-0.01459503173828125,
0.0131988525390625,
-0.00034809112548828125,
-0.04248046875,
-0.003948211669921875,
0.021820068359375,
0.0001207590103149414,
0.0230712890625,
-0.0234832763671875,
-0.0156097412109375,
0.01244354248046875,
-0.01168060302734375,
-0.053924560546875,
0.03656005859375,
-0.007518768310546875,
-0.006214141845703125,
-0.003696441650390625,
-0.055755615234375,
-0.019775390625,
-0.0273284912109375,
-0.05438232421875,
-0.06787109375,
0.0303802490234375,
0.0161285400390625,
-0.0182647705078125,
0.036529541015625,
0.0195770263671875,
0.015289306640625,
0.00643157958984375,
0.032501220703125,
-0.063232421875,
0.040283203125,
-0.01727294921875,
0.018096923828125,
0.05718994140625,
-0.0153045654296875,
-0.032928466796875,
0.038299560546875,
0.00676727294921875,
0.008819580078125,
0.016326904296875,
-0.023773193359375,
-0.024169921875,
0.0306854248046875,
0.02142333984375,
-0.040863037109375,
0.04937744140625,
-0.0022373199462890625,
0.034393310546875,
0.0225067138671875,
0.026885986328125,
0.05633544921875,
0.00991058349609375,
0.0030956268310546875,
0.03289794921875,
-0.026458740234375,
-0.06414794921875,
0.005123138427734375,
-0.03070068359375,
0.0007886886596679688,
0.02471923828125,
0.03131103515625,
0.031951904296875,
0.00649261474609375,
0.007801055908203125,
0.01824951171875,
-0.01270294189453125,
-0.01245880126953125,
-0.0011110305786132812,
-0.0408935546875,
0.00940704345703125,
0.0455322265625,
-0.06292724609375,
0.0126495361328125,
0.0192413330078125,
0.01110076904296875,
0.00734710693359375,
0.024871826171875,
0.0036754608154296875,
-0.02679443359375,
-0.01415252685546875,
-0.00212860107421875,
0.005977630615234375,
0.054931640625,
-0.052520751953125,
0.002384185791015625,
-0.0310821533203125,
0.05816650390625,
0.006458282470703125,
0.005462646484375,
0.019073486328125,
0.0278778076171875,
-0.002960205078125,
-0.0078277587890625,
-0.018646240234375,
-0.00991058349609375,
0.00982666015625,
0.024749755859375,
-0.011627197265625,
-0.0026721954345703125,
-0.01042938232421875,
0.0357666015625,
0.006168365478515625,
-0.00873565673828125,
0.037017822265625,
-0.02032470703125,
0.00763702392578125,
0.044952392578125,
-0.00899505615234375,
-0.0179595947265625,
-0.0181121826171875,
0.08917236328125,
-0.000850677490234375,
-0.03643798828125,
0.0146636962890625,
-0.002407073974609375,
0.0139617919921875,
0.029510498046875,
-0.002292633056640625,
0.0251617431640625,
-0.0034542083740234375,
-0.0430908203125,
0.0109710693359375,
0.028411865234375,
0.00356292724609375,
-0.0221710205078125,
0.0044708251953125,
0.00952911376953125,
-0.040557861328125,
-0.002048492431640625,
0.019989013671875,
0.01419830322265625,
0.019439697265625,
0.007083892822265625,
0.01471710205078125,
-0.00670623779296875,
0.006771087646484375,
0.035980224609375,
0.0281982421875,
-0.0167388916015625,
-0.023406982421875,
0.0158233642578125,
-0.0159759521484375,
-0.044158935546875,
-0.034027099609375,
-0.0174560546875,
-0.035797119140625,
0.0361328125,
-0.0255126953125,
0.04022216796875,
0.05157470703125,
0.0065460205078125,
-0.03338623046875,
0.036041259765625,
0.018646240234375,
-0.0226593017578125,
0.015960693359375,
0.035247802734375,
0.0179443359375,
0.007801055908203125,
0.01033782958984375,
0.052276611328125,
-0.0023517608642578125,
-0.038299560546875,
-0.001422882080078125,
-0.01373291015625,
-0.0723876953125,
-0.00397491455078125,
0.079833984375,
0.035369873046875,
0.06494140625,
0.01490020751953125,
-0.002777099609375,
0.10186767578125,
0.0243377685546875,
0.041015625,
-0.03900146484375,
0.0570068359375,
0.08367919921875,
-0.01641845703125,
-0.00946807861328125,
0.0177001953125,
-0.043609619140625,
0.02001953125,
0.0294647216796875,
-0.04437255859375,
0.0005750656127929688,
0.0268707275390625,
-0.033447265625,
0.0100250244140625,
-0.00994110107421875,
0.0174102783203125,
-0.0254364013671875,
0.04107666015625,
-0.00476837158203125,
0.015045166015625,
0.005550384521484375,
-0.03472900390625,
0.032379150390625,
0.01309967041015625,
-0.04266357421875,
0.019439697265625,
0.03448486328125,
0.029937744140625,
0.049652099609375,
-0.0115814208984375,
-0.060028076171875,
0.052093505859375,
0.05242919921875,
-0.030853271484375,
0.0215301513671875,
-0.00496673583984375,
-0.0139007568359375,
-0.0052337646484375,
-0.01102447509765625,
-0.0078887939453125,
-0.046417236328125,
-0.034637451171875,
-0.017822265625,
-0.01450347900390625,
0.06365966796875,
-0.0230865478515625,
0.043060302734375,
0.007793426513671875,
0.004364013671875,
0.07061767578125,
-0.04217529296875,
0.0369873046875,
-0.03662109375,
0.0179290771484375,
0.037353515625,
-0.01116943359375,
-0.03265380859375,
-0.0018587112426757812,
0.038482666015625,
0.0316162109375,
-0.0019283294677734375,
-0.0191192626953125,
-0.016754150390625,
-0.05419921875,
-0.06646728515625,
0.03399658203125,
0.0214385986328125,
0.0113983154296875,
-0.032684326171875,
-0.007808685302734375,
0.022308349609375,
-0.0452880859375,
-0.030975341796875,
0.016937255859375,
-0.01116943359375,
0.00743865966796875,
-0.0197601318359375,
0.00447845458984375,
-0.02435302734375,
-0.0234527587890625,
-0.007480621337890625,
0.006435394287109375,
-0.055267333984375,
-0.08599853515625,
-0.0728759765625,
-0.06536865234375,
0.0157470703125,
-0.01380157470703125,
0.0104217529296875,
0.01166534423828125,
0.0162506103515625,
0.00923919677734375,
-0.048980712890625,
0.036376953125,
0.0179901123046875,
0.0026683807373046875,
0.0357666015625,
-0.01666259765625,
0.01238250732421875,
-0.00279998779296875,
0.01513671875,
0.0012578964233398438,
-0.0002911090850830078,
-0.01232147216796875,
-0.034515380859375,
-0.034210205078125,
0.00521087646484375,
-0.01531219482421875,
-0.0215606689453125,
0.036041259765625,
0.01036834716796875,
-0.034942626953125,
-0.0372314453125,
0.02471923828125,
0.006130218505859375,
0.00492095947265625,
0.0152435302734375,
-0.01097869873046875,
-0.02886962890625,
-0.0004930496215820312,
0.00615692138671875,
0.0227813720703125,
0.01348876953125,
0.0498046875,
0.0018939971923828125,
-0.0229644775390625,
-0.01157379150390625,
-0.031585693359375,
-0.041290283203125,
0.01194000244140625,
-0.055511474609375,
0.007110595703125,
-0.01247406005859375,
-0.04986572265625,
-0.01409149169921875,
-0.0127410888671875,
0.0037441253662109375,
-0.02069091796875,
0.033050537109375,
-0.00719451904296875,
0.0374755859375,
-0.0300140380859375,
-0.0205230712890625,
-0.022613525390625,
0.07421875,
-0.08160400390625,
0.007572174072265625,
0.046417236328125,
0.0008397102355957031,
-0.0011196136474609375,
0.021820068359375,
-0.1265869140625,
-0.0216217041015625,
-0.058258056640625,
0.01076507568359375,
-0.019439697265625,
-0.0150909423828125,
-0.0159912109375,
-0.005474090576171875,
-0.022186279296875,
-0.04156494140625,
0.03466796875,
-0.01535797119140625,
0.0277252197265625,
-0.01568603515625,
0.00789642333984375,
-0.040618896484375,
-0.0239715576171875,
-0.01617431640625,
-0.03765869140625,
-0.0115203857421875,
-0.047149658203125,
0.0545654296875,
0.045867919921875,
-0.033203125,
0.00485992431640625,
0.042510986328125,
-0.0017366409301757812,
0.0308685302734375,
-0.003997802734375,
0.0010251998901367188,
-0.0031032562255859375,
-0.0108795166015625,
0.007537841796875,
-0.01132965087890625,
-0.037384033203125,
-0.028656005859375,
-0.01114654541015625,
0.05242919921875,
0.005298614501953125,
0.0078582763671875,
0.00567626953125,
-0.0022640228271484375,
0.0173187255859375,
-0.016357421875,
-0.01160430908203125,
0.0031795501708984375,
-0.00997161865234375,
-0.0036907196044921875,
-0.0207977294921875,
0.021514892578125,
0.027252197265625,
-0.0011806488037109375,
-0.0236663818359375,
0.00534820556640625,
0.05706787109375,
0.027587890625,
-0.0133514404296875,
-0.0189056396484375,
0.0052947998046875,
0.0293731689453125,
0.0247955322265625,
0.05255126953125,
0.0285797119140625,
-0.01910400390625,
0.053924560546875,
0.009613037109375,
0.01092529296875,
-0.0036487579345703125,
0.0244903564453125,
-0.0252838134765625,
-0.061065673828125,
0.050445556640625,
-0.0182342529296875,
-0.01392364501953125,
0.01404571533203125,
-0.0125274658203125,
0.0017757415771484375,
-0.02386474609375,
0.05426025390625,
0.018341064453125,
-0.0211639404296875,
-0.08013916015625,
-0.02655029296875,
0.0074615478515625,
-0.01403045654296875,
-0.0101165771484375,
0.0112152099609375,
-0.01177215576171875,
-0.018218994140625,
-0.01213836669921875,
-0.006732940673828125,
0.05859375,
0.01526641845703125,
0.003452301025390625,
0.03033447265625,
0.043548583984375,
-0.01314544677734375,
0.018402099609375,
-0.0010051727294921875,
0.022308349609375,
0.0214080810546875,
-0.0267486572265625,
-0.0289306640625,
0.019500732421875,
0.005168914794921875,
0.0028591156005859375,
0.007053375244140625,
0.0033092498779296875,
-0.0251922607421875,
-0.010009765625,
0.0097808837890625,
0.02252197265625,
-0.058349609375,
-0.01326751708984375,
-0.042999267578125,
-0.0168914794921875,
-0.025787353515625,
0.055145263671875,
-0.030303955078125,
-0.013153076171875,
-0.0007262229919433594,
-0.02093505859375,
0.06402587890625,
0.071044921875,
0.0052337646484375,
0.0171356201171875,
-0.0123291015625,
-0.01160430908203125,
-0.0310516357421875,
-0.0171966552734375,
-0.052154541015625,
-0.0213775634765625,
0.026641845703125,
0.061737060546875,
-0.021514892578125,
-0.01430511474609375,
0.0228424072265625,
-0.0245513916015625,
-0.01435089111328125,
0.0118865966796875,
-0.031005859375,
-0.01288604736328125,
-0.0154266357421875,
-0.022979736328125,
0.0160980224609375,
0.00424957275390625,
-0.01090240478515625,
0.033599853515625,
-0.010894775390625,
0.0194244384765625,
0.019775390625,
-0.050384521484375,
0.00029754638671875,
0.0269927978515625,
-0.076171875,
-0.0200653076171875,
0.00890350341796875,
-0.036346435546875,
-0.0206146240234375,
0.0002994537353515625,
-0.0164947509765625,
-0.0059051513671875,
-0.0010900497436523438,
0.007167816162109375,
-0.013763427734375,
-0.0092010498046875,
-0.059478759765625,
-0.0030689239501953125,
0.029022216796875,
0.018646240234375,
-0.0557861328125,
-0.00954437255859375,
-0.0733642578125,
-0.0144805908203125,
-0.039947509765625,
-0.0165557861328125,
-0.0450439453125,
0.00485992431640625,
-0.0018053054809570312,
0.01873779296875,
-0.029937744140625,
-0.050628662109375,
-0.031219482421875,
0.023773193359375,
0.047760009765625,
0.0284881591796875,
0.02728271484375,
-0.00504302978515625,
-0.021392822265625,
0.046295166015625,
0.0139923095703125,
-0.0259857177734375,
-0.0237579345703125,
-0.045135498046875,
0.0158538818359375,
0.0239410400390625,
-0.01171875,
-0.0094146728515625,
0.006206512451171875,
-0.0243072509765625,
0.060211181640625,
-0.006641387939453125,
0.03564453125,
0.01141357421875,
0.002460479736328125,
0.0106658935546875,
0.0246429443359375,
0.0165252685546875,
0.0293731689453125,
0.06317138671875,
-0.01715087890625,
-0.005916595458984375,
-0.0129547119140625,
0.024200439453125,
0.00630950927734375,
-0.01702880859375,
0.001251220703125,
-0.0003540515899658203,
-0.02691650390625,
0.03045654296875,
0.06463623046875,
0.00738525390625,
0.048095703125,
0.035430908203125,
0.017425537109375,
0.03155517578125,
0.061187744140625,
-0.053466796875,
-0.076416015625,
0.058258056640625,
0.042327880859375,
-0.04534912109375,
0.05126953125,
-0.042816162109375,
0.0084686279296875,
0.0236968994140625,
0.04351806640625,
-0.05560302734375,
-0.0021266937255859375,
0.00662994384765625,
-0.01018524169921875,
0.00992584228515625,
-0.011505126953125,
0.01471710205078125,
-0.0037689208984375,
0.0178375244140625,
0.055755615234375,
-0.0184173583984375,
0.0157928466796875,
0.016571044921875,
-0.0066070556640625,
0.0103607177734375,
0.019317626953125,
0.00844573974609375,
-0.055694580078125,
0.037353515625,
0.033660888671875,
0.0220489501953125,
-0.033477783203125,
0.0015726089477539062,
0.0029582977294921875,
-0.0080718994140625,
-0.0119476318359375,
0.0576171875,
-0.0145111083984375,
0.0183563232421875,
-0.0140533447265625,
0.0218658447265625,
-0.0176239013671875,
-0.01216888427734375,
-0.0014734268188476562,
-0.03466796875,
-0.01348876953125,
-0.041473388671875,
-0.0259246826171875,
0.00013935565948486328,
0.0226898193359375,
0.003078460693359375,
0.017913818359375,
0.0219879150390625,
-0.005702972412109375,
-0.04327392578125,
0.00588226318359375,
-0.01155853271484375,
0.039093017578125,
-0.056549072265625,
0.0189971923828125,
0.06329345703125,
0.020111083984375,
-0.0261077880859375,
-0.0299530029296875,
0.03094482421875,
-0.05194091796875,
0.023651123046875,
-0.0124359130859375,
0.0438232421875,
0.00897979736328125,
-0.0062255859375,
-0.048187255859375,
0.072021484375,
0.01263427734375,
0.0179443359375,
0.0241851806640625,
0.0206756591796875,
-0.038055419921875,
-0.020477294921875,
-0.03778076171875,
0.0887451171875,
-0.030792236328125,
0.04705810546875,
-0.07745361328125,
-0.0180206298828125,
0.029205322265625,
0.0290985107421875,
0.012542724609375,
0.014373779296875,
-0.025238037109375,
0.0035610198974609375,
0.02362060546875,
-0.006885528564453125,
-0.0127716064453125,
0.055389404296875,
0.00986480712890625,
0.0125274658203125,
0.02618408203125,
-0.015869140625,
0.048431396484375,
-0.03729248046875,
-0.013397216796875,
0.0204010009765625,
0.0084075927734375,
-0.02752685546875,
0.0178680419921875,
0.015167236328125,
-0.04132080078125,
0.0115203857421875,
0.0247039794921875,
0.031524658203125,
-0.0007719993591308594,
0.04644775390625,
0.045074462890625,
-0.053558349609375,
-0.0311737060546875,
-0.031707763671875,
0.056549072265625,
-0.00612640380859375,
0.016815185546875,
0.0244140625,
0.01012420654296875,
0.01033782958984375,
0.010589599609375,
0.0188140869140625,
0.01105499267578125,
-0.01812744140625,
0.0036258697509765625,
-0.021453857421875,
0.021209716796875,
-0.0765380859375,
-0.07061767578125,
0.01052093505859375,
0.029449462890625,
0.011322021484375,
-0.0487060546875,
0.0030994415283203125,
0.02093505859375,
0.035797119140625,
0.00638580322265625,
0.04388427734375,
-0.0304718017578125,
0.034332275390625,
-0.019287109375,
-0.018524169921875,
-0.006336212158203125,
-0.0034465789794921875,
-0.0168304443359375,
-0.0297393798828125,
0.035614013671875,
-0.0008511543273925781,
-0.00870513916015625,
-0.0067901611328125,
0.03515625,
0.03753662109375,
0.00487518310546875,
0.058563232421875,
-0.0183258056640625,
-0.024932861328125,
-0.00029015541076660156,
0.00801849365234375,
-0.00225830078125,
-0.0008797645568847656,
-0.0095977783203125,
-0.0192718505859375,
0.021484375,
0.01451873779296875,
-0.0143280029296875,
-0.002727508544921875,
0.0430908203125,
0.06536865234375,
-0.018798828125,
-0.031768798828125,
-0.00009578466415405273,
-0.01549530029296875,
-0.0006818771362304688,
-0.0406494140625,
0.01410675048828125,
0.00788116455078125,
-0.009185791015625,
-0.00919342041015625,
-0.0168609619140625,
0.0312042236328125,
-0.0239715576171875,
0.017913818359375,
0.0032520294189453125,
-0.035369873046875,
0.0015058517456054688,
-0.038848876953125,
0.0248260498046875,
-0.00862884521484375,
-0.04217529296875,
0.017303466796875,
-0.0015020370483398438,
-0.0145111083984375,
-0.006908416748046875,
0.0159912109375,
-0.04736328125,
0.060882568359375,
-0.013031005859375,
-0.0096588134765625,
0.0293731689453125,
-0.02593994140625,
0.004535675048828125,
0.0034332275390625,
0.003955841064453125,
-0.01495361328125,
-0.0814208984375,
-0.053558349609375,
-0.040618896484375,
0.0712890625,
-0.01165008544921875,
0.1353759765625,
-0.052734375,
0.0242919921875,
-0.04473876953125,
-0.0076904296875,
-0.0232696533203125,
-0.030303955078125,
0.00612640380859375,
0.02960205078125,
0.008819580078125,
0.0066986083984375,
-0.047027587890625,
0.00453948974609375,
0.00655364990234375,
-0.016021728515625,
-0.00731658935546875,
-0.047576904296875,
0.029327392578125,
0.0255889892578125,
0.00499725341796875,
-0.0019502639770507812,
-0.0017852783203125,
0.017364501953125,
0.00438690185546875,
0.035369873046875,
0.03497314453125,
0.014312744140625,
0.01308441162109375,
0.006320953369140625,
-0.01328277587890625,
-0.00240325927734375,
0.0096282958984375,
-0.01300811767578125,
0.0198211669921875,
-0.0010471343994140625,
-0.01471710205078125,
0.0513916015625,
-0.009735107421875,
0.01383209228515625,
0.01513671875,
0.04730224609375,
0.018402099609375,
-0.03973388671875,
0.06463623046875,
-0.0004398822784423828,
0.04608154296875,
-0.019805908203125,
-0.00957489013671875,
0.00024199485778808594,
0.03704833984375,
0.01018524169921875,
-0.0033130645751953125,
-0.017486572265625,
-0.055511474609375,
0.005725860595703125,
0.01221466064453125,
-0.0300140380859375,
-0.018096923828125,
-0.01898193359375,
-0.021392822265625,
0.0114898681640625,
-0.006591796875,
-0.0185089111328125,
0.00043463706970214844,
0.01387786865234375,
-0.01568603515625,
-0.00399017333984375,
0.0706787109375,
-0.01934814453125,
-0.00963592529296875,
-0.0694580078125,
-0.0275726318359375,
-0.00901031494140625,
0.04754638671875,
-0.012298583984375,
0.0718994140625,
0.0794677734375,
-0.044921875,
-0.023040771484375,
0.0677490234375,
0.039306640625,
0.128662109375,
-0.006317138671875,
0.0020580291748046875,
0.026153564453125,
0.0175323486328125,
-0.049896240234375,
-0.054168701171875,
0.00798797607421875,
-0.022674560546875,
-0.0159149169921875,
-0.037628173828125,
0.00942230224609375,
0.0341796875,
-0.046630859375,
-0.095703125,
0.04571533203125,
-0.042327880859375,
-0.0311126708984375,
0.002838134765625,
0.0191802978515625,
0.0196990966796875,
-0.0377197265625,
-0.003055572509765625,
0.0051116943359375,
-0.01465606689453125,
-0.021087646484375,
-0.0281524658203125,
0.058441162109375,
-0.0018825531005859375,
-0.044219970703125,
0.008697509765625,
-0.00711822509765625,
0.0089111328125,
-0.01122283935546875,
-0.037872314453125,
0.033782958984375,
-0.00855255126953125,
0.033111572265625,
-0.007534027099609375,
-0.0307159423828125,
0.00844573974609375,
-0.01375579833984375,
-0.037200927734375,
0.01311492919921875,
-0.0113067626953125,
0.0167694091796875,
0.08135986328125,
0.07177734375,
0.0178985595703125,
-0.040679931640625,
-0.004367828369140625,
-0.01496124267578125,
-0.0024929046630859375,
-0.032623291015625,
0.0172882080078125,
-0.08099365234375,
-0.0357666015625,
0.00750732421875,
-0.01910400390625,
-0.0287933349609375,
-0.0058441162109375,
-0.0310211181640625,
-0.00559234619140625,
0.01161956787109375,
-0.013031005859375,
0.05517578125,
-0.057830810546875,
0.03717041015625,
-0.0026073455810546875,
0.04534912109375,
-0.01297760009765625,
0.041595458984375,
0.055694580078125,
0.05242919921875,
0.01552581787109375,
0.0070953369140625,
-0.049530029296875,
0.0328369140625,
0.007381439208984375,
0.03582763671875,
-0.040863037109375,
-0.0291748046875,
-0.0213470458984375,
0.0102996826171875,
-0.0168304443359375,
0.004001617431640625,
0.0261077880859375,
0.020904541015625,
0.00931549072265625,
0.050201416015625,
0.0034542083740234375,
-0.0595703125,
-0.020263671875,
0.0269775390625,
-0.002532958984375,
-0.0216827392578125,
0.020477294921875,
-0.04498291015625,
-0.0023326873779296875,
-0.004276275634765625,
-0.0221099853515625,
-0.060333251953125,
0.01168060302734375,
-0.0237274169921875,
0.002651214599609375,
0.0190582275390625
] |
cde560af5808355d15a73eb325bbec07ad1b6566
|
Wordpress Stackexchange
Q: Resizing the width of the WYSIWYG editor Just a simple question here but though my googling and searching efforts haven't found the answer to it. I'm wanting to re-size the width of my WordPress WYSIWYG editor to be 650px. What do I have to type into functions.php to get this effect?
I found this but it didn't do anything
add_action('admin_print_styles-edit.php','increase_textarea_css');
add_action('admin_print_styles-post-new.php','increase_textarea_css');
function increase_textarea_css() {
?>
<style type="text/css">
textarea#content { width:650px!important; }
</style>
<?php
}
A: The WYSIWYG uses the .wp-editor-container class. So the easiest way would be to change this in your CSS. If your style is being overwritten then just add !important.
.wp-editor-container {
width:50%; // What ever size you want
}
the wp_editor() function also allows us to add a class to the textarea tag, I'm not sure if this might help you. Here's how though:
<?php wp_editor( $content, $editor_id, $settings = array( 'editor_class'=>'yourclass' ) ); ?>
You can take a look at the documentation here: wp_editor - Codex
|
Q: Resizing the width of the WYSIWYG editor Just a simple question here but though my googling and searching efforts haven't found the answer to it. I'm wanting to re-size the width of my WordPress WYSIWYG editor to be 650px. What do I have to type into functions.php to get this effect?
I found this but it didn't do anything
add_action('admin_print_styles-edit.php','increase_textarea_css');
add_action('admin_print_styles-post-new.php','increase_textarea_css');
function increase_textarea_css() {
?>
<style type="text/css">
textarea#content { width:650px!important; }
</style>
<?php
}
A: The WYSIWYG uses the .wp-editor-container class. So the easiest way would be to change this in your CSS. If your style is being overwritten then just add !important.
.wp-editor-container {
width:50%; // What ever size you want
}
the wp_editor() function also allows us to add a class to the textarea tag, I'm not sure if this might help you. Here's how though:
<?php wp_editor( $content, $editor_id, $settings = array( 'editor_class'=>'yourclass' ) ); ?>
You can take a look at the documentation here: wp_editor - Codex
A: #post-body-content it is.
I did not have to use any !important:
#post-body-content {
width:50%;
}
Note: This belongs into an admin-style.css you use for styling the admin area in general.
(not any possible editor-style.css you might have to style the inertia of the tinymce iframe). This is how to include the css in functions.php:
function add_admin_style() {
echo '<link rel="stylesheet" type="text/css"
href="'.get_bloginfo('template_url').'/admin-style.css">'; //adjust your path
}
add_action('admin_head', 'add_admin_style');
Going 'further down' in the DOM tree for styling would leave higher level blocks 'oversized'. That is also true (hence: a bad approach), if you went for the respective tinyMCE option:
function config_tinyMce($init) {
$init['width'] = '620';
return $init;
}
add_filter('tiny_mce_before_init', 'config_tinyMce' );
If you want a particular inner editor width (in an ideal world to have identical line wrapping between editor and a fixed-column live for instance), well
*
*either 'do the math', so keep adjusting the (outer) width value above, until the inner width fits (might still vary a bit from browser to browser
for different scroll bar widths etc.
*or make it 10-20px oversized (by the means above), and do the precise finetuning then with the tinyMCE config filter.
update:
Well, maybe do the enitre math with the tiny_mce_config option, leaving #post-body-content alone. Sure, in WYSIWYG view it's nice, if the outer box isn't much bigger than actual column width. In plain HTML view however one makes his live unnecessarily harder by not being able to see longer lines of code at once.
|
wordpress
|
{
"language": "en",
"length": 407,
"provenance": "stackexchange_00019.jsonl.gz:420663",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54636"
}
|
[
-0.05731201171875,
-0.03887939453125,
-0.0574951171875,
0.0703125,
-0.053955078125,
-0.06024169921875,
0.0273895263671875,
-0.0080718994140625,
-0.0143280029296875,
0.037017822265625,
-0.01343536376953125,
0.020263671875,
-0.032928466796875,
-0.0051116943359375,
-0.0291290283203125,
-0.024383544921875,
0.043426513671875,
-0.034271240234375,
0.01476287841796875,
-0.006740570068359375,
0.0258941650390625,
0.0170440673828125,
-0.002185821533203125,
0.0477294921875,
-0.0144195556640625,
0.006298065185546875,
0.1351318359375,
-0.0340576171875,
-0.005382537841796875,
-0.035552978515625,
0.01212310791015625,
-0.0037994384765625,
0.0189971923828125,
0.033966064453125,
-0.046875,
-0.006786346435546875,
0.0275115966796875,
-0.006195068359375,
-0.00971221923828125,
0.0305328369140625,
0.0244140625,
0.001125335693359375,
0.0093994140625,
0.00803375244140625,
-0.008087158203125,
-0.052581787109375,
0.0599365234375,
-0.036163330078125,
0.0221710205078125,
-0.045318603515625,
0.0017871856689453125,
0.03668212890625,
0.0350341796875,
-0.045135498046875,
-0.0310821533203125,
0.006168365478515625,
-0.034912109375,
0.0167388916015625,
0.0191192626953125,
0.0106353759765625,
0.0108795166015625,
0.013427734375,
0.0051422119140625,
0.0261077880859375,
-0.059814453125,
0.00556182861328125,
-0.01285552978515625,
-0.01751708984375,
-0.00916290283203125,
-0.05218505859375,
0.0090179443359375,
-0.005096435546875,
-0.0025768280029296875,
-0.05108642578125,
-0.009185791015625,
0.0296478271484375,
0.0165557861328125,
-0.0153961181640625,
-0.0005655288696289062,
-0.016204833984375,
0.01068115234375,
0.00543975830078125,
-0.0010404586791992188,
-0.0232086181640625,
0.0013713836669921875,
0.0033855438232421875,
-0.01457977294921875,
-0.01129150390625,
-0.01502227783203125,
-0.015289306640625,
-0.01146697998046875,
-0.0239715576171875,
-0.0250701904296875,
0.0287017822265625,
0.002044677734375,
-0.0345458984375,
0.0144500732421875,
-0.01230621337890625,
-0.006946563720703125,
-0.002079010009765625,
0.065673828125,
-0.07763671875,
0.08966064453125,
-0.0236358642578125,
0.0084991455078125,
0.039642333984375,
-0.0240325927734375,
0.0252685546875,
0.05419921875,
0.02801513671875,
0.0250396728515625,
-0.00905609130859375,
-0.0232696533203125,
0.00374603271484375,
-0.016510009765625,
0.0036067962646484375,
-0.045440673828125,
0.004962921142578125,
-0.0169525146484375,
0.0026454925537109375,
-0.006084442138671875,
0.0021648406982421875,
0.0162811279296875,
-0.004619598388671875,
0.0335693359375,
0.0207366943359375,
-0.0036468505859375,
-0.0266876220703125,
0.014251708984375,
0.0075225830078125,
-0.04266357421875,
0.0222015380859375,
0.046600341796875,
0.0233001708984375,
0.0164642333984375,
-0.0167236328125,
0.03466796875,
-0.0189208984375,
-0.0203399658203125,
0.0191192626953125,
-0.054779052734375,
0.01491546630859375,
0.04541015625,
-0.06365966796875,
0.0125885009765625,
0.006500244140625,
0.03216552734375,
0.0220947265625,
-0.01242828369140625,
-0.069580078125,
0.0499267578125,
0.0135955810546875,
0.0457763671875,
0.028839111328125,
-0.01555633544921875,
-0.005260467529296875,
0.08477783203125,
-0.035247802734375,
-0.059478759765625,
-0.07672119140625,
-0.00647735595703125,
0.028045654296875,
0.0662841796875,
-0.04693603515625,
-0.01788330078125,
-0.054595947265625,
-0.054443359375,
-0.00131988525390625,
0.0300140380859375,
-0.038421630859375,
0.02130126953125,
0.0070953369140625,
0.061981201171875,
0.011962890625,
-0.00699615478515625,
0.0204010009765625,
0.01378631591796875,
-0.0302276611328125,
0.031341552734375,
0.0176849365234375,
0.004207611083984375,
-0.00157928466796875,
0.056427001953125,
-0.02142333984375,
0.012847900390625,
-0.057464599609375,
-0.01291656494140625,
-0.032196044921875,
0.036590576171875,
0.0278167724609375,
-0.04486083984375,
-0.009552001953125,
0.004913330078125,
-0.0174560546875,
-0.0231170654296875,
0.002414703369140625,
-0.0186920166015625,
0.031646728515625,
-0.02117919921875,
0.005550384521484375,
0.047149658203125,
-0.00894927978515625,
0.0251007080078125,
-0.046234130859375,
-0.096923828125,
0.03314208984375,
-0.0360107421875,
0.05767822265625,
0.01995849609375,
0.0207977294921875,
-0.0010881423950195312,
0.005496978759765625,
-0.01445770263671875,
-0.0338134765625,
-0.049224853515625,
0.0055389404296875,
-0.0081939697265625,
0.036712646484375,
0.01532745361328125,
0.0189361572265625,
0.017242431640625,
-0.016357421875,
0.0174560546875,
-0.003757476806640625,
0.01245880126953125,
-0.051116943359375,
-0.008087158203125,
-0.03192138671875,
0.01184844970703125,
-0.03350830078125,
0.0149383544921875,
0.05133056640625,
0.03399658203125,
0.058685302734375,
-0.01812744140625,
-0.0196075439453125,
-0.0185699462890625,
-0.047607421875,
0.012908935546875,
0.0379638671875,
0.03863525390625,
0.01236724853515625,
-0.0296478271484375,
-0.01381683349609375,
0.047454833984375,
0.006511688232421875,
0.0267486572265625,
-0.0196533203125,
-0.002532958984375,
0.00415802001953125,
0.00868988037109375,
-0.0275115966796875,
0.029693603515625,
-0.031097412109375,
0.00002676248550415039,
0.043212890625,
-0.007297515869140625,
0.01934814453125,
-0.004436492919921875,
0.04339599609375,
-0.0225830078125,
0.01560211181640625,
0.035675048828125,
-0.024505615234375,
-0.007793426513671875,
0.011444091796875,
0.011474609375,
0.01953125,
-0.031982421875,
0.00739288330078125,
0.024871826171875,
0.0282135009765625,
0.01025390625,
0.0172271728515625,
-0.0220489501953125,
-0.0229644775390625,
-0.035797119140625,
0.009307861328125,
0.0270233154296875,
-0.00984954833984375,
-0.0205535888671875,
0.0350341796875,
-0.03466796875,
-0.01461029052734375,
-0.0173492431640625,
-0.0379638671875,
0.00241851806640625,
-0.000050067901611328125,
0.00803375244140625,
-0.00971221923828125,
-0.003192901611328125,
0.05828857421875,
-0.006847381591796875,
0.051239013671875,
0.025665283203125,
-0.004589080810546875,
0.071533203125,
-0.0006222724914550781,
0.032745361328125,
0.0066986083984375,
0.06439208984375,
0.046783447265625,
-0.0222625732421875,
0.0160675048828125,
-0.0012235641479492188,
-0.02691650390625,
-0.021270751953125,
0.005443572998046875,
-0.0142364501953125,
-0.003147125244140625,
-0.06451416015625,
0.0321044921875,
0.0185394287109375,
0.00667572021484375,
-0.00605010986328125,
-0.046539306640625,
-0.0233917236328125,
0.02581787109375,
-0.039703369140625,
0.0215911865234375,
-0.03497314453125,
-0.147705078125,
-0.007259368896484375,
-0.00977325439453125,
-0.0882568359375,
0.01739501953125,
0.048980712890625,
0.016082763671875,
0.0341796875,
-0.0212554931640625,
-0.01499176025390625,
-0.0189971923828125,
-0.046722412109375,
-0.0357666015625,
0.00878143310546875,
-0.0213165283203125,
0.015350341796875,
0.011199951171875,
0.006195068359375,
-0.023193359375,
0.0099029541015625,
-0.00933074951171875,
-0.022247314453125,
-0.0063018798828125,
0.0201263427734375,
-0.009857177734375,
-0.03326416015625,
0.00824737548828125,
0.0350341796875,
0.035888671875,
-0.050750732421875,
0.0013666152954101562,
0.00580596923828125,
-0.0298004150390625,
0.03094482421875,
-0.0062103271484375,
-0.025604248046875,
-0.041229248046875,
0.0206451416015625,
-0.0736083984375,
0.0355224609375,
-0.00728607177734375,
-0.0077667236328125,
0.012451171875,
-0.037689208984375,
-0.01126861572265625,
0.036529541015625,
0.0012989044189453125,
-0.00951385498046875,
0.0478515625,
0.0288543701171875,
-0.007198333740234375,
0.063720703125,
-0.0277862548828125,
-0.05084228515625,
-0.037567138671875,
-0.00464630126953125,
-0.032562255859375,
0.024993896484375,
-0.018524169921875,
-0.0150146484375,
-0.006572723388671875,
-0.010467529296875,
-0.008636474609375,
-0.0653076171875,
0.06732177734375,
-0.011871337890625,
-0.01551055908203125,
-0.0301971435546875,
-0.03814697265625,
0.0108795166015625,
0.08929443359375,
-0.04473876953125,
-0.037689208984375,
0.023223876953125,
0.038330078125,
-0.085693359375,
-0.053619384765625,
-0.015960693359375,
0.01226043701171875,
-0.054443359375,
0.03350830078125,
0.0268402099609375,
-0.034881591796875,
-0.042938232421875,
0.06488037109375,
-0.07476806640625,
-0.0083465576171875,
0.016754150390625,
-0.0211944580078125,
-0.0184783935546875,
0.05279541015625,
-0.0193328857421875,
0.02813720703125,
-0.00789642333984375,
-0.0406494140625,
-0.09283447265625,
-0.014068603515625,
-0.045745849609375,
0.097412109375,
0.03106689453125,
-0.0079345703125,
-0.0230712890625,
0.04864501953125,
0.015045166015625,
-0.0312347412109375,
0.04608154296875,
0.01641845703125,
-0.041290283203125,
0.0212860107421875,
0.04217529296875,
-0.045135498046875,
0.0159759521484375,
0.01351165771484375,
-0.05560302734375,
0.02081298828125,
-0.05352783203125,
-0.03253173828125,
-0.0038776397705078125,
-0.03607177734375,
-0.0330810546875,
-0.0090179443359375,
-0.05487060546875,
0.0277557373046875,
-0.044677734375,
0.0009007453918457031,
-0.0204620361328125,
-0.07305908203125,
0.04974365234375,
0.030059814453125,
-0.021270751953125,
-0.00922393798828125,
0.0472412109375,
0.01392364501953125,
-0.03790283203125,
-0.0218505859375,
-0.004543304443359375,
0.037445068359375,
0.043792724609375,
0.0088958740234375,
0.00830078125,
-0.0254364013671875,
0.0265350341796875,
0.03369140625,
0.01470947265625,
-0.0173797607421875,
0.045745849609375,
-0.014190673828125,
-0.02239990234375,
0.03076171875,
-0.0236358642578125,
0.0078277587890625,
0.0052032470703125,
0.0238037109375,
-0.0343017578125,
0.0477294921875,
0.0099029541015625,
-0.004253387451171875,
0.0210113525390625,
0.016510009765625,
-0.0247039794921875,
-0.01262664794921875,
0.01354217529296875,
0.0266265869140625,
0.01479339599609375,
0.005710601806640625,
0.00327301025390625,
0.04901123046875,
-0.00699615478515625,
0.0250701904296875,
0.0128936767578125,
0.010711669921875,
0.0293731689453125,
0.024871826171875,
-0.007595062255859375,
0.002605438232421875,
0.00994110107421875,
-0.0209808349609375,
-0.0009555816650390625,
-0.0325927734375,
-0.0655517578125,
0.0228729248046875,
-0.0009531974792480469,
-0.006587982177734375,
-0.041107177734375,
0.031158447265625,
0.0264739990234375,
-0.035430908203125,
0.020263671875,
-0.030029296875,
-0.035064697265625,
-0.035247802734375,
0.01404571533203125,
-0.0139312744140625,
-0.00499725341796875,
0.051055908203125,
-0.004306793212890625,
0.0019626617431640625,
0.03167724609375,
-0.0198974609375,
0.0217437744140625,
0.018585205078125,
0.0141754150390625,
0.0174407958984375,
0.0187835693359375,
0.007293701171875,
-0.0272674560546875,
-0.0012264251708984375,
-0.00800323486328125,
-0.01300811767578125,
0.027130126953125,
0.00652313232421875,
0.005077362060546875,
0.00820159912109375,
0.011138916015625,
0.00736236572265625,
0.0005564689636230469,
0.006702423095703125,
0.0008883476257324219,
-0.042266845703125,
0.01580810546875,
0.047332763671875,
0.004329681396484375,
-0.01422882080078125,
-0.0107879638671875,
-0.006206512451171875,
-0.036834716796875,
-0.0082550048828125,
0.006580352783203125,
-0.03973388671875,
-0.00791168212890625,
-0.0174713134765625,
-0.03955078125,
0.0018062591552734375,
0.0013751983642578125,
-0.048736572265625,
-0.069091796875,
0.0183258056640625,
-0.006683349609375,
0.0380859375,
-0.0205230712890625,
0.00608062744140625,
-0.0251922607421875,
-0.00014019012451171875,
-0.048553466796875,
0.01541900634765625,
0.0005817413330078125,
-0.00493621826171875,
0.0194244384765625,
0.003284454345703125,
-0.01409149169921875,
-0.027679443359375,
-0.00782012939453125,
-0.028472900390625,
-0.0238189697265625,
-0.04046630859375,
-0.01255035400390625,
0.0018854141235351562,
-0.00319671630859375,
0.0007719993591308594,
-0.02783203125,
0.059661865234375,
0.01690673828125,
0.046112060546875,
-0.0172882080078125,
0.043487548828125,
-0.01308441162109375,
0.030120849609375,
-0.021331787109375,
-0.0159454345703125,
-0.008270263671875,
-0.002658843994140625,
0.03240966796875,
0.0248870849609375,
-0.051300048828125,
-0.02398681640625,
-0.011688232421875,
-0.0257720947265625,
0.038238525390625,
-0.0239105224609375,
0.0010156631469726562,
-0.03277587890625,
-0.016815185546875,
-0.0311737060546875,
0.0482177734375,
-0.0386962890625,
0.004383087158203125,
-0.01287841796875,
-0.0228271484375,
0.048828125,
0.00048613548278808594,
0.0269927978515625,
0.007198333740234375,
-0.041656494140625,
0.016143798828125,
0.021636962890625,
-0.01190185546875,
0.0271148681640625,
0.052093505859375,
0.00689697265625,
0.057891845703125,
0.00595855712890625,
0.0188446044921875,
0.01236724853515625,
-0.015838623046875,
-0.0037364959716796875,
0.037628173828125,
0.030792236328125,
-0.011444091796875,
0.029541015625,
0.01558685302734375,
0.003631591796875,
0.0418701171875,
0.0321044921875,
0.06689453125,
-0.0406494140625,
0.020172119140625,
0.006458282470703125,
-0.042877197265625,
0.05865478515625,
-0.0272064208984375,
0.0002837181091308594,
-0.0241241455078125,
0.07720947265625,
-0.0065765380859375,
-0.0019168853759765625,
0.03594970703125,
-0.0194854736328125,
0.007568359375,
-0.01468658447265625,
0.060760498046875,
0.020263671875,
-0.037322998046875,
0.024444580078125,
0.0204010009765625,
0.051116943359375,
-0.00902557373046875,
0.0291900634765625,
-0.02679443359375,
0.00965118408203125,
-0.0265350341796875,
0.01163482666015625,
-0.009002685546875,
-0.0013742446899414062,
-0.0103607177734375,
0.0090789794921875,
-0.0248260498046875,
0.0347900390625,
-0.0274658203125,
0.005176544189453125,
0.0203094482421875,
-0.0310211181640625,
0.0298309326171875,
-0.017364501953125,
0.02215576171875,
0.009521484375,
-0.056671142578125,
0.0085601806640625,
-0.005462646484375,
-0.020782470703125,
0.01020050048828125,
0.0167694091796875,
0.05841064453125,
-0.02789306640625,
-0.0214385986328125,
0.040435791015625,
-0.0025882720947265625,
-0.01546478271484375,
-0.034637451171875,
-0.0282745361328125,
-0.0662841796875,
-0.011138916015625,
-0.038421630859375,
-0.0509033203125,
0.01024627685546875,
-0.067626953125,
-0.017913818359375,
0.05419921875,
0.0118865966796875,
-0.0215606689453125,
0.031829833984375,
0.037628173828125,
-0.07867431640625,
0.00847625732421875,
0.0304718017578125,
-0.00792694091796875,
-0.0082550048828125,
-0.05712890625,
0.0231781005859375,
0.0140380859375,
-0.0179443359375,
0.019989013671875,
-0.006656646728515625,
0.0003418922424316406,
-0.068115234375,
-0.0121612548828125,
0.046356201171875,
0.046539306640625,
0.034820556640625,
0.055816650390625,
-0.001007080078125,
-0.0260009765625,
-0.01015472412109375,
-0.01224517822265625,
0.0186614990234375,
-0.0257720947265625,
-0.0241851806640625,
0.030914306640625,
-0.01458740234375,
-0.034881591796875,
0.002079010009765625,
0.032318115234375,
-0.01467132568359375,
0.0011663436889648438,
0.01160430908203125,
-0.04693603515625,
0.006397247314453125,
0.032470703125,
0.041961669921875,
-0.047698974609375,
-0.00955963134765625,
-0.03192138671875,
0.034271240234375,
0.0107269287109375,
-0.055816650390625,
-0.031097412109375,
-0.01212310791015625,
0.0279083251953125,
0.00376129150390625,
-0.038482666015625,
0.0609130859375,
0.01404571533203125,
-0.0011234283447265625,
0.005596160888671875,
0.0161285400390625,
-0.0079345703125,
0.0141754150390625,
0.0242767333984375,
0.00333404541015625,
-0.018218994140625,
0.007137298583984375,
0.01146697998046875,
0.021759033203125,
-0.0005974769592285156,
-0.03173828125,
0.0115814208984375,
-0.032440185546875,
-0.00313568115234375,
0.0093994140625,
-0.0093536376953125,
0.021392822265625,
-0.00687408447265625,
0.01323699951171875,
0.0165863037109375,
0.001407623291015625,
0.00787353515625,
-0.052398681640625,
0.001346588134765625,
0.021392822265625,
0.0258941650390625,
0.034820556640625,
0.048675537109375,
0.0599365234375,
-0.005481719970703125,
-0.031585693359375,
0.0207061767578125,
-0.0030269622802734375,
0.018768310546875,
-0.0023288726806640625,
0.0263519287109375,
-0.022369384765625,
0.024993896484375,
-0.0106201171875,
-0.018341064453125,
0.025848388671875,
0.0250244140625,
-0.0538330078125,
-0.0246734619140625,
-0.0019664764404296875,
-0.02056884765625,
0.02032470703125,
-0.01377105712890625,
0.035797119140625,
0.03802490234375,
0.002117156982421875,
-0.032135009765625,
0.0261077880859375,
0.0728759765625,
-0.004364013671875,
-0.0016231536865234375,
0.0187530517578125,
0.00797271728515625,
0.007625579833984375,
0.009124755859375,
-0.04913330078125,
0.04248046875,
-0.0831298828125,
-0.0244598388671875,
-0.01244354248046875,
-0.00475311279296875,
0.0264129638671875,
0.0301666259765625,
-0.0244903564453125,
0.034088134765625,
0.0144805908203125,
-0.031494140625,
0.00539398193359375,
-0.0017547607421875,
0.035491943359375,
0.0208892822265625,
-0.01312255859375,
0.00385284423828125,
-0.05401611328125,
-0.0557861328125,
-0.039703369140625,
0.06610107421875,
0.0246734619140625,
0.06475830078125,
-0.0252838134765625,
0.050079345703125,
0.01971435546875,
-0.00811004638671875,
0.005645751953125,
-0.0274505615234375,
0.05352783203125,
-0.0267181396484375,
-0.01093292236328125,
-0.01457977294921875,
-0.003696441650390625,
0.040252685546875,
0.032012939453125,
-0.041229248046875,
0.0020809173583984375,
0.0164031982421875,
-0.01087188720703125,
-0.023193359375,
0.0091705322265625,
-0.0109405517578125,
-0.01861572265625,
-0.00341033935546875,
0.0214385986328125,
-0.0010833740234375,
0.003253936767578125,
-0.016082763671875,
0.01262664794921875,
0.0268707275390625,
-0.03448486328125,
0.036376953125,
-0.0364990234375,
0.0576171875,
0.040313720703125,
0.00560760498046875,
-0.031585693359375,
-0.0005040168762207031,
-0.00357818603515625,
-0.01404571533203125,
0.033050537109375,
-0.00501251220703125,
0.01074981689453125,
-0.004669189453125,
0.051727294921875,
0.043670654296875,
0.04327392578125,
-0.0205230712890625,
0.00848388671875,
0.053863525390625,
-0.025146484375,
-0.01174163818359375,
-0.00487518310546875,
-0.022979736328125,
-0.0205535888671875,
0.0172271728515625,
0.02801513671875,
0.018280029296875,
-0.006008148193359375,
-0.052825927734375,
-0.003917694091796875,
0.019073486328125,
-0.0011739730834960938,
-0.031524658203125,
0.010986328125,
-0.0076446533203125,
0.0194549560546875,
0.0140380859375,
0.0052642822265625,
-0.007781982421875,
0.0377197265625,
-0.04583740234375,
-0.045257568359375,
-0.053955078125,
0.0207366943359375,
-0.08221435546875,
0.01457977294921875,
0.03997802734375,
-0.0178985595703125,
0.0261077880859375,
-0.01224517822265625,
0.0192718505859375,
0.04266357421875,
-0.023345947265625,
-0.0034770965576171875,
0.062103271484375,
0.003582000732421875,
-0.021240234375,
-0.084716796875,
-0.0482177734375,
-0.017791748046875,
0.06646728515625,
0.017364501953125,
0.0036182403564453125,
0.01152801513671875,
-0.040435791015625,
-0.05316162109375,
-0.035247802734375,
0.01348114013671875,
-0.04266357421875,
0.0237884521484375,
-0.04180908203125,
-0.00833892822265625,
0.005634307861328125,
-0.0003113746643066406,
0.0057373046875,
-0.0126800537109375,
0.0186767578125,
-0.0157318115234375,
0.03192138671875,
0.02978515625,
-0.03839111328125,
-0.0071868896484375,
-0.0158233642578125,
-0.005527496337890625,
-0.020233154296875,
-0.037689208984375,
0.01708984375,
0.0021724700927734375,
0.033447265625,
-0.0131683349609375,
-0.06512451171875,
0.0269622802734375,
-0.0240020751953125,
-0.0300445556640625,
-0.001041412353515625,
-0.004657745361328125,
0.00981903076171875,
0.037445068359375,
0.061309814453125,
-0.0080718994140625,
-0.0340576171875,
0.038970947265625,
0.0213165283203125,
-0.00125885009765625,
0.018585205078125,
-0.0014772415161132812,
-0.0272979736328125,
-0.040435791015625,
0.0229339599609375,
-0.0091094970703125,
0.0282135009765625,
0.0016231536865234375,
-0.0169830322265625,
-0.01241302490234375,
0.0005064010620117188,
-0.018585205078125,
-0.05474853515625,
-0.0168609619140625,
0.06243896484375,
-0.0377197265625,
0.009918212890625,
0.0159454345703125,
0.017730712890625,
0.03265380859375,
0.0254974365234375,
-0.043365478515625,
-0.0187530517578125,
-0.03289794921875,
0.009246826171875,
-0.0238494873046875,
0.057891845703125,
-0.038848876953125,
0.00748443603515625,
-0.0022678375244140625,
0.0019121170043945312,
-0.0089263916015625,
-0.0032100677490234375,
0.020660400390625,
-0.04559326171875,
-0.036346435546875,
0.03143310546875,
-0.0212860107421875,
-0.0054779052734375,
-0.0279693603515625,
0.037200927734375,
0.0283203125,
-0.014373779296875,
0.05816650390625,
-0.00954437255859375,
0.010467529296875,
0.04510498046875,
0.045654296875,
-0.0435791015625,
0.041229248046875,
-0.0163421630859375,
0.0570068359375,
0.0041961669921875
] |
0d5b0d0aa92b1f7544d74c8364b8acce8d9ed4f4
|
Wordpress Stackexchange
Q: How to do I get a list of active plugins on my wordpress blog programmatically? I have 2 blogs, one which is multisite and one which isn't. I want to get a list of plugins active on both the blogs so I can compare them.
On the multisite blog, I want to list the plugins which are enabled network-wide as well as site wide.
A: List of plugins, with sites on which they are used (Multisite only)
If you want to know which plugin is currently activated and on which site, you can use a function like that one:
function wpstars_list_active_plugins() {
if ( function_exists( 'get_sites' ) && class_exists( 'WP_Site_Query' ) ) {
echo "<table class='active-plugins'>";
echo "<tr><th>Plugin name</th><th>Sites</th></tr>";
$plugins = get_plugins();
// Network activated
$active_plugins = get_site_option('active_sitewide_plugins');
foreach($active_plugins as $active_path => $active_plugin) {
$plugins[$active_path]['Sites'] = "A,";
}
// Per site activated
$sites = get_sites();
foreach ( $sites as $site ) {
$active_plugins = get_blog_option($site->blog_id, 'active_plugins');
foreach($active_plugins as $active_plugin) {
$plugins[$active_plugin]['Sites'] .= $site->blog_id . ",";
}
}
foreach($plugins as $plugin) {
echo "<tr><td>{$plugin['Name']}</td><td>{$plugin['Sites']}</td></tr>";
}
echo "</table>";
}
}
|
Q: How to do I get a list of active plugins on my wordpress blog programmatically? I have 2 blogs, one which is multisite and one which isn't. I want to get a list of plugins active on both the blogs so I can compare them.
On the multisite blog, I want to list the plugins which are enabled network-wide as well as site wide.
A: List of plugins, with sites on which they are used (Multisite only)
If you want to know which plugin is currently activated and on which site, you can use a function like that one:
function wpstars_list_active_plugins() {
if ( function_exists( 'get_sites' ) && class_exists( 'WP_Site_Query' ) ) {
echo "<table class='active-plugins'>";
echo "<tr><th>Plugin name</th><th>Sites</th></tr>";
$plugins = get_plugins();
// Network activated
$active_plugins = get_site_option('active_sitewide_plugins');
foreach($active_plugins as $active_path => $active_plugin) {
$plugins[$active_path]['Sites'] = "A,";
}
// Per site activated
$sites = get_sites();
foreach ( $sites as $site ) {
$active_plugins = get_blog_option($site->blog_id, 'active_plugins');
foreach($active_plugins as $active_plugin) {
$plugins[$active_plugin]['Sites'] .= $site->blog_id . ",";
}
}
foreach($plugins as $plugin) {
echo "<tr><td>{$plugin['Name']}</td><td>{$plugin['Sites']}</td></tr>";
}
echo "</table>";
}
}
A: WP-CLI is just the ticket. I've used if for so many things, I've lost count!
wp plugin list --status=active
If you want, you can run these commands on your local machine with aliases...
You would then use the @site function
wp @all plugin list --status=active
or
wp @multisite list --status=active
wp @blog list --status=active
A: The activated plugins are stored in the options table of a WordPress Blog under the key active_plugins
so you can use get_option('active_plugins'); of each blog and compare the arrays.
A: In form of a Dashboard Widget, one for Single Sites and Network Sites Dashboard, other for the Multisite Network Dashboard.
/*
* Single Site Dashboard Widget
*/
add_action('wp_dashboard_setup', 'wpse_54742_wp_dashboard_setup');
function wpse_54742_wp_dashboard_setup() {
wp_add_dashboard_widget( 'wpse_54742_active_site_plugins', __( 'Active Plugins' ), 'wpse_54742_active_site_plugins' );
}
function wpse_54742_active_site_plugins() {
$the_plugs = get_option('active_plugins');
echo '<ul>';
foreach($the_plugs as $key => $value) {
$string = explode('/',$value); // Folder name will be displayed
echo '<li>'.$string[0] .'</li>';
}
echo '</ul>';
}
/*
* Multisite Dashboard Widget
*/
add_action('wp_network_dashboard_setup', 'wpse_54742_network_dashboard_setup');
function wpse_54742_network_dashboard_setup() {
wp_add_dashboard_widget( 'wpse_54742_active_network_plugins', __( 'Network Active Plugins' ), 'wpse_54742_active_network_plugins' );
}
function wpse_54742_active_network_plugins() {
/*
* Network Activated Plugins
*/
$the_plugs = get_site_option('active_sitewide_plugins');
echo '<h3>NETWORK ACTIVATED</h3><ul>';
foreach($the_plugs as $key => $value) {
$string = explode('/',$key); // Folder name will be displayed
echo '<li>'.$string[0] .'</li>';
}
echo '</ul>';
/*
* Iterate Through All Sites
*/
global $wpdb;
$blogs = $wpdb->get_results($wpdb->prepare("
SELECT blog_id
FROM {$wpdb->blogs}
WHERE site_id = '{$wpdb->siteid}'
AND spam = '0'
AND deleted = '0'
AND archived = '0'
"));
echo '<h3>ALL SITES</h3>';
foreach ($blogs as $blog) {
$the_plugs = get_blog_option($blog->blog_id, 'active_plugins');
echo '<hr /><h4><strong>SITE</strong>: '. get_blog_option($blog->blog_id, 'blogname') .'</h4>';
echo '<ul>';
foreach($the_plugs as $key => $value) {
$string = explode('/',$value); // Folder name will be displayed
echo '<li>'.$string[0] .'</li>';
}
echo '</ul>';
}
}
|
wordpress
|
{
"language": "en",
"length": 470,
"provenance": "stackexchange_00019.jsonl.gz:420694",
"question_score": "16",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54742"
}
|
[
0.05682373046875,
0.0181732177734375,
0.0029048919677734375,
0.006496429443359375,
0.0335693359375,
-0.0445556640625,
0.0716552734375,
-0.035888671875,
0.03802490234375,
-0.01215362548828125,
-0.051177978515625,
0.0231475830078125,
-0.048614501953125,
-0.0290679931640625,
0.0097198486328125,
-0.029541015625,
0.0460205078125,
-0.020111083984375,
-0.00045800209045410156,
0.01024627685546875,
-0.013641357421875,
0.049407958984375,
-0.0244293212890625,
0.0806884765625,
0.01470184326171875,
-0.048065185546875,
0.08258056640625,
-0.016265869140625,
0.0297088623046875,
-0.03509521484375,
0.0287322998046875,
0.002349853515625,
0.00020313262939453125,
0.000827789306640625,
0.0303497314453125,
-0.038116455078125,
0.0301055908203125,
-0.02325439453125,
0.006801605224609375,
0.04547119140625,
0.0174407958984375,
-0.00787353515625,
0.0224761962890625,
0.0095977783203125,
0.0038204193115234375,
-0.047515869140625,
0.0380859375,
-0.0447998046875,
0.0060577392578125,
-0.0046844482421875,
0.0104217529296875,
-0.00545501708984375,
0.0190887451171875,
-0.019287109375,
-0.03143310546875,
-0.047637939453125,
0.011474609375,
0.0032672882080078125,
0.0238800048828125,
-0.003814697265625,
-0.04144287109375,
0.006206512451171875,
0.0228424072265625,
-0.0328369140625,
-0.0089111328125,
0.01446533203125,
0.0159759521484375,
0.021728515625,
-0.026641845703125,
-0.0198822021484375,
0.007587432861328125,
-0.0258941650390625,
-0.00013339519500732422,
0.032196044921875,
-0.0667724609375,
-0.0352783203125,
0.006900787353515625,
-0.029083251953125,
0.04803466796875,
-0.0226287841796875,
-0.000005602836608886719,
0.034515380859375,
0.0086669921875,
-0.013580322265625,
0.005279541015625,
0.03515625,
-0.0080108642578125,
-0.0219268798828125,
-0.038238525390625,
-0.01032257080078125,
-0.02471923828125,
0.00482177734375,
-0.02471923828125,
-0.0269317626953125,
-0.0168914794921875,
-0.01345062255859375,
0.0496826171875,
0.08892822265625,
-0.0272064208984375,
-0.04351806640625,
-0.014892578125,
-0.04278564453125,
-0.0299530029296875,
-0.018035888671875,
0.00513458251953125,
0.049591064453125,
-0.0031414031982421875,
0.031646728515625,
0.04547119140625,
0.0172271728515625,
0.02386474609375,
-0.016021728515625,
-0.003864288330078125,
-0.018951416015625,
-0.0036602020263671875,
-0.017364501953125,
-0.04388427734375,
0.0245361328125,
0.0105438232421875,
-0.033721923828125,
0.0038509368896484375,
0.02520751953125,
-0.0176239013671875,
-0.0181427001953125,
-0.0260467529296875,
-0.0413818359375,
-0.020050048828125,
-0.00966644287109375,
-0.0487060546875,
0.030242919921875,
-0.03607177734375,
0.006439208984375,
0.0269622802734375,
0.012115478515625,
-0.0077362060546875,
-0.0238494873046875,
0.0161590576171875,
0.07952880859375,
0.0189666748046875,
-0.0143280029296875,
0.035003662109375,
-0.0325927734375,
-0.03656005859375,
0.024322509765625,
0.0246734619140625,
0.003665924072265625,
0.025299072265625,
0.01076507568359375,
-0.00028228759765625,
0.0200042724609375,
0.01111602783203125,
-0.00933074951171875,
0.01161956787109375,
0.01226806640625,
0.004329681396484375,
-0.00994873046875,
0.043792724609375,
-0.037933349609375,
-0.00423431396484375,
-0.044342041015625,
0.0213470458984375,
0.0057220458984375,
0.0032062530517578125,
-0.0584716796875,
-0.03436279296875,
-0.04388427734375,
-0.02252197265625,
0.012176513671875,
0.040435791015625,
0.007221221923828125,
-0.0077056884765625,
-0.04241943359375,
0.07269287109375,
0.046844482421875,
0.0034027099609375,
0.0665283203125,
-0.031524658203125,
0.01435089111328125,
0.04644775390625,
-0.03363037109375,
-0.021087646484375,
-0.01004791259765625,
0.0712890625,
0.00510406494140625,
-0.058929443359375,
0.0219573974609375,
-0.00827789306640625,
0.0181884765625,
0.0419921875,
-0.00008440017700195312,
0.046417236328125,
-0.018646240234375,
-0.0103759765625,
0.01096343994140625,
-0.01058197021484375,
-0.00362396240234375,
-0.016357421875,
0.032684326171875,
-0.0203399658203125,
-0.034942626953125,
0.05706787109375,
-0.002201080322265625,
0.0010395050048828125,
-0.0173797607421875,
-0.06414794921875,
-0.0158843994140625,
-0.00855255126953125,
0.00952911376953125,
0.0361328125,
0.009124755859375,
-0.003070831298828125,
0.0076446533203125,
-0.0059661865234375,
-0.0225982666015625,
-0.0293426513671875,
0.058319091796875,
-0.00351715087890625,
0.0296173095703125,
0.0187835693359375,
-0.01016998291015625,
0.0209503173828125,
-0.0153961181640625,
0.000255584716796875,
-0.008026123046875,
0.032867431640625,
-0.0004405975341796875,
-0.0296783447265625,
-0.0162200927734375,
-0.00659942626953125,
0.005123138427734375,
-0.024658203125,
0.045013427734375,
0.0186309814453125,
0.059722900390625,
0.007755279541015625,
-0.006061553955078125,
0.04864501953125,
-0.04034423828125,
0.0256195068359375,
0.0113677978515625,
0.050262451171875,
0.0136260986328125,
0.004886627197265625,
-0.01404571533203125,
0.0242156982421875,
-0.06781005859375,
0.022125244140625,
-0.018890380859375,
0.0252532958984375,
0.06103515625,
-0.0714111328125,
0.01436614990234375,
0.03515625,
0.051025390625,
0.00023174285888671875,
0.052490234375,
-0.015716552734375,
-0.00923919677734375,
-0.031158447265625,
0.0006508827209472656,
0.01183319091796875,
-0.0151214599609375,
-0.0318603515625,
0.0013113021850585938,
0.058837890625,
0.023712158203125,
0.039154052734375,
0.0304107666015625,
-0.0401611328125,
0.0241851806640625,
0.007129669189453125,
-0.00518035888671875,
-0.006580352783203125,
0.061859130859375,
0.0093994140625,
0.0027923583984375,
-0.0177764892578125,
-0.02239990234375,
-0.025115966796875,
0.00591278076171875,
-0.0282745361328125,
-0.004871368408203125,
-0.032440185546875,
-0.013214111328125,
0.006954193115234375,
-0.0278472900390625,
0.0012760162353515625,
0.0014734268188476562,
-0.06689453125,
-0.03118896484375,
0.01534271240234375,
0.01971435546875,
-0.053314208984375,
0.01568603515625,
0.0020904541015625,
-0.010162353515625,
0.0139007568359375,
-0.047454833984375,
0.040496826171875,
-0.0282135009765625,
0.04449462890625,
0.06829833984375,
0.0053863525390625,
0.00252532958984375,
-0.0217742919921875,
-0.0246124267578125,
-0.0135498046875,
-0.005413055419921875,
-0.0159912109375,
-0.021697998046875,
-0.05340576171875,
0.035919189453125,
0.010894775390625,
0.040679931640625,
-0.03662109375,
-0.0654296875,
-0.032257080078125,
-0.004924774169921875,
-0.10247802734375,
-0.05133056640625,
-0.0211181640625,
-0.103515625,
0.041046142578125,
-0.0606689453125,
-0.036468505859375,
-0.01959228515625,
-0.0274810791015625,
0.03228759765625,
-0.02703857421875,
-0.0264739990234375,
-0.034454345703125,
-0.04718017578125,
-0.0784912109375,
0.007232666015625,
0.0109100341796875,
0.024566650390625,
0.004512786865234375,
0.0216217041015625,
-0.0000997781753540039,
-0.028289794921875,
-0.0002818107604980469,
-0.01512908935546875,
-0.0259857177734375,
-0.036041259765625,
-0.010894775390625,
0.0220184326171875,
-0.04779052734375,
0.010650634765625,
-0.001285552978515625,
0.0238189697265625,
-0.0298919677734375,
0.0038051605224609375,
0.037139892578125,
0.0306396484375,
0.055023193359375,
-0.0307769775390625,
-0.042144775390625,
0.0345458984375,
-0.01448822021484375,
-0.042724609375,
0.01296234130859375,
-0.03594970703125,
-0.037628173828125,
0.0440673828125,
0.005214691162109375,
0.004024505615234375,
0.0244293212890625,
-0.0110015869140625,
0.01419830322265625,
-0.01296234130859375,
0.0038909912109375,
-0.03973388671875,
0.04296875,
0.0135650634765625,
0.02001953125,
-0.020263671875,
0.0269775390625,
-0.00452423095703125,
0.0005865097045898438,
0.002277374267578125,
0.005939483642578125,
-0.026123046875,
0.01947021484375,
-0.045989990234375,
0.0218505859375,
0.009368896484375,
-0.016845703125,
-0.0130462646484375,
0.0008454322814941406,
-0.0058135986328125,
-0.00955963134765625,
0.018524169921875,
-0.07781982421875,
-0.01125335693359375,
-0.027069091796875,
0.00353240966796875,
-0.0015277862548828125,
-0.033355712890625,
-0.032745361328125,
-0.0099334716796875,
-0.11004638671875,
0.01497650146484375,
-0.01482391357421875,
-0.045318603515625,
0.0101165771484375,
-0.038543701171875,
-0.060577392578125,
-0.04534912109375,
0.0211181640625,
-0.01168060302734375,
0.00531768798828125,
-0.0012674331665039062,
-0.02532958984375,
-0.0191497802734375,
-0.0108642578125,
-0.0213775634765625,
-0.036712646484375,
0.007171630859375,
-0.019775390625,
0.01447296142578125,
0.0175018310546875,
-0.0132598876953125,
-0.0233306884765625,
0.0129852294921875,
-0.01241302490234375,
0.0017242431640625,
0.0009164810180664062,
0.025726318359375,
0.0002875328063964844,
-0.0235137939453125,
-0.0166473388671875,
-0.031402587890625,
-0.0279998779296875,
-0.019805908203125,
-0.0241851806640625,
-0.0260009765625,
0.00015485286712646484,
-0.0211639404296875,
0.03424072265625,
-0.024871826171875,
0.004764556884765625,
0.01178741455078125,
-0.0083160400390625,
0.01715087890625,
-0.03802490234375,
0.0043487548828125,
0.0177154541015625,
-0.0035762786865234375,
0.040802001953125,
-0.033294677734375,
0.013702392578125,
0.006427764892578125,
0.09771728515625,
0.017059326171875,
0.004627227783203125,
-0.023773193359375,
0.00434112548828125,
0.022674560546875,
0.022247314453125,
0.029327392578125,
0.0374755859375,
-0.005588531494140625,
-0.023040771484375,
0.0079498291015625,
-0.005084991455078125,
0.006336212158203125,
0.015899658203125,
0.0261688232421875,
-0.004180908203125,
-0.0080108642578125,
0.0255126953125,
-0.0062255859375,
0.00893402099609375,
-0.03271484375,
-0.033599853515625,
-0.045684814453125,
0.042083740234375,
-0.003803253173828125,
0.0455322265625,
-0.035980224609375,
-0.0264129638671875,
0.0006017684936523438,
-0.0020160675048828125,
0.025238037109375,
0.06640625,
-0.020294189453125,
0.035430908203125,
0.01555633544921875,
-0.007843017578125,
0.0312347412109375,
0.0335693359375,
-0.00027632713317871094,
0.0312347412109375,
-0.002269744873046875,
-0.032928466796875,
0.01009368896484375,
-0.01580810546875,
0.06689453125,
-0.043853759765625,
-0.0863037109375,
0.0204620361328125,
-0.028900146484375,
0.02435302734375,
0.0706787109375,
-0.00011408329010009766,
0.058837890625,
0.04290771484375,
-0.025390625,
-0.01495361328125,
-0.0307159423828125,
0.0216217041015625,
-0.06988525390625,
-0.045318603515625,
-0.0347900390625,
-0.0004963874816894531,
0.01117706298828125,
0.061676025390625,
-0.017791748046875,
0.048370361328125,
-0.0200653076171875,
0.03662109375,
0.04345703125,
0.0164642333984375,
0.0176544189453125,
-0.0196380615234375,
-0.03253173828125,
0.00595855712890625,
-0.0282745361328125,
-0.04437255859375,
0.0212554931640625,
0.0073089599609375,
0.0347900390625,
0.041229248046875,
-0.021087646484375,
0.0135345458984375,
0.0019741058349609375,
-0.0296630859375,
0.07611083984375,
0.0276336669921875,
-0.0310821533203125,
-0.048583984375,
0.0062255859375,
0.04949951171875,
0.0093536376953125,
0.00846099853515625,
-0.002742767333984375,
0.0252838134765625,
0.00476837158203125,
0.01435089111328125,
-0.059783935546875,
0.01197052001953125,
0.05413818359375,
-0.0265045166015625,
-0.01288604736328125,
0.0256805419921875,
-0.063232421875,
-0.00441741943359375,
-0.0305328369140625,
-0.0236358642578125,
0.06805419921875,
-0.01531982421875,
0.0797119140625,
-0.061126708984375,
-0.0264129638671875,
-0.0255584716796875,
-0.00978851318359375,
0.0386962890625,
0.035247802734375,
-0.052703857421875,
0.033721923828125,
-0.021942138671875,
-0.00273895263671875,
-0.003147125244140625,
-0.037567138671875,
-0.050079345703125,
-0.04302978515625,
0.011260986328125,
0.0102691650390625,
0.0179901123046875,
-0.0011539459228515625,
0.035186767578125,
0.002353668212890625,
-0.030548095703125,
-0.0007429122924804688,
0.01342010498046875,
0.037689208984375,
0.040008544921875,
0.0458984375,
0.07012939453125,
0.026336669921875,
-0.053466796875,
-0.0247955322265625,
0.0034580230712890625,
-0.0675048828125,
-0.024261474609375,
-0.006744384765625,
-0.012115478515625,
0.0335693359375,
0.0177001953125,
0.0006537437438964844,
-0.0207977294921875,
0.0204925537109375,
0.01824951171875,
-0.0163116455078125,
-0.03924560546875,
0.0411376953125,
-0.00441741943359375,
-0.004016876220703125,
-0.040496826171875,
-0.016387939453125,
-0.0230712890625,
-0.01201629638671875,
0.0211639404296875,
-0.002872467041015625,
-0.00336456298828125,
0.0196533203125,
-0.03887939453125,
0.07806396484375,
0.04949951171875,
-0.00922393798828125,
0.0263824462890625,
0.0225067138671875,
-0.0085601806640625,
-0.03228759765625,
-0.0187835693359375,
0.04034423828125,
0.011810302734375,
0.05645751953125,
-0.00943756103515625,
0.00856781005859375,
0.05023193359375,
-0.0290069580078125,
-0.01241302490234375,
-0.0015363693237304688,
0.0406494140625,
-0.0243988037109375,
0.00893402099609375,
0.02581787109375,
0.019134521484375,
0.0079193115234375,
-0.008575439453125,
-0.00879669189453125,
-0.01214599609375,
0.035064697265625,
0.0007867813110351562,
-0.022705078125,
0.01354217529296875,
0.01016998291015625,
-0.0233306884765625,
-0.004703521728515625,
0.0229949951171875,
0.03363037109375,
-0.01036834716796875,
0.02166748046875,
-0.00286865234375,
0.02899169921875,
-0.0187225341796875,
0.0031108856201171875,
-0.024169921875,
-0.00012731552124023438,
-0.045623779296875,
-0.006488800048828125,
-0.0297698974609375,
0.006076812744140625,
-0.004993438720703125,
-0.01593017578125,
0.005268096923828125,
0.061431884765625,
-0.0308685302734375,
0.0091552734375,
0.04156494140625,
-0.046783447265625,
-0.038299560546875,
-0.005840301513671875,
0.010345458984375,
0.025054931640625,
-0.0106964111328125,
0.0276031494140625,
-0.02398681640625,
-0.018310546875,
-0.0095977783203125,
0.020904541015625,
0.0665283203125,
0.01036834716796875,
-0.04083251953125,
0.04864501953125,
0.0166168212890625,
-0.025909423828125,
-0.0279388427734375,
0.000640869140625,
-0.06988525390625,
-0.036865234375,
-0.01343536376953125,
-0.0178375244140625,
0.00048160552978515625,
-0.0207366943359375,
-0.056304931640625,
0.06597900390625,
-0.0018644332885742188,
0.029449462890625,
0.0509033203125,
0.01401519775390625,
-0.0560302734375,
-0.02716064453125,
-0.037750244140625,
0.035125732421875,
-0.0255126953125,
0.01302337646484375,
-0.035064697265625,
0.0250396728515625,
-0.021728515625,
-0.0018129348754882812,
0.042022705078125,
0.0147705078125,
-0.036376953125,
-0.0322265625,
0.0006670951843261719,
-0.014434814453125,
-0.024993896484375,
0.051483154296875,
0.01129150390625,
0.05194091796875,
0.050537109375,
-0.04547119140625,
0.037261962890625,
-0.023223876953125,
0.002803802490234375,
0.0281982421875,
-0.007965087890625,
-0.02093505859375,
-0.01300811767578125,
0.0017652511596679688,
0.0248260498046875,
-0.01013946533203125,
-0.0309295654296875,
0.01499176025390625,
-0.0021076202392578125,
0.052581787109375,
0.01087188720703125,
0.03167724609375,
0.0107269287109375,
-0.017425537109375,
0.03765869140625,
0.0015840530395507812,
-0.0195465087890625,
0.033660888671875,
0.0224609375,
0.01444244384765625,
0.00418853759765625,
-0.007198333740234375,
0.0203399658203125,
-0.004058837890625,
0.019134521484375,
0.0279541015625,
0.019927978515625,
-0.00217437744140625,
0.0357666015625,
-0.003330230712890625,
0.01177978515625,
-0.021514892578125,
-0.08935546875,
0.01093292236328125,
0.0214996337890625,
0.0238800048828125,
0.06842041015625,
0.05084228515625,
-0.005939483642578125,
0.058502197265625,
-0.0189208984375,
-0.006622314453125,
0.0106353759765625,
0.00884246826171875,
0.01200103759765625,
-0.004146575927734375,
-0.0005903244018554688,
-0.017822265625,
-0.034088134765625,
0.007305145263671875,
0.00838470458984375,
0.025360107421875,
0.0004756450653076172,
0.035125732421875,
-0.0259857177734375,
-0.01690673828125,
-0.0194854736328125,
0.05157470703125,
-0.0155792236328125,
0.0277557373046875,
-0.0650634765625,
-0.07720947265625,
0.0099639892578125,
0.049835205078125,
0.058837890625,
0.00867462158203125,
0.049530029296875,
0.037872314453125,
-0.0176239013671875,
0.0112152099609375,
0.053466796875,
0.004924774169921875,
-0.01435089111328125,
-0.0161590576171875,
0.00257110595703125,
0.022857666015625,
-0.008514404296875,
0.019561767578125,
0.0038928985595703125,
0.038238525390625,
-0.03436279296875,
0.046661376953125,
-0.003692626953125,
0.0261993408203125,
0.008575439453125,
0.0025787353515625,
-0.035888671875,
-0.0168609619140625,
-0.097412109375,
0.00353240966796875,
-0.0845947265625,
-0.048126220703125,
0.031646728515625,
0.05230712890625,
0.00968170166015625,
0.0005335807800292969,
0.0121612548828125,
-0.004791259765625,
0.0219268798828125,
0.0152130126953125,
-0.0161590576171875,
0.064208984375,
0.052032470703125,
0.01898193359375,
-0.03314208984375,
-0.016693115234375,
-0.01122283935546875,
0.04144287109375,
0.0228424072265625,
0.04327392578125,
-0.0108795166015625,
0.028350830078125,
0.036773681640625,
0.006839752197265625,
-0.005817413330078125,
0.0180816650390625,
-0.0207977294921875,
-0.0286865234375,
0.00905609130859375,
-0.0025272369384765625,
-0.05914306640625,
0.0278167724609375,
0.02154541015625,
-0.003284454345703125,
0.02825927734375,
-0.00800323486328125,
0.010040283203125,
0.0017070770263671875,
0.035400390625,
-0.023162841796875,
-0.0546875,
-0.052581787109375,
-0.01477813720703125,
0.017242431640625,
0.056427001953125,
0.018280029296875,
0.01910400390625,
0.004848480224609375,
-0.01380157470703125,
0.01081085205078125,
0.006908416748046875,
-0.01483917236328125,
0.0251922607421875,
-0.007080078125,
-0.04364013671875,
0.0150909423828125,
-0.01275634765625,
-0.017120361328125,
0.01244354248046875,
0.0286712646484375,
0.00980377197265625,
-0.02545166015625,
0.0316162109375,
0.019866943359375,
0.0270538330078125,
-0.028961181640625,
0.01146697998046875,
0.047393798828125,
0.00438690185546875,
-0.0015077590942382812,
-0.04351806640625,
-0.02178955078125,
-0.058197021484375,
-0.00888824462890625,
0.0183868408203125,
-0.0389404296875,
-0.0057830810546875,
-0.0158538818359375,
-0.00571441650390625,
0.008392333984375,
-0.0229339599609375,
0.01012420654296875,
-0.00482940673828125,
-0.045166015625,
-0.006622314453125,
-0.0192108154296875,
-0.0176544189453125,
0.0038242340087890625,
0.021942138671875,
-0.0086669921875,
0.00958251953125,
-0.0207061767578125,
0.0024051666259765625,
0.0042266845703125,
0.0164337158203125,
0.03070068359375,
-0.024627685546875,
-0.0240325927734375,
0.026214599609375,
0.0079498291015625,
0.060638427734375,
-0.0081024169921875,
0.004146575927734375,
0.043212890625,
-0.037445068359375,
-0.03802490234375,
-0.058624267578125,
0.0178680419921875,
-0.0726318359375,
-0.041107177734375,
-0.0338134765625,
-0.007183074951171875,
-0.01373291015625,
-0.04974365234375,
-0.0419921875,
0.060760498046875,
-0.0170440673828125,
-0.021759033203125,
-0.0965576171875,
0.01629638671875,
0.026092529296875,
0.0019931793212890625,
-0.0251312255859375,
-0.0271148681640625,
-0.05426025390625,
0.03338623046875,
0.0255889892578125,
0.04193115234375,
0.0033855438232421875,
0.01837158203125,
-0.005573272705078125,
0.03948974609375,
0.021270751953125,
0.00202178955078125,
0.0023250579833984375,
-0.0140228271484375,
0.04913330078125,
0.0521240234375,
-0.006511688232421875,
0.023590087890625,
0.0254058837890625,
-0.0352783203125,
-0.01309967041015625,
-0.0594482421875,
-0.025421142578125,
-0.01317596435546875,
0.07049560546875,
0.0654296875,
0.01641845703125,
-0.0589599609375,
-0.0240631103515625,
0.0015316009521484375,
-0.037872314453125,
-0.006984710693359375,
0.03082275390625,
-0.07696533203125,
-0.0006389617919921875,
-0.003673553466796875,
-0.01110076904296875,
0.00225067138671875,
0.005847930908203125,
-0.021575927734375,
0.001598358154296875,
-0.0006170272827148438,
-0.0114898681640625,
-0.01517486572265625,
-0.009796142578125,
-0.01739501953125,
0.0020046234130859375,
-0.005558013916015625,
-0.0352783203125,
0.01068115234375,
-0.0229034423828125,
0.0062255859375,
-0.000606536865234375,
0.00006854534149169922,
-0.004711151123046875,
-0.00415802001953125,
0.01523590087890625,
-0.005855560302734375,
0.028778076171875,
-0.01123809814453125,
-0.03076171875,
-0.00009238719940185547,
-0.004596710205078125,
-0.0143280029296875,
0.00685882568359375,
0.00499725341796875,
0.0023193359375,
0.053558349609375,
0.0311126708984375,
0.050445556640625,
-0.004482269287109375,
0.0693359375,
0.03131103515625,
-0.06890869140625,
0.0238494873046875,
-0.038482666015625,
-0.0191192626953125,
0.026824951171875,
-0.020355224609375,
-0.0689697265625,
0.058563232421875,
-0.01265716552734375,
0.0308380126953125,
0.037567138671875
] |
9dbb5460733b90ac72b894b1dd700a0f13f06e17
|
Wordpress Stackexchange
Q: Taxonomy slug by term ID I'm trying to modify wp_nav_menu to display term thumbnails. To get those thumbnails I need term ID and taxonomy slug: $thumbnailimg = get_the_term_thumbnail($term_id, '$taxonomy', 'medium');
I managed to get term ID for it with: $term_id = (int)$item->object_id;
But now I need to check if that object is a term AND what custom taxonomy that term belongs to (I have 2 of them).
Can anyone help me to solve this problem? :)
A: For a menu object $item:
*
*$item->object stores the object the menu item refers to, e.g. 'post', 'page', 'my-cpt', or 'my-taxonomy' (the post type name, or the taxonomy name)
*$item->type stores what 'type' of object is it, either: 'post_type' or 'taxonomy'.
For custom links, these are both custom
|
Q: Taxonomy slug by term ID I'm trying to modify wp_nav_menu to display term thumbnails. To get those thumbnails I need term ID and taxonomy slug: $thumbnailimg = get_the_term_thumbnail($term_id, '$taxonomy', 'medium');
I managed to get term ID for it with: $term_id = (int)$item->object_id;
But now I need to check if that object is a term AND what custom taxonomy that term belongs to (I have 2 of them).
Can anyone help me to solve this problem? :)
A: For a menu object $item:
*
*$item->object stores the object the menu item refers to, e.g. 'post', 'page', 'my-cpt', or 'my-taxonomy' (the post type name, or the taxonomy name)
*$item->type stores what 'type' of object is it, either: 'post_type' or 'taxonomy'.
For custom links, these are both custom
A: See if these functions will work for what you are trying to do:
*
*term_exists
*get_taxonomies
|
wordpress
|
{
"language": "en",
"length": 143,
"provenance": "stackexchange_00019.jsonl.gz:420696",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54756"
}
|
[
0.06256103515625,
0.0171966552734375,
0.0211029052734375,
-0.0165557861328125,
0.03680419921875,
-0.02252197265625,
0.068359375,
-0.03204345703125,
0.0206146240234375,
0.0008497238159179688,
-0.019439697265625,
0.0302276611328125,
-0.050811767578125,
-0.0289764404296875,
-0.0076446533203125,
-0.0251922607421875,
0.0367431640625,
-0.0301666259765625,
0.020416259765625,
-0.00899505615234375,
0.0157012939453125,
0.0199737548828125,
0.048858642578125,
-0.01155853271484375,
0.04937744140625,
-0.0452880859375,
0.01045989990234375,
-0.0107269287109375,
0.007221221923828125,
-0.0242919921875,
0.0241241455078125,
0.0169677734375,
0.007045745849609375,
-0.02032470703125,
0.053070068359375,
0.0211639404296875,
0.0302734375,
-0.00887298583984375,
0.033233642578125,
0.01154327392578125,
0.032684326171875,
-0.0156707763671875,
-0.008819580078125,
0.0024166107177734375,
-0.0209503173828125,
-0.03118896484375,
-0.00737762451171875,
-0.040283203125,
0.0118408203125,
0.003326416015625,
0.03924560546875,
-0.00945281982421875,
0.053375244140625,
-0.01181793212890625,
-0.0158233642578125,
0.0014743804931640625,
-0.0037708282470703125,
-0.0285491943359375,
0.0157012939453125,
-0.003810882568359375,
-0.010101318359375,
0.00014317035675048828,
0.02679443359375,
-0.005374908447265625,
0.00594329833984375,
0.0287933349609375,
-0.0261077880859375,
0.0037174224853515625,
-0.058349609375,
-0.014373779296875,
0.0080718994140625,
-0.0689697265625,
0.0022430419921875,
0.0020656585693359375,
-0.0124664306640625,
-0.057373046875,
0.0243682861328125,
-0.0292816162109375,
-0.0050201416015625,
0.031829833984375,
0.02734375,
-0.032379150390625,
-0.0355224609375,
0.05731201171875,
-0.00003409385681152344,
0.0928955078125,
-0.0013275146484375,
-0.04974365234375,
0.004047393798828125,
-0.01629638671875,
0.00452423095703125,
-0.0162353515625,
-0.01261138916015625,
0.01374053955078125,
0.01329803466796875,
-0.05780029296875,
0.0384521484375,
0.07086181640625,
-0.018646240234375,
0.01512908935546875,
-0.00606536865234375,
-0.04412841796875,
0.03582763671875,
-0.0677490234375,
0.023406982421875,
0.00620269775390625,
-0.007015228271484375,
0.00136566162109375,
0.053070068359375,
0.028900146484375,
0.003505706787109375,
0.05645751953125,
-0.0203094482421875,
0.005764007568359375,
-0.026092529296875,
0.0196075439453125,
-0.031890869140625,
-0.022125244140625,
-0.02996826171875,
-0.0158538818359375,
-0.006103515625,
0.006061553955078125,
0.033660888671875,
0.0058135986328125,
0.0016193389892578125,
0.02880859375,
-0.0102081298828125,
-0.04473876953125,
-0.0299224853515625,
0.0172271728515625,
-0.02960205078125,
0.00559234619140625,
0.0576171875,
0.062225341796875,
0.01433563232421875,
-0.01494598388671875,
-0.013458251953125,
-0.00909423828125,
-0.01273345947265625,
-0.00650787353515625,
0.0120697021484375,
0.0259552001953125,
0.047637939453125,
-0.02081298828125,
0.016815185546875,
0.007106781005859375,
0.0150146484375,
0.0367431640625,
0.00609588623046875,
-0.01666259765625,
0.026397705078125,
-0.0259857177734375,
0.06842041015625,
0.005146026611328125,
-0.07073974609375,
-0.0265350341796875,
0.031158447265625,
-0.050628662109375,
-0.04534912109375,
-0.0751953125,
-0.01238250732421875,
-0.031890869140625,
-0.01422882080078125,
-0.029541015625,
-0.0266571044921875,
0.0240020751953125,
-0.01275634765625,
0.0029582977294921875,
0.016693115234375,
0.0207977294921875,
0.034698486328125,
-0.0003986358642578125,
-0.02423095703125,
0.0188446044921875,
0.0203857421875,
-0.0013408660888671875,
0.0199737548828125,
0.0015935897827148438,
0.0250091552734375,
0.06427001953125,
-0.01001739501953125,
-0.048065185546875,
0.0254058837890625,
-0.03558349609375,
-0.031829833984375,
0.0148468017578125,
0.0007562637329101562,
0.050262451171875,
0.021392822265625,
0.0167694091796875,
0.0211944580078125,
-0.014556884765625,
-0.06756591796875,
0.038055419921875,
0.0214385986328125,
-0.004726409912109375,
-0.03875732421875,
-0.01226043701171875,
0.0023670196533203125,
-0.026214599609375,
0.0008997917175292969,
0.0277862548828125,
-0.021881103515625,
-0.0238037109375,
-0.07403564453125,
-0.005706787109375,
-0.023162841796875,
0.053131103515625,
-0.01444244384765625,
0.045623779296875,
0.019927978515625,
-0.0018110275268554688,
-0.032196044921875,
-0.0033626556396484375,
-0.01091766357421875,
0.0100555419921875,
-0.0242156982421875,
-0.0172119140625,
-0.0249481201171875,
0.0098114013671875,
-0.049407958984375,
0.0196990966796875,
-0.058746337890625,
0.01145172119140625,
0.0225830078125,
0.031585693359375,
-0.0301361083984375,
0.0193023681640625,
0.0097808837890625,
0.0467529296875,
-0.041229248046875,
-0.0118560791015625,
0.039825439453125,
-0.0139312744140625,
-0.019195556640625,
0.00489044189453125,
0.058197021484375,
-0.0809326171875,
0.0231170654296875,
0.058624267578125,
0.04931640625,
0.0290069580078125,
-0.02294921875,
-0.05401611328125,
0.074462890625,
-0.0158843994140625,
0.004425048828125,
-0.03387451171875,
-0.0198211669921875,
0.00533294677734375,
0.0247802734375,
0.027587890625,
0.01392364501953125,
0.051025390625,
-0.003223419189453125,
0.0295562744140625,
-0.01511383056640625,
-0.0157470703125,
0.0278167724609375,
0.037811279296875,
-0.0204315185546875,
0.0085601806640625,
0.0272979736328125,
-0.0140838623046875,
-0.0081939697265625,
0.0413818359375,
0.0014619827270507812,
0.007122039794921875,
-0.040191650390625,
0.0084381103515625,
0.0207977294921875,
0.024139404296875,
0.0018291473388671875,
0.0178680419921875,
0.05914306640625,
-0.01177978515625,
-0.006229400634765625,
-0.0234222412109375,
0.0189056396484375,
0.007022857666015625,
-0.02325439453125,
0.0311279296875,
0.0160675048828125,
-0.003086090087890625,
-0.054229736328125,
-0.07098388671875,
0.03570556640625,
0.00867462158203125,
-0.059356689453125,
-0.02386474609375,
0.0059051513671875,
0.04888916015625,
-0.033172607421875,
0.03448486328125,
-0.050445556640625,
0.01551055908203125,
0.0150146484375,
0.005115509033203125,
0.0225982666015625,
-0.019256591796875,
0.037078857421875,
0.04498291015625,
-0.0236358642578125,
0.020843505859375,
0.00946044921875,
-0.05743408203125,
-0.009552001953125,
0.036895751953125,
0.0195465087890625,
-0.01401519775390625,
-0.0217437744140625,
0.036865234375,
-0.006679534912109375,
0.0218505859375,
-0.042144775390625,
-0.048675537109375,
-0.028106689453125,
-0.0223388671875,
-0.100341796875,
-0.035003662109375,
0.017120361328125,
-0.0389404296875,
0.0213623046875,
-0.0003139972686767578,
-0.007457733154296875,
-0.0280609130859375,
0.0233154296875,
0.0049591064453125,
0.0193634033203125,
-0.0408935546875,
-0.08392333984375,
-0.04937744140625,
-0.09869384765625,
0.026275634765625,
0.004932403564453125,
0.032196044921875,
0.02325439453125,
0.00881195068359375,
0.019866943359375,
-0.02215576171875,
0.05731201171875,
0.040985107421875,
-0.0171966552734375,
0.019989013671875,
-0.0245513916015625,
-0.0110626220703125,
0.004001617431640625,
-0.007564544677734375,
0.012359619140625,
0.0131683349609375,
-0.005115509033203125,
0.01361083984375,
-0.026580810546875,
0.0012960433959960938,
0.0204315185546875,
0.0103912353515625,
0.019775390625,
0.044769287109375,
0.055389404296875,
0.00371551513671875,
-0.0298309326171875,
-0.0241546630859375,
-0.042999267578125,
0.057861328125,
0.016143798828125,
0.0137939453125,
-0.00807952880859375,
0.044219970703125,
-0.023681640625,
0.00872802734375,
-0.00821685791015625,
0.0074615478515625,
0.01934814453125,
-0.0168914794921875,
-0.0254974365234375,
0.0038299560546875,
0.0177001953125,
-0.01401519775390625,
0.033111572265625,
0.01146697998046875,
0.0201263427734375,
-0.004894256591796875,
0.0061187744140625,
-0.049407958984375,
-0.06298828125,
0.026031494140625,
-0.041778564453125,
0.035308837890625,
-0.049652099609375,
-0.01306915283203125,
-0.01450347900390625,
0.0887451171875,
-0.047698974609375,
-0.0208282470703125,
-0.0254058837890625,
-0.0128021240234375,
0.060546875,
-0.01422119140625,
-0.0055999755859375,
-0.048370361328125,
-0.10662841796875,
0.0291595458984375,
0.0133056640625,
-0.02789306640625,
-0.0379638671875,
0.0489501953125,
-0.08477783203125,
-0.03570556640625,
0.04290771484375,
-0.016082763671875,
0.0194091796875,
0.0699462890625,
-0.007518768310546875,
0.051361083984375,
-0.06671142578125,
-0.0007295608520507812,
-0.052001953125,
-0.00920867919921875,
0.0093536376953125,
0.032806396484375,
0.002384185791015625,
-0.0098419189453125,
-0.01100921630859375,
0.052032470703125,
0.006366729736328125,
0.025543212890625,
0.0119781494140625,
0.0167083740234375,
0.0054473876953125,
0.0135040283203125,
0.01861572265625,
-0.01442718505859375,
-0.008941650390625,
-0.04461669921875,
-0.06353759765625,
-0.00098419189453125,
-0.0174713134765625,
0.060333251953125,
0.0030975341796875,
-0.0179443359375,
-0.05126953125,
-0.01262664794921875,
-0.0001404285430908203,
0.00031685829162597656,
0.0036773681640625,
-0.0234375,
0.0018873214721679688,
-0.047119140625,
0.0587158203125,
0.0270233154296875,
-0.0274505615234375,
0.0004074573516845703,
0.06231689453125,
0.020050048828125,
-0.04022216796875,
-0.057464599609375,
0.0058441162109375,
0.031280517578125,
0.0071868896484375,
0.033050537109375,
0.0205535888671875,
-0.019805908203125,
0.0261993408203125,
0.023406982421875,
0.0010728836059570312,
-0.01514434814453125,
0.0546875,
-0.0021209716796875,
-0.0211181640625,
0.0175933837890625,
-0.0188751220703125,
0.005138397216796875,
0.0159454345703125,
-0.024078369140625,
-0.0379638671875,
-0.0274658203125,
0.0762939453125,
-0.01160430908203125,
0.046630859375,
-0.0621337890625,
-0.0576171875,
0.029205322265625,
-0.053619384765625,
0.042999267578125,
0.0197906494140625,
-0.0151824951171875,
0.04046630859375,
0.005359649658203125,
0.006351470947265625,
0.011383056640625,
0.0066375732421875,
0.01434326171875,
0.027618408203125,
-0.0003638267517089844,
0.007518768310546875,
-0.020294189453125,
0.00531005859375,
0.01221466064453125,
-0.00457763671875,
-0.032684326171875,
-0.0330810546875,
0.0031070709228515625,
-0.025390625,
0.002025604248046875,
-0.0013484954833984375,
0.044342041015625,
0.0179290771484375,
-0.01739501953125,
-0.02691650390625,
-0.058807373046875,
0.00843048095703125,
-0.049468994140625,
-0.0089111328125,
-0.0011110305786132812,
-0.0258026123046875,
-0.01158905029296875,
0.041107177734375,
-0.005985260009765625,
0.00033283233642578125,
-0.0112762451171875,
0.001323699951171875,
-0.027740478515625,
0.045928955078125,
0.006626129150390625,
-0.01102447509765625,
0.006317138671875,
0.019989013671875,
0.023651123046875,
-0.0325927734375,
-0.0117034912109375,
-0.00457763671875,
0.03875732421875,
-0.041351318359375,
-0.017730712890625,
0.04644775390625,
-0.01568603515625,
-0.00255584716796875,
-0.01491546630859375,
-0.045623779296875,
-0.028900146484375,
0.0020732879638671875,
0.019195556640625,
0.01568603515625,
-0.01238250732421875,
-0.01422119140625,
0.031829833984375,
0.019256591796875,
0.03192138671875,
-0.041839599609375,
-0.0246429443359375,
0.0201416015625,
0.040283203125,
-0.0006427764892578125,
0.00203704833984375,
0.0022449493408203125,
-0.02001953125,
-0.020843505859375,
-0.0235443115234375,
-0.02655029296875,
0.06207275390625,
-0.03289794921875,
0.04998779296875,
-0.00954437255859375,
-0.00890350341796875,
-0.0014295578002929688,
0.02178955078125,
0.0184478759765625,
0.022705078125,
-0.0570068359375,
0.0276947021484375,
-0.03399658203125,
0.03680419921875,
0.052734375,
-0.04718017578125,
-0.016876220703125,
-0.049591064453125,
-0.03973388671875,
0.01149749755859375,
-0.00171661376953125,
0.0543212890625,
0.009063720703125,
0.02874755859375,
-0.0247344970703125,
0.0110321044921875,
0.006317138671875,
-0.00921630859375,
0.0015439987182617188,
0.0284881591796875,
-0.006988525390625,
-0.04376220703125,
-0.0352783203125,
-0.0083770751953125,
-0.0261383056640625,
-0.057220458984375,
-0.0015783309936523438,
0.01265716552734375,
-0.01325225830078125,
0.059967041015625,
0.06707763671875,
0.0177001953125,
0.04217529296875,
-0.0278778076171875,
-0.00986480712890625,
-0.01068115234375,
-0.01160430908203125,
-0.04168701171875,
-0.00612640380859375,
0.03973388671875,
-0.043914794921875,
0.01275634765625,
0.017364501953125,
0.0330810546875,
0.0163116455078125,
-0.05023193359375,
0.0252227783203125,
0.029144287109375,
-0.005001068115234375,
0.0274505615234375,
0.048980712890625,
0.0180206298828125,
0.0328369140625,
0.0310516357421875,
0.020416259765625,
-0.01708984375,
-0.007099151611328125,
-0.01194000244140625,
0.0278167724609375,
0.04449462890625,
-0.01251220703125,
-0.01276397705078125,
0.0092620849609375,
-0.0307769775390625,
0.0015277862548828125,
-0.0247955322265625,
0.0343017578125,
0.03448486328125,
0.0020008087158203125,
0.043060302734375,
-0.03863525390625,
-0.0020313262939453125,
0.0022335052490234375,
-0.01303863525390625,
0.004825592041015625,
-0.012725830078125,
-0.03662109375,
-0.046051025390625,
-0.0156097412109375,
-0.00534820556640625,
-0.0053253173828125,
-0.006214141845703125,
0.0168914794921875,
-0.003490447998046875,
-0.0205535888671875,
-0.026763916015625,
-0.0154876708984375,
-0.01312255859375,
-0.0200653076171875,
0.007965087890625,
-0.0194854736328125,
0.01438140869140625,
-0.0203704833984375,
0.05487060546875,
-0.051483154296875,
0.044464111328125,
0.048492431640625,
0.0183868408203125,
-0.01251220703125,
0.0278167724609375,
0.0008091926574707031,
0.0129852294921875,
-0.0110321044921875,
-0.032073974609375,
0.0175018310546875,
0.00998687744140625,
-0.0020999908447265625,
0.007415771484375,
-0.03570556640625,
0.0016698837280273438,
-0.037322998046875,
0.029327392578125,
-0.021331787109375,
-0.021759033203125,
0.07696533203125,
-0.04925537109375,
0.00836944580078125,
0.0185394287109375,
0.06085205078125,
0.007518768310546875,
-0.010284423828125,
0.04339599609375,
-0.0732421875,
-0.0302886962890625,
0.01776123046875,
-0.004863739013671875,
-0.033050537109375,
-0.0102081298828125,
-0.06524658203125,
0.083251953125,
-0.015533447265625,
0.025482177734375,
0.0004413127899169922,
0.0305328369140625,
-0.0100250244140625,
0.0206146240234375,
-0.01194000244140625,
0.0141448974609375,
-0.0082855224609375,
0.031951904296875,
-0.0206756591796875,
0.004489898681640625,
0.0110015869140625,
0.0206756591796875,
0.043121337890625,
0.0170745849609375,
-0.047515869140625,
0.01215362548828125,
0.08026123046875,
0.0243072509765625,
0.01445770263671875,
0.048553466796875,
-0.007427215576171875,
-0.0254364013671875,
0.038238525390625,
0.0057830810546875,
0.046539306640625,
-0.0171051025390625,
-0.0102081298828125,
0.003215789794921875,
0.0094451904296875,
0.029327392578125,
-0.035675048828125,
0.00689697265625,
-0.0273284912109375,
-0.0152740478515625,
0.0267333984375,
-0.0218505859375,
0.032440185546875,
-0.002468109130859375,
0.02874755859375,
-0.029693603515625,
-0.00022733211517333984,
-0.00447845458984375,
0.0447998046875,
-0.000047206878662109375,
0.0004343986511230469,
0.011810302734375,
0.01605224609375,
0.044097900390625,
-0.0109100341796875,
-0.00789642333984375,
0.025299072265625,
-0.006984710693359375,
0.033447265625,
0.00033664703369140625,
0.006855010986328125,
-0.07525634765625,
-0.042083740234375,
0.049560546875,
0.062042236328125,
-0.048919677734375,
-0.0625,
0.018096923828125,
0.01534271240234375,
-0.0006442070007324219,
0.051361083984375,
0.0286865234375,
0.0421142578125,
0.09185791015625,
-0.041412353515625,
0.0146636962890625,
0.038818359375,
0.039093017578125,
-0.006351470947265625,
-0.010589599609375,
-0.0587158203125,
-0.0094146728515625,
-0.06719970703125,
0.046295166015625,
0.028533935546875,
0.07440185546875,
-0.005306243896484375,
0.09393310546875,
-0.019012451171875,
-0.017791748046875,
-0.00948333740234375,
0.0404052734375,
0.006744384765625,
-0.0118560791015625,
-0.024383544921875,
-0.037811279296875,
0.035980224609375,
0.0238189697265625,
0.01288604736328125,
0.004955291748046875,
0.0292205810546875,
0.0167694091796875,
-0.0281829833984375,
-0.00516510009765625,
0.059051513671875,
-0.0193023681640625,
-0.0096588134765625,
-0.04400634765625,
0.036407470703125,
0.037200927734375,
0.0149383544921875,
-0.01654052734375,
-0.0115966796875,
0.075439453125,
-0.032135009765625,
0.07305908203125,
-0.00647735595703125,
0.0026493072509765625,
0.039154052734375,
-0.006893157958984375,
0.038726806640625,
-0.00006335973739624023,
-0.09619140625,
-0.006923675537109375,
-0.020477294921875,
-0.0810546875,
0.032806396484375,
0.043975830078125,
-0.0308837890625,
-0.0017719268798828125,
0.01522064208984375,
-0.013214111328125,
-0.0157012939453125,
0.010009765625,
0.0258026123046875,
-0.01849365234375,
-0.0069732666015625,
0.01187896728515625,
-0.022552490234375,
0.0011892318725585938,
0.00533294677734375,
0.00262451171875,
0.0091552734375,
0.059478759765625,
-0.0090484619140625,
0.00867462158203125,
-0.033294677734375,
-0.00792694091796875,
-0.04254150390625,
-0.034942626953125,
0.03558349609375,
-0.0023136138916015625,
-0.00963592529296875,
0.004451751708984375,
-0.038848876953125,
0.0212249755859375,
0.045379638671875,
-0.01445770263671875,
-0.0107574462890625,
-0.0036449432373046875,
0.01352691650390625,
0.0004949569702148438,
0.05169677734375,
-0.0242156982421875,
-0.0101776123046875,
-0.0330810546875,
-0.044036865234375,
0.034149169921875,
0.03497314453125,
0.031646728515625,
0.039825439453125,
0.006099700927734375,
-0.0279998779296875,
0.0254974365234375,
-0.0321044921875,
0.031585693359375,
0.04571533203125,
-0.0084686279296875,
-0.038360595703125,
0.00965118408203125,
0.00042748451232910156,
-0.019744873046875,
0.02508544921875,
-0.0022907257080078125,
0.0170745849609375,
-0.0124969482421875,
0.03240966796875,
-0.01523590087890625,
0.012054443359375,
-0.0321044921875,
-0.0015592575073242188,
0.025390625,
0.0205078125,
-0.0215301513671875,
-0.07330322265625,
-0.0240020751953125,
-0.06878662109375,
0.016510009765625,
0.039703369140625,
-0.025115966796875,
0.02374267578125,
-0.050750732421875,
-0.01233673095703125,
0.0489501953125,
0.018463134765625,
-0.02484130859375,
0.0372314453125,
-0.0268096923828125,
-0.017181396484375,
0.0186004638671875,
-0.018890380859375,
0.00592803955078125,
0.002140045166015625,
-0.01898193359375,
0.014923095703125,
-0.015869140625,
0.00800323486328125,
0.0145263671875,
0.023651123046875,
0.033935546875,
-0.030853271484375,
-0.0379638671875,
0.0298309326171875,
0.0274200439453125,
0.0738525390625,
0.0207977294921875,
-0.035369873046875,
-0.010498046875,
-0.0025844573974609375,
-0.004856109619140625,
-0.015899658203125,
0.007236480712890625,
-0.02301025390625,
-0.0248260498046875,
0.011505126953125,
-0.0226593017578125,
-0.007537841796875,
-0.035247802734375,
-0.04302978515625,
0.03521728515625,
0.0086822509765625,
-0.0269012451171875,
-0.026763916015625,
-0.005611419677734375,
0.0012979507446289062,
-0.0279693603515625,
-0.01380157470703125,
0.0010128021240234375,
-0.020904541015625,
0.0175323486328125,
0.016387939453125,
0.00013720989227294922,
0.0313720703125,
-0.0036792755126953125,
-0.0474853515625,
0.0258941650390625,
0.0029926300048828125,
0.004482269287109375,
0.02508544921875,
-0.00492095947265625,
-0.0085601806640625,
0.01471710205078125,
-0.0645751953125,
-0.0821533203125,
-0.037841796875,
0.004787445068359375,
-0.006397247314453125,
-0.0146484375,
-0.0225982666015625,
0.005126953125,
0.06884765625,
0.022705078125,
0.0174102783203125,
-0.0263519287109375,
-0.018798828125,
-0.01309967041015625,
-0.046600341796875,
-0.0112152099609375,
0.042449951171875,
-0.08416748046875,
-0.00836181640625,
0.02484130859375,
-0.0157928466796875,
0.0022678375244140625,
0.0145263671875,
-0.041412353515625,
0.0120697021484375,
0.00441741943359375,
-0.00882720947265625,
-0.046173095703125,
0.018463134765625,
0.0158843994140625,
-0.0364990234375,
-0.01971435546875,
-0.036590576171875,
0.0181121826171875,
-0.00799560546875,
-0.08221435546875,
-0.033599853515625,
-0.00731658935546875,
0.00611114501953125,
0.017303466796875,
-0.00675201416015625,
-0.0310516357421875,
-0.0084228515625,
0.026123046875,
-0.016937255859375,
0.0156402587890625,
0.0163421630859375,
0.0011320114135742188,
-0.033538818359375,
0.00678253173828125,
0.0026035308837890625,
0.04571533203125,
-0.005619049072265625,
-0.0185394287109375,
-0.000835418701171875,
0.017669677734375,
-0.023162841796875,
-0.00688934326171875,
0.0080413818359375,
-0.0227203369140625,
0.018829345703125,
-0.0109100341796875,
0.004268646240234375,
-0.0234375,
0.01389312744140625,
-0.0026721954345703125,
-0.027008056640625,
0.0223541259765625
] |
8e36d0d0d32f7eb018a733b05b204955bbad6ad6
|
Wordpress Stackexchange
Q: WP Editor strips input placeholder attribute Why WP Editor also strips the "placeholder" attribute of the input text element ?
Ofcourse, i am using the HTML mode.
Here is the input:
<input type="text" value="" name="s" style="width: 550px;" placeholder="Search this website..">
After updating the post (after strip):
<input type="text" value="" name="s" style="width: 550px;">
I do not want WP Editor to strip such attributes.
Any Help ?
A: The list of allowed elements and attributes is stored in the global variable $allowedposttags which is set in wp-includes/kses.php.
To override it create a simple mu plugin with the following content:
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Enable placeholder attribute for input elements in post tags.
* Version: 2012.07.18
*/
add_action( 'init', 'wpse_54829_register_placeholder' );
function wpse_54829_register_placeholder()
{
global $allowedposttags;
$default = empty ( $allowedposttags['input'] ) ? array () : $allowedposttags['input'];
$custom = array (
'placeholder' => TRUE,
'name' => TRUE,
'value' => TRUE,
'size' => TRUE,
'maxlength' => TRUE,
'type' => TRUE,
'required' => TRUE
);
$allowedposttags['input'] = array_merge( $default, $custom );
}
This post with the content <input placeholder="pass" required /> was created with an author account:
|
Q: WP Editor strips input placeholder attribute Why WP Editor also strips the "placeholder" attribute of the input text element ?
Ofcourse, i am using the HTML mode.
Here is the input:
<input type="text" value="" name="s" style="width: 550px;" placeholder="Search this website..">
After updating the post (after strip):
<input type="text" value="" name="s" style="width: 550px;">
I do not want WP Editor to strip such attributes.
Any Help ?
A: The list of allowed elements and attributes is stored in the global variable $allowedposttags which is set in wp-includes/kses.php.
To override it create a simple mu plugin with the following content:
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Enable placeholder attribute for input elements in post tags.
* Version: 2012.07.18
*/
add_action( 'init', 'wpse_54829_register_placeholder' );
function wpse_54829_register_placeholder()
{
global $allowedposttags;
$default = empty ( $allowedposttags['input'] ) ? array () : $allowedposttags['input'];
$custom = array (
'placeholder' => TRUE,
'name' => TRUE,
'value' => TRUE,
'size' => TRUE,
'maxlength' => TRUE,
'type' => TRUE,
'required' => TRUE
);
$allowedposttags['input'] = array_merge( $default, $custom );
}
This post with the content <input placeholder="pass" required /> was created with an author account:
A: You could use a shortcode! ;)
<?php
// desired output: <input type="text" value="" name="s" style="width: 550px;" placeholder="Search this website..">
// sc: [text_input name="s" style="width: 550px;" placeholder="Search this website.."]
add_shortcode('text_input','text_input_sc');
function text_input_sc($atts) {
// modify defaults as you wish
$defaults = array(
'id' => null,
'class' => null,
'value' => null,
'name' => null,
'size' => null,
'style' => null,
'placeholder' => null
);
$args = shortcode_atts($defaults, $atts);
$out = array();
foreach ($args as $attr => $value) {
if ( null !== $value )
$out[] = $attr.'="'.$value.'"';
}
$out = trim(implode(' ', $out));
if( !empty($out) )
$out = ' '.$out;
return vsprintf('<input type="text"%s>', $out);
}
Untested, but should definitely work!
|
wordpress
|
{
"language": "en",
"length": 299,
"provenance": "stackexchange_00019.jsonl.gz:420722",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54829"
}
|
[
0.034210205078125,
-0.027862548828125,
0.004329681396484375,
0.0190277099609375,
-0.0174407958984375,
-0.025787353515625,
0.05072021484375,
-0.02313232421875,
-0.0269317626953125,
0.0149993896484375,
-0.01715087890625,
-0.003162384033203125,
-0.034027099609375,
-0.033203125,
0.0078125,
-0.03271484375,
-0.0032367706298828125,
0.01190948486328125,
-0.01255035400390625,
-0.0284576416015625,
0.00013017654418945312,
-0.0165252685546875,
-0.038421630859375,
-0.0215606689453125,
0.0247955322265625,
-0.045501708984375,
0.0307159423828125,
-0.0021686553955078125,
-0.01172637939453125,
-0.02130126953125,
0.0198211669921875,
0.006988525390625,
0.024200439453125,
0.0494384765625,
-0.057861328125,
0.03948974609375,
0.0165252685546875,
0.00833892822265625,
-0.0013265609741210938,
0.027862548828125,
0.052764892578125,
-0.021820068359375,
-0.009002685546875,
0.004596710205078125,
-0.0266876220703125,
-0.0269317626953125,
0.0673828125,
0.00995635986328125,
0.039764404296875,
0.004638671875,
-0.0276947021484375,
0.036407470703125,
-0.016082763671875,
-0.060638427734375,
0.00026035308837890625,
0.01525115966796875,
-0.060211181640625,
-0.010467529296875,
0.0050201416015625,
0.1124267578125,
0.041900634765625,
-0.0093231201171875,
-0.019195556640625,
-0.055511474609375,
0.013153076171875,
-0.014801025390625,
0.033233642578125,
0.024993896484375,
-0.025604248046875,
0.0157012939453125,
0.035369873046875,
-0.02020263671875,
0.004398345947265625,
-0.00800323486328125,
-0.015655517578125,
-0.0225982666015625,
-0.0166778564453125,
-0.03656005859375,
0.0294189453125,
-0.006313323974609375,
0.014923095703125,
-0.00959014892578125,
0.00963592529296875,
-0.00897979736328125,
0.0175018310546875,
0.0197906494140625,
-0.01343536376953125,
-0.02105712890625,
-0.0134735107421875,
-0.037933349609375,
-0.00661468505859375,
0.004596710205078125,
-0.053497314453125,
-0.01532745361328125,
0.003643035888671875,
-0.057037353515625,
0.0223236083984375,
0.03363037109375,
-0.015411376953125,
-0.0118560791015625,
0.040924072265625,
-0.0570068359375,
0.042205810546875,
-0.0308837890625,
0.0233917236328125,
0.021728515625,
-0.0165252685546875,
0.0084991455078125,
0.033477783203125,
0.01033782958984375,
-0.021270751953125,
-0.006591796875,
-0.006816864013671875,
0.0118408203125,
-0.045013427734375,
0.00417327880859375,
-0.01436614990234375,
-0.00847625732421875,
-0.0262908935546875,
0.00948333740234375,
-0.0208740234375,
0.00104522705078125,
0.01824951171875,
-0.039794921875,
0.023101806640625,
-0.00464630126953125,
-0.00235748291015625,
-0.01043701171875,
-0.01442718505859375,
0.0269775390625,
-0.0277252197265625,
0.007091522216796875,
0.04644775390625,
0.0291290283203125,
0.015899658203125,
-0.01959228515625,
0.00913238525390625,
-0.042083740234375,
-0.046142578125,
0.048919677734375,
-0.0623779296875,
-0.01004791259765625,
0.041046142578125,
-0.06365966796875,
-0.006183624267578125,
0.01192474365234375,
0.01190185546875,
0.0129547119140625,
-0.0003879070281982422,
-0.076416015625,
0.051361083984375,
-0.07086181640625,
0.046234130859375,
0.0197601318359375,
-0.026153564453125,
-0.0094146728515625,
0.0516357421875,
-0.031585693359375,
-0.04736328125,
-0.0548095703125,
-0.00183868408203125,
-0.00882720947265625,
0.03533935546875,
-0.056976318359375,
-0.045135498046875,
-0.0036449432373046875,
-0.048187255859375,
-0.006633758544921875,
0.036224365234375,
0.0179290771484375,
0.0225067138671875,
0.036224365234375,
0.0570068359375,
0.0333251953125,
0.01849365234375,
0.000007808208465576172,
0.0019083023071289062,
-0.0004100799560546875,
0.005420684814453125,
0.042877197265625,
0.00011157989501953125,
-0.0251922607421875,
0.0396728515625,
-0.00626373291015625,
-0.068359375,
-0.006732940673828125,
-0.004116058349609375,
0.0250396728515625,
0.047271728515625,
0.005130767822265625,
0.054840087890625,
-0.028045654296875,
-0.0261688232421875,
-0.0138092041015625,
-0.0008211135864257812,
-0.006633758544921875,
-0.042572021484375,
-0.0258636474609375,
-0.006092071533203125,
0.030853271484375,
0.045562744140625,
-0.029754638671875,
-0.005645751953125,
-0.044219970703125,
-0.0758056640625,
-0.023223876953125,
-0.0229949951171875,
0.01983642578125,
-0.04345703125,
0.0023708343505859375,
0.034149169921875,
-0.0218963623046875,
-0.025146484375,
0.01070404052734375,
0.006107330322265625,
-0.00518798828125,
-0.00275421142578125,
0.042633056640625,
0.01035308837890625,
0.034637451171875,
0.032562255859375,
-0.04150390625,
0.031890869140625,
0.01617431640625,
0.0322265625,
-0.0018682479858398438,
-0.0028514862060546875,
-0.002521514892578125,
0.044677734375,
0.01462554931640625,
0.00579833984375,
0.0185699462890625,
0.0316162109375,
0.035064697265625,
-0.0282440185546875,
-0.02374267578125,
-0.0227203369140625,
-0.06561279296875,
0.004718780517578125,
0.06329345703125,
0.0302276611328125,
0.05499267578125,
-0.019805908203125,
0.0113067626953125,
0.0985107421875,
0.006496429443359375,
-0.0005412101745605469,
-0.003204345703125,
0.01503753662109375,
0.00841522216796875,
-0.0582275390625,
-0.005767822265625,
0.05078125,
-0.03448486328125,
0.02545166015625,
0.056976318359375,
-0.0295562744140625,
-0.0032215118408203125,
-0.0114593505859375,
-0.006137847900390625,
0.0004024505615234375,
-0.0277099609375,
0.01140594482421875,
-0.03607177734375,
0.056365966796875,
0.042999267578125,
0.0218048095703125,
0.0215911865234375,
-0.089111328125,
0.08123779296875,
0.033416748046875,
-0.038543701171875,
-0.0003361701965332031,
0.0056610107421875,
0.0218048095703125,
-0.0098724365234375,
-0.02593994140625,
0.0104522705078125,
0.033447265625,
-0.0014438629150390625,
-0.025115966796875,
-0.0164337158203125,
-0.00441741943359375,
-0.00278472900390625,
0.00972747802734375,
-0.053466796875,
0.03973388671875,
-0.0004940032958984375,
0.022430419921875,
-0.030426025390625,
0.0011091232299804688,
0.02056884765625,
-0.0231170654296875,
0.0443115234375,
0.0305633544921875,
-0.03558349609375,
-0.0229644775390625,
-0.057861328125,
0.03973388671875,
-0.034912109375,
0.051422119140625,
0.0792236328125,
-0.01558685302734375,
0.0247344970703125,
0.007129669189453125,
-0.0279083251953125,
0.0010805130004882812,
0.0085906982421875,
-0.00024127960205078125,
-0.0067138671875,
-0.055999755859375,
0.00867462158203125,
0.035308837890625,
0.0174713134765625,
0.01568603515625,
-0.011505126953125,
-0.0123443603515625,
0.054168701171875,
-0.040252685546875,
-0.0013399124145507812,
0.03509521484375,
-0.053253173828125,
-0.05743408203125,
0.0240478515625,
-0.05572509765625,
0.004795074462890625,
0.046478271484375,
-0.0218353271484375,
-0.024566650390625,
-0.004505157470703125,
-0.024383544921875,
-0.019134521484375,
-0.03631591796875,
0.001255035400390625,
-0.0106964111328125,
0.004730224609375,
0.006717681884765625,
0.06793212890625,
0.0126495361328125,
-0.0252532958984375,
0.0119171142578125,
-0.041290283203125,
-0.01389312744140625,
0.0028247833251953125,
0.0001087188720703125,
-0.0101776123046875,
0.0289764404296875,
0.0022068023681640625,
0.01953125,
0.048492431640625,
-0.021148681640625,
-0.00867462158203125,
-0.0063934326171875,
-0.0173797607421875,
0.0158538818359375,
0.056610107421875,
0.00910186767578125,
-0.0286407470703125,
0.04949951171875,
-0.054168701171875,
-0.0469970703125,
0.0157470703125,
-0.0401611328125,
-0.00736236572265625,
-0.00951385498046875,
0.00028514862060546875,
0.02490234375,
0.0223388671875,
0.016265869140625,
0.02386474609375,
0.04241943359375,
-0.0132293701171875,
-0.0120086669921875,
-0.01580810546875,
-0.005023956298828125,
-0.0311431884765625,
0.004566192626953125,
-0.032928466796875,
0.05157470703125,
0.0140838623046875,
-0.0060272216796875,
0.0292510986328125,
-0.03924560546875,
0.0235595703125,
-0.0258636474609375,
0.046966552734375,
-0.052032470703125,
-0.002994537353515625,
-0.0537109375,
-0.0107269287109375,
-0.0184478759765625,
0.046600341796875,
-0.0099639892578125,
-0.00997161865234375,
-0.038116455078125,
0.0014238357543945312,
-0.02069091796875,
-0.02691650390625,
0.00254058837890625,
0.020477294921875,
-0.054534912109375,
0.0157318115234375,
-0.0006775856018066406,
-0.02789306640625,
-0.0015897750854492188,
-0.05499267578125,
-0.032928466796875,
-0.040557861328125,
0.03045654296875,
-0.046966552734375,
-0.0029850006103515625,
0.003078460693359375,
-0.00482177734375,
-0.0311431884765625,
-0.0157928466796875,
-0.03558349609375,
-0.0926513671875,
-0.008148193359375,
-0.020904541015625,
0.032745361328125,
-0.00771331787109375,
-0.0014142990112304688,
-0.031982421875,
0.0321044921875,
0.025665283203125,
-0.016448974609375,
0.03631591796875,
-0.00617218017578125,
-0.026519775390625,
-0.0010833740234375,
0.017730712890625,
-0.036102294921875,
-0.01080322265625,
-0.0023021697998046875,
-0.031494140625,
0.0007333755493164062,
-0.011383056640625,
-0.05712890625,
0.045867919921875,
-0.039215087890625,
0.0017251968383789062,
-0.0233917236328125,
-0.035797119140625,
0.00888824462890625,
-0.045928955078125,
0.010772705078125,
-0.025238037109375,
-0.0194244384765625,
0.07000732421875,
-0.008941650390625,
0.00855255126953125,
-0.00624847412109375,
0.1016845703125,
0.00902557373046875,
-0.0168914794921875,
-0.0252685546875,
-0.01959228515625,
0.0234527587890625,
0.0445556640625,
0.0029850006103515625,
-0.0274658203125,
-0.008270263671875,
0.006443023681640625,
0.006683349609375,
0.0211944580078125,
-0.0186614990234375,
0.00909423828125,
-0.00496673583984375,
-0.0106964111328125,
0.006317138671875,
0.015960693359375,
0.01493072509765625,
0.024322509765625,
0.020904541015625,
-0.0192413330078125,
0.047454833984375,
0.027069091796875,
-0.022308349609375,
-0.0240325927734375,
-0.0225372314453125,
-0.0294952392578125,
-0.002391815185546875,
0.016876220703125,
0.04498291015625,
0.035247802734375,
-0.004009246826171875,
0.0269775390625,
0.0168609619140625,
-0.00745391845703125,
-0.037261962890625,
-0.042755126953125,
-0.0034999847412109375,
0.0113983154296875,
0.0001512765884399414,
0.01303863525390625,
-0.01438140869140625,
-0.005413055419921875,
-0.0036029815673828125,
-0.00969696044921875,
-0.0296630859375,
-0.0306396484375,
-0.00475311279296875,
0.0562744140625,
0.0182342529296875,
0.0002340078353881836,
0.02490234375,
0.0253753662109375,
-0.0032806396484375,
0.0175628662109375,
0.01552581787109375,
-0.008514404296875,
-0.0283660888671875,
-0.0307769775390625,
-0.00395965576171875,
-0.0257110595703125,
-0.0295562744140625,
0.009063720703125,
0.00008845329284667969,
-0.0282440185546875,
-0.00677490234375,
0.023529052734375,
0.0283355712890625,
0.03936767578125,
0.007732391357421875,
-0.008270263671875,
-0.03485107421875,
0.0311126708984375,
0.0020904541015625,
-0.045623779296875,
-0.04241943359375,
0.0163116455078125,
0.0295867919921875,
-0.0023479461669921875,
0.003345489501953125,
0.0223388671875,
0.01265716552734375,
0.00605010986328125,
0.011016845703125,
-0.0277099609375,
-0.07342529296875,
0.0186767578125,
0.0355224609375,
-0.00464630126953125,
-0.05633544921875,
0.00524139404296875,
-0.0240936279296875,
-0.011505126953125,
-0.011505126953125,
0.030975341796875,
-0.044586181640625,
0.0018453598022460938,
0.00015234947204589844,
0.0037174224853515625,
0.0175018310546875,
-0.0252685546875,
-0.04498291015625,
-0.041656494140625,
0.0006647109985351562,
-0.00341033935546875,
0.04718017578125,
-0.0266571044921875,
0.00800323486328125,
-0.0287933349609375,
0.0117034912109375,
-0.0199432373046875,
0.00820159912109375,
0.037353515625,
-0.0011501312255859375,
-0.0245208740234375,
0.006992340087890625,
-0.03509521484375,
-0.0168914794921875,
-0.00395965576171875,
-0.0009860992431640625,
-0.02911376953125,
-0.0180816650390625,
0.00154876708984375,
0.01189422607421875,
-0.02044677734375,
-0.019073486328125,
0.0174102783203125,
0.04388427734375,
0.007091522216796875,
0.06280517578125,
-0.07122802734375,
0.046539306640625,
0.01165771484375,
0.013214111328125,
-0.041351318359375,
-0.0189971923828125,
0.03204345703125,
0.01398468017578125,
0.01332855224609375,
-0.063720703125,
-0.060150146484375,
-0.0171966552734375,
-0.047637939453125,
0.048095703125,
0.05889892578125,
-0.00940704345703125,
-0.01209259033203125,
-0.007343292236328125,
-0.003780364990234375,
-0.01312255859375,
0.053466796875,
-0.00714874267578125,
-0.00734710693359375,
-0.0038604736328125,
-0.026519775390625,
-0.012176513671875,
0.014312744140625,
0.004680633544921875,
0.0008292198181152344,
-0.00859832763671875,
0.005096435546875,
0.0086669921875,
-0.007167816162109375,
0.0135650634765625,
0.06298828125,
-0.020721435546875,
0.0345458984375,
0.0233612060546875,
0.01256561279296875,
0.046905517578125,
0.0021305084228515625,
-0.033294677734375,
-0.02874755859375,
0.038848876953125,
0.02349853515625,
-0.006740570068359375,
0.06219482421875,
-0.009246826171875,
0.0186004638671875,
0.04437255859375,
0.06719970703125,
-0.07293701171875,
0.0160675048828125,
0.0279998779296875,
-0.0264434814453125,
0.0163421630859375,
-0.00736236572265625,
0.00395965576171875,
-0.01171875,
-0.002574920654296875,
0.00991058349609375,
-0.029632568359375,
-0.0115966796875,
0.0183563232421875,
0.005367279052734375,
0.00032591819763183594,
0.09356689453125,
0.015716552734375,
-0.0263824462890625,
-0.038360595703125,
0.0018663406372070312,
-0.013031005859375,
-0.00740814208984375,
0.0032253265380859375,
-0.0258331298828125,
-0.047149658203125,
-0.07672119140625,
-0.0616455078125,
-0.012542724609375,
-0.030181884765625,
0.033782958984375,
0.015869140625,
0.037200927734375,
0.0321044921875,
0.0178070068359375,
-0.0143585205078125,
0.00027871131896972656,
-0.00885009765625,
0.0160064697265625,
-0.03924560546875,
-0.007038116455078125,
0.033660888671875,
0.00933074951171875,
0.025177001953125,
0.037109375,
-0.03564453125,
-0.007965087890625,
0.00920867919921875,
0.05194091796875,
0.014739990234375,
-0.0477294921875,
0.0257720947265625,
0.0120697021484375,
-0.01334381103515625,
-0.0274658203125,
-0.052459716796875,
-0.08197021484375,
-0.063232421875,
-0.044219970703125,
-0.0877685546875,
0.035430908203125,
-0.031494140625,
-0.08123779296875,
0.134521484375,
0.0667724609375,
0.03643798828125,
0.006175994873046875,
0.05462646484375,
-0.07183837890625,
0.016143798828125,
-0.0230255126953125,
-0.003986358642578125,
-0.0210723876953125,
0.0283660888671875,
-0.01995849609375,
0.01061248779296875,
0.002147674560546875,
-0.0019273757934570312,
0.01434326171875,
0.0110321044921875,
-0.00627899169921875,
-0.00525665283203125,
0.0259552001953125,
0.0372314453125,
-0.0077972412109375,
0.00885772705078125,
0.013153076171875,
0.04290771484375,
0.056182861328125,
-0.06182861328125,
0.0172882080078125,
-0.0225830078125,
0.02801513671875,
0.027740478515625,
0.0027332305908203125,
-0.0002739429473876953,
0.0205230712890625,
-0.04217529296875,
-0.03155517578125,
0.0113525390625,
0.01763916015625,
-0.00972747802734375,
0.0006308555603027344,
0.03668212890625,
0.059783935546875,
-0.052886962890625,
-0.0479736328125,
-0.0207366943359375,
0.051177978515625,
0.035186767578125,
0.0132598876953125,
0.041717529296875,
0.00926971435546875,
0.04461669921875,
0.029266357421875,
0.0237579345703125,
0.037933349609375,
0.02960205078125,
-0.02984619140625,
-0.005489349365234375,
0.0004162788391113281,
-0.0165252685546875,
0.036468505859375,
0.0458984375,
-0.0099029541015625,
-0.0173797607421875,
-0.025604248046875,
0.01088714599609375,
0.013092041015625,
0.00847625732421875,
-0.0181427001953125,
0.022613525390625,
-0.03369140625,
0.006778717041015625,
-0.0187225341796875,
0.0115966796875,
0.0347900390625,
-0.0117340087890625,
0.0174713134765625,
0.0594482421875,
-0.0276641845703125,
0.0166473388671875,
-0.031585693359375,
-0.059478759765625,
0.0175933837890625,
0.058135986328125,
0.05145263671875,
0.034515380859375,
0.04754638671875,
-0.03472900390625,
-0.0193634033203125,
0.0160980224609375,
0.00595855712890625,
0.0266571044921875,
-0.0187225341796875,
0.00753021240234375,
0.01070404052734375,
0.025238037109375,
-0.0003170967102050781,
0.01207733154296875,
0.036651611328125,
-0.004840850830078125,
-0.08026123046875,
-0.00787353515625,
0.0182647705078125,
-0.04730224609375,
-0.036590576171875,
-0.003810882568359375,
-0.0034847259521484375,
0.041473388671875,
-0.0021114349365234375,
0.00983428955078125,
0.01898193359375,
0.031707763671875,
0.022552490234375,
0.0015802383422851562,
0.010833740234375,
-0.0220794677734375,
0.0172119140625,
0.004253387451171875,
0.01983642578125,
0.0523681640625,
-0.0665283203125,
-0.00670623779296875,
-0.01195526123046875,
-0.039703369140625,
0.0195465087890625,
0.0299224853515625,
-0.048095703125,
0.061187744140625,
0.00013005733489990234,
-0.0516357421875,
0.006381988525390625,
0.03143310546875,
0.022857666015625,
0.047760009765625,
-0.01195526123046875,
0.006557464599609375,
-0.058380126953125,
-0.022705078125,
0.0100250244140625,
0.00980377197265625,
-0.0230560302734375,
0.0792236328125,
-0.0122222900390625,
-0.01551055908203125,
-0.009002685546875,
0.042083740234375,
-0.048370361328125,
-0.01617431640625,
0.0343017578125,
0.009521484375,
0.0133209228515625,
-0.01424407958984375,
0.006591796875,
0.039703369140625,
0.003612518310546875,
-0.013275146484375,
0.02142333984375,
-0.0225982666015625,
0.0150604248046875,
0.00977325439453125,
0.0423583984375,
-0.016998291015625,
-0.060699462890625,
-0.0274658203125,
0.0088958740234375,
0.007205963134765625,
0.05426025390625,
0.0186920166015625,
0.0186920166015625,
-0.033294677734375,
-0.014251708984375,
0.022918701171875,
-0.0322265625,
-0.00278472900390625,
0.01806640625,
-0.0119781494140625,
-0.023345947265625,
0.039459228515625,
-0.01406097412109375,
-0.016510009765625,
0.04156494140625,
0.012786865234375,
0.017974853515625,
-0.02252197265625,
0.050140380859375,
0.044677734375,
0.05706787109375,
0.007720947265625,
0.0098114013671875,
0.02716064453125,
0.0002624988555908203,
-0.007144927978515625,
-0.062347412109375,
-0.023345947265625,
-0.040069580078125,
-0.00786590576171875,
0.0302581787109375,
-0.032623291015625,
-0.05865478515625,
-0.059539794921875,
0.01335906982421875,
0.00691986083984375,
-0.0087127685546875,
-0.02197265625,
-0.004604339599609375,
-0.00789642333984375,
0.050201416015625,
-0.023834228515625,
-0.0160369873046875,
-0.01161956787109375,
0.01776123046875,
-0.034912109375,
-0.0225830078125,
-0.058319091796875,
0.0230560302734375,
-0.05218505859375,
0.0328369140625,
0.041168212890625,
-0.0325927734375,
-0.03814697265625,
0.0228729248046875,
0.01532745361328125,
0.05120849609375,
0.01009368896484375,
-0.0250701904296875,
0.03082275390625,
0.019134521484375,
-0.0211639404296875,
-0.10791015625,
-0.0237884521484375,
-0.065673828125,
0.047393798828125,
-0.02056884765625,
0.005672454833984375,
0.0036945343017578125,
-0.053253173828125,
-0.0933837890625,
0.048248291015625,
-0.018280029296875,
-0.038482666015625,
0.029327392578125,
0.001476287841796875,
-0.006084442138671875,
0.02398681640625,
0.03289794921875,
-0.0218048095703125,
-0.0073394775390625,
-0.0278472900390625,
-0.01800537109375,
0.008544921875,
0.0106353759765625,
-0.01508331298828125,
-0.06243896484375,
-0.013275146484375,
-0.0009737014770507812,
-0.0268402099609375,
0.013427734375,
0.00963592529296875,
0.00933837890625,
0.044952392578125,
-0.019744873046875,
0.01153564453125,
-0.01824951171875,
-0.022705078125,
0.0172576904296875,
-0.036102294921875,
-0.057403564453125,
-0.032379150390625,
0.05322265625,
0.0565185546875,
0.0139312744140625,
-0.024444580078125,
0.021942138671875,
0.006328582763671875,
-0.0296630859375,
-0.005084991455078125,
0.01486968994140625,
-0.045745849609375,
-0.0122222900390625,
0.0103912353515625,
0.01457977294921875,
0.0039215087890625,
-0.0008549690246582031,
-0.00628662109375,
-0.028289794921875,
0.01198577880859375,
0.01336669921875,
-0.04998779296875,
0.025390625,
0.0013484954833984375,
-0.024932861328125,
-0.0299835205078125,
-0.02947998046875,
0.007465362548828125,
-0.0276947021484375,
-0.06085205078125,
-0.0129241943359375,
-0.00389862060546875,
-0.01763916015625,
0.004505157470703125,
-0.004215240478515625,
0.029815673828125,
-0.01334381103515625,
-0.0030879974365234375,
-0.0188446044921875,
0.00882720947265625,
0.006374359130859375,
0.0172882080078125,
-0.0265655517578125,
0.00031375885009765625,
0.00988006591796875,
0.0072021484375,
-0.02886962890625,
-0.06353759765625,
-0.035614013671875,
0.01776123046875,
0.03021240234375,
0.006862640380859375,
0.06231689453125,
-0.0067596435546875,
0.0208892822265625,
0.004184722900390625,
0.01396942138671875,
-0.0187225341796875,
0.02783203125,
-0.023712158203125,
-0.00021219253540039062,
0.006488800048828125
] |
ab951e9ab32b2f4da0b5ac2f77cd85e845a2b999
|
Wordpress Stackexchange
Q: Post/Page Preview Template Is there a way to have a custom template php file that is only used for previews instead of it using the single.php file? This way the user knows they are in preview mode?
A: You could use the conditional is_preview() to add a bit of extra content.
For instance, you could put this at the very top of your single.php right after the header is called - or you could put it in your header.php file if you want it shown at the very top of the page:
<?php
if ( is_preview() ) { ?>
<div>You're viewing a preview</div>
<?php } ?>
Hope this helps, best of luck!
|
Q: Post/Page Preview Template Is there a way to have a custom template php file that is only used for previews instead of it using the single.php file? This way the user knows they are in preview mode?
A: You could use the conditional is_preview() to add a bit of extra content.
For instance, you could put this at the very top of your single.php right after the header is called - or you could put it in your header.php file if you want it shown at the very top of the page:
<?php
if ( is_preview() ) { ?>
<div>You're viewing a preview</div>
<?php } ?>
Hope this helps, best of luck!
|
wordpress
|
{
"language": "en",
"length": 113,
"provenance": "stackexchange_00019.jsonl.gz:420740",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54886"
}
|
[
0.054229736328125,
0.0024051666259765625,
0.036224365234375,
-0.0692138671875,
0.00574493408203125,
0.00408172607421875,
0.002086639404296875,
-0.0218963623046875,
-0.00656890869140625,
0.00603485107421875,
-0.030914306640625,
-0.01355743408203125,
-0.02508544921875,
-0.0281829833984375,
0.0110931396484375,
-0.049468994140625,
0.03167724609375,
-0.004047393798828125,
0.031768798828125,
-0.0011167526245117188,
0.024383544921875,
0.0289764404296875,
0.01531219482421875,
0.02490234375,
0.00013828277587890625,
-0.0028972625732421875,
0.052947998046875,
-0.022552490234375,
-0.016387939453125,
-0.036163330078125,
-0.0008025169372558594,
0.03863525390625,
0.05340576171875,
0.010772705078125,
-0.046478271484375,
0.0288238525390625,
-0.003162384033203125,
-0.0026493072509765625,
-0.0072479248046875,
0.0222625732421875,
0.00968170166015625,
0.0023040771484375,
-0.02655029296875,
0.006946563720703125,
-0.034332275390625,
-0.003337860107421875,
-0.016265869140625,
-0.045806884765625,
0.016754150390625,
-0.0024776458740234375,
0.0208282470703125,
-0.042572021484375,
0.0244140625,
0.00514984130859375,
-0.02020263671875,
-0.00012922286987304688,
-0.013336181640625,
0.01483917236328125,
0.0277099609375,
-0.01617431640625,
-0.037200927734375,
0.00540924072265625,
0.01983642578125,
0.000028312206268310547,
-0.016632080078125,
-0.007659912109375,
-0.0304412841796875,
0.010406494140625,
0.009796142578125,
-0.024627685546875,
0.005855560302734375,
-0.0068511962890625,
0.0216064453125,
-0.0689697265625,
-0.0118560791015625,
0.0242156982421875,
-0.0048828125,
-0.02703857421875,
-0.0012416839599609375,
-0.0196380615234375,
-0.01113128662109375,
0.00202178955078125,
-0.0316162109375,
-0.063720703125,
0.032257080078125,
-0.0297088623046875,
-0.01617431640625,
0.0020236968994140625,
0.0024929046630859375,
-0.0021572113037109375,
-0.029754638671875,
0.0115509033203125,
0.02349853515625,
-0.0157470703125,
-0.048828125,
-0.001552581787109375,
-0.0185394287109375,
0.0194091796875,
0.0061798095703125,
0.01548004150390625,
0.011016845703125,
-0.029815673828125,
0.02142333984375,
-0.042510986328125,
0.027435302734375,
0.048492431640625,
-0.017608642578125,
-0.0130767822265625,
0.05291748046875,
0.015777587890625,
0.019866943359375,
0.0157623291015625,
-0.036285400390625,
-0.035308837890625,
-0.03485107421875,
0.0305328369140625,
-0.0340576171875,
-0.017547607421875,
0.0008902549743652344,
0.00860595703125,
0.033935546875,
0.0443115234375,
0.0287322998046875,
-0.041595458984375,
0.005695343017578125,
-0.004650115966796875,
-0.0252532958984375,
-0.044677734375,
-0.0210418701171875,
0.01398468017578125,
0.004665374755859375,
0.0051422119140625,
-0.01300048828125,
0.029510498046875,
-0.01273345947265625,
-0.00922393798828125,
0.0179595947265625,
0.0318603515625,
-0.0008187294006347656,
-0.01470184326171875,
0.00467681884765625,
0.0027179718017578125,
0.00164794921875,
-0.0217132568359375,
-0.029083251953125,
0.00933837890625,
0.017974853515625,
0.03314208984375,
-0.00865936279296875,
-0.050201416015625,
0.0118255615234375,
-0.0012159347534179688,
-0.0172271728515625,
0.004726409912109375,
0.0347900390625,
-0.0210113525390625,
-0.0222015380859375,
0.006282806396484375,
0.040283203125,
0.0322265625,
0.035064697265625,
-0.007450103759765625,
-0.03814697265625,
-0.03277587890625,
-0.046630859375,
0.00980377197265625,
-0.032257080078125,
0.004802703857421875,
0.016448974609375,
-0.0010251998901367188,
-0.01004791259765625,
-0.025482177734375,
-0.00555419921875,
0.0298919677734375,
0.00864410400390625,
0.040252685546875,
0.0201263427734375,
0.0171356201171875,
-0.00777435302734375,
0.037811279296875,
-0.00809478759765625,
-0.0345458984375,
0.03167724609375,
-0.036163330078125,
-0.05859375,
0.033172607421875,
-0.0063934326171875,
0.056732177734375,
0.02685546875,
0.0120849609375,
0.0219268798828125,
0.0008449554443359375,
-0.01413726806640625,
0.0228729248046875,
0.006557464599609375,
-0.0222015380859375,
-0.0161285400390625,
0.00632476806640625,
-0.012054443359375,
-0.0107574462890625,
-0.0240325927734375,
-0.0258026123046875,
0.0200042724609375,
-0.014801025390625,
-0.033233642578125,
0.00768280029296875,
-0.032257080078125,
0.03240966796875,
-0.0312042236328125,
0.010467529296875,
0.0169525146484375,
-0.01226806640625,
-0.0090179443359375,
-0.006778717041015625,
-0.0287933349609375,
0.0019702911376953125,
0.01369476318359375,
0.03546142578125,
0.0285797119140625,
0.01345062255859375,
0.0159149169921875,
0.0093231201171875,
0.0033721923828125,
0.001556396484375,
0.042236328125,
-0.00011289119720458984,
-0.02520751953125,
-0.0004143714904785156,
0.003459930419921875,
0.00966644287109375,
-0.032135009765625,
0.047760009765625,
-0.009552001953125,
-0.01137542724609375,
-0.01435089111328125,
0.01507568359375,
0.008056640625,
-0.0665283203125,
0.0002803802490234375,
0.0361328125,
-0.004985809326171875,
-0.0041351318359375,
-0.00787353515625,
0.064453125,
0.038604736328125,
0.007350921630859375,
0.0214691162109375,
0.0321044921875,
0.035919189453125,
0.01004791259765625,
-0.029388427734375,
-0.0243072509765625,
0.03680419921875,
-0.07281494140625,
0.042236328125,
0.023162841796875,
-0.006046295166015625,
-0.00360107421875,
-0.01226806640625,
0.036834716796875,
0.001796722412109375,
0.084716796875,
0.0306549072265625,
0.0166778564453125,
0.03338623046875,
-0.0116119384765625,
0.056854248046875,
0.032989501953125,
0.01369476318359375,
-0.034149169921875,
-0.02606201171875,
0.001773834228515625,
0.0102691650390625,
0.0170745849609375,
-0.0082855224609375,
0.031341552734375,
-0.0095977783203125,
-0.02337646484375,
0.0177459716796875,
0.00702667236328125,
-0.02203369140625,
0.02581787109375,
-0.0166778564453125,
-0.0207061767578125,
-0.0164642333984375,
-0.059661865234375,
-0.00516510009765625,
-0.023223876953125,
0.0015411376953125,
0.031951904296875,
0.052154541015625,
0.0160980224609375,
-0.0380859375,
0.02813720703125,
-0.017425537109375,
-0.0247344970703125,
-0.01397705078125,
-0.06817626953125,
0.04095458984375,
-0.04180908203125,
0.03375244140625,
0.08544921875,
0.0014171600341796875,
0.025482177734375,
-0.004856109619140625,
-0.0026340484619140625,
0.01259613037109375,
-0.00704193115234375,
-0.0228424072265625,
-0.018280029296875,
-0.038055419921875,
-0.0179901123046875,
0.005405426025390625,
0.07440185546875,
-0.0300750732421875,
-0.042449951171875,
0.0107421875,
0.01323699951171875,
0.0117034912109375,
-0.015106201171875,
0.0079498291015625,
-0.054962158203125,
0.006328582763671875,
-0.03485107421875,
-0.0302734375,
-0.00545501708984375,
-0.024383544921875,
0.0171356201171875,
-0.00852203369140625,
-0.0382080078125,
-0.0254974365234375,
-0.06048583984375,
-0.060150146484375,
0.00412750244140625,
0.017303466796875,
0.006168365478515625,
0.0000553131103515625,
0.058685302734375,
0.01519775390625,
-0.03826904296875,
-0.0119476318359375,
0.0084075927734375,
-0.0137481689453125,
-0.0210113525390625,
0.0196685791015625,
-0.0131072998046875,
-0.0236968994140625,
0.0265350341796875,
-0.058929443359375,
-0.016693115234375,
-0.01171875,
-0.042236328125,
-0.037506103515625,
0.01052093505859375,
-0.0169219970703125,
0.066650390625,
0.060455322265625,
-0.0006880760192871094,
0.0151824951171875,
-0.04058837890625,
-0.0226593017578125,
-0.01457977294921875,
-0.07623291015625,
-0.0281219482421875,
0.08258056640625,
-0.0249481201171875,
-0.040313720703125,
-0.02752685546875,
0.008880615234375,
0.016265869140625,
-0.02239990234375,
-0.00714874267578125,
0.048126220703125,
0.0177154541015625,
0.042144775390625,
0.0028591156005859375,
-0.0171966552734375,
-0.03021240234375,
0.059295654296875,
0.003910064697265625,
0.037078857421875,
0.0289459228515625,
-0.0184326171875,
-0.0172119140625,
-0.052093505859375,
0.0341796875,
-0.0233612060546875,
0.03851318359375,
-0.060760498046875,
-0.027374267578125,
-0.01035308837890625,
0.11444091796875,
-0.0787353515625,
-0.0016651153564453125,
0.01148223876953125,
0.003459930419921875,
-0.00223541259765625,
0.011688232421875,
-0.06646728515625,
-0.01158905029296875,
-0.052215576171875,
0.028045654296875,
-0.003856658935546875,
-0.0250396728515625,
-0.03143310546875,
-0.0085296630859375,
-0.043243408203125,
-0.0264129638671875,
0.0235595703125,
-0.0178375244140625,
0.00986480712890625,
0.041107177734375,
0.0010976791381835938,
0.01081085205078125,
-0.007598876953125,
-0.051177978515625,
-0.0428466796875,
0.0019073486328125,
-0.0212860107421875,
0.00649261474609375,
0.0197296142578125,
-0.016510009765625,
-0.014984130859375,
0.0125579833984375,
0.042022705078125,
0.021453857421875,
0.0173797607421875,
-0.026641845703125,
0.02581787109375,
0.0018205642700195312,
0.0306243896484375,
-0.0136260986328125,
-0.0160064697265625,
-0.002971649169921875,
-0.004192352294921875,
0.0188140869140625,
-0.0217132568359375,
-0.0216064453125,
0.024932861328125,
-0.020111083984375,
-0.06219482421875,
-0.04351806640625,
0.016632080078125,
0.041259765625,
-0.0015039443969726562,
0.0194244384765625,
-0.040771484375,
-0.055999755859375,
0.0065765380859375,
0.00930023193359375,
-0.0276641845703125,
0.01114654541015625,
0.04254150390625,
0.036712646484375,
-0.01385498046875,
-0.016204833984375,
0.046417236328125,
0.06610107421875,
0.007350921630859375,
0.0029964447021484375,
0.01029205322265625,
-0.05059814453125,
0.071044921875,
0.033477783203125,
-0.025634765625,
-0.03466796875,
0.08551025390625,
-0.0035343170166015625,
-0.04248046875,
0.0450439453125,
-0.028472900390625,
0.0194244384765625,
0.020751953125,
-0.01412200927734375,
-0.0240631103515625,
-0.00237274169921875,
0.053375244140625,
-0.0245208740234375,
0.02911376953125,
-0.0447998046875,
-0.0129241943359375,
-0.01007080078125,
0.0117645263671875,
0.0302276611328125,
0.039703369140625,
-0.00749969482421875,
0.02880859375,
0.02447509765625,
-0.006595611572265625,
0.0345458984375,
0.007671356201171875,
0.01349639892578125,
0.0004856586456298828,
0.046142578125,
-0.0034332275390625,
-0.0006852149963378906,
-0.005859375,
0.0214996337890625,
0.04229736328125,
-0.0302581787109375,
-0.0131378173828125,
-0.00014603137969970703,
0.007511138916015625,
-0.0523681640625,
0.03314208984375,
0.01514434814453125,
-0.01406097412109375,
0.008544921875,
0.02154541015625,
0.0220489501953125,
-0.0022411346435546875,
-0.010467529296875,
-0.042999267578125,
0.011962890625,
-0.03778076171875,
0.0531005859375,
-0.01091766357421875,
-0.01708984375,
0.00812530517578125,
-0.00559234619140625,
0.041259765625,
0.09576416015625,
-0.038665771484375,
0.005970001220703125,
0.0631103515625,
-0.0185089111328125,
-0.052703857421875,
0.0169525146484375,
-0.02459716796875,
-0.0138397216796875,
-0.01302337646484375,
0.00766754150390625,
-0.0038585662841796875,
-0.00152587890625,
0.046600341796875,
-0.0048370361328125,
0.0021724700927734375,
0.019195556640625,
-0.00318145751953125,
-0.05438232421875,
-0.0166168212890625,
0.036041259765625,
0.0126190185546875,
-0.0247039794921875,
-0.0190582275390625,
0.0018568038940429688,
-0.015655517578125,
0.019744873046875,
0.00061798095703125,
-0.041656494140625,
0.0220794677734375,
0.02313232421875,
-0.03289794921875,
-0.004100799560546875,
0.0215911865234375,
-0.06597900390625,
-0.01422882080078125,
-0.03338623046875,
-0.0258636474609375,
0.045379638671875,
-0.017608642578125,
-0.002227783203125,
-0.020263671875,
-0.00478363037109375,
-0.04815673828125,
0.0248260498046875,
0.0268096923828125,
0.006153106689453125,
-0.0770263671875,
-0.0160369873046875,
-0.0765380859375,
-0.021209716796875,
-0.046875,
-0.0528564453125,
-0.048980712890625,
0.020721435546875,
0.00670623779296875,
0.02508544921875,
-0.00921630859375,
-0.016265869140625,
-0.0252685546875,
0.0372314453125,
0.01983642578125,
0.1002197265625,
-0.00180816650390625,
0.0577392578125,
0.0139617919921875,
0.07855224609375,
0.0256195068359375,
0.0298614501953125,
-0.0232086181640625,
-0.040374755859375,
0.0215911865234375,
-0.005535125732421875,
-0.0178070068359375,
-0.026153564453125,
0.0034770965576171875,
-0.024017333984375,
0.00971221923828125,
-0.016265869140625,
-0.00449371337890625,
-0.032745361328125,
0.01006317138671875,
-0.032684326171875,
0.017059326171875,
-0.050933837890625,
-0.053802490234375,
-0.01197052001953125,
0.0131683349609375,
0.0131683349609375,
0.0004055500030517578,
-0.0135345458984375,
0.005161285400390625,
0.01751708984375,
0.00890350341796875,
-0.04217529296875,
-0.040374755859375,
0.046661376953125,
0.08074951171875,
0.01415252685546875,
0.06622314453125,
0.0308990478515625,
0.034454345703125,
0.04522705078125,
-0.00753021240234375,
0.0003619194030761719,
-0.036712646484375,
0.01629638671875,
-0.0129547119140625,
-0.0046234130859375,
0.0132293701171875,
-0.00852203369140625,
0.01078033447265625,
0.08154296875,
0.035491943359375,
-0.11309814453125,
0.001739501953125,
-0.0242462158203125,
0.00695037841796875,
0.041290283203125,
-0.019805908203125,
-0.0093231201171875,
-0.035186767578125,
0.080322265625,
0.01421356201171875,
-0.0016260147094726562,
0.045135498046875,
-0.003414154052734375,
0.0123291015625,
-0.0243988037109375,
0.052947998046875,
0.00701141357421875,
-0.0157623291015625,
-0.0017194747924804688,
0.00714874267578125,
0.0140228271484375,
-0.011993408203125,
0.004436492919921875,
-0.007427215576171875,
-0.01065826416015625,
-0.00571441650390625,
0.0198822021484375,
-0.032470703125,
0.00090789794921875,
0.04730224609375,
0.020355224609375,
0.004825592041015625,
0.051727294921875,
-0.0279388427734375,
0.0458984375,
0.0018930435180664062,
-0.0043487548828125,
-0.032379150390625,
-0.0227203369140625,
0.01326751708984375,
0.001712799072265625,
-0.0364990234375,
0.02471923828125,
-0.0239105224609375,
-0.042938232421875,
0.0125274658203125,
0.0565185546875,
0.06671142578125,
-0.018829345703125,
-0.0413818359375,
0.0400390625,
-0.035003662109375,
-0.0210723876953125,
-0.00415802001953125,
0.019439697265625,
-0.0355224609375,
-0.007320404052734375,
0.0003414154052734375,
-0.01450347900390625,
-0.02032470703125,
-0.0108489990234375,
-0.08221435546875,
0.05908203125,
0.03204345703125,
0.0396728515625,
0.013092041015625,
0.0203704833984375,
-0.060577392578125,
-0.021240234375,
-0.01116180419921875,
0.045562744140625,
0.0374755859375,
0.04669189453125,
0.0017080307006835938,
-0.005207061767578125,
0.029296875,
0.0423583984375,
0.040283203125,
0.01177215576171875,
0.031829833984375,
0.03369140625,
0.05999755859375,
0.00801849365234375,
-0.034515380859375,
-0.0002675056457519531,
-0.002521514892578125,
-0.0018186569213867188,
-0.0086822509765625,
-0.0205535888671875,
0.02691650390625,
-0.01983642578125,
-0.01491546630859375,
0.0170745849609375,
0.030059814453125,
0.036651611328125,
0.0258331298828125,
0.0335693359375,
-0.1070556640625,
0.02606201171875,
0.085693359375,
0.005771636962890625,
-0.004673004150390625,
0.018096923828125,
0.021881103515625,
-0.006824493408203125,
-0.0006504058837890625,
-0.02593994140625,
0.03570556640625,
0.0239410400390625,
0.0205841064453125,
0.01094818115234375,
0.0095367431640625,
-0.01837158203125,
-0.0152740478515625,
0.01259613037109375,
0.03302001953125,
-0.03228759765625,
0.0280303955078125,
0.021820068359375,
0.0078277587890625,
-0.02386474609375,
0.017578125,
0.006206512451171875,
0.03143310546875,
-0.0296630859375,
-0.0032672882080078125,
0.00978851318359375,
-0.0112152099609375,
-0.007434844970703125,
-0.021240234375,
0.0093841552734375,
0.039581298828125,
0.00896453857421875,
-0.01436614990234375,
-0.025604248046875,
0.01059722900390625,
0.01329803466796875,
0.00623321533203125,
-0.00965118408203125,
0.0129852294921875,
-0.018798828125,
-0.044891357421875,
0.004001617431640625,
0.00917816162109375,
0.041961669921875,
0.029632568359375,
0.043182373046875,
0.01561737060546875,
-0.023773193359375,
-0.01401519775390625,
0.004241943359375,
-0.0237884521484375,
0.01274871826171875,
-0.0318603515625,
-0.0212249755859375,
0.005950927734375,
0.038970947265625,
-0.0295562744140625,
-0.0259552001953125,
-0.00794219970703125,
-0.0013713836669921875,
-0.03607177734375,
-0.01947021484375,
0.0283050537109375,
-0.035003662109375,
0.03228759765625,
-0.05157470703125,
0.009735107421875,
0.003082275390625,
-0.0179443359375,
-0.00009757280349731445,
-0.04400634765625,
0.072998046875,
-0.06109619140625,
0.04205322265625,
-0.0160675048828125,
-0.0372314453125,
0.0430908203125,
-0.034759521484375,
0.04095458984375,
-0.035797119140625,
-0.0308685302734375,
0.00229644775390625,
-0.021484375,
-0.054229736328125,
0.03564453125,
0.05096435546875,
-0.0181732177734375,
0.015350341796875,
0.0207672119140625,
0.054962158203125,
-0.0052337646484375,
-0.08270263671875,
0.0279998779296875,
-0.012664794921875,
0.00830841064453125,
0.0233306884765625,
-0.06793212890625,
-0.05572509765625,
-0.043487548828125,
0.06951904296875,
-0.0128173828125,
0.087890625,
-0.038299560546875,
0.042083740234375,
0.00409698486328125,
0.0631103515625,
-0.044464111328125,
-0.01922607421875,
0.08624267578125,
0.01442718505859375,
0.0165863037109375,
-0.037322998046875,
-0.058929443359375,
0.045501708984375,
0.0087432861328125,
0.0036602020263671875,
0.0435791015625,
-0.007568359375,
0.0022678375244140625,
-0.00936126708984375,
0.0093994140625,
-0.01158905029296875,
-0.019012451171875,
-0.035430908203125,
-0.01354217529296875,
0.049468994140625,
0.0399169921875,
-0.023345947265625,
0.053253173828125,
0.0163116455078125,
-0.031768798828125,
0.01506805419921875,
-0.03692626953125,
0.02069091796875,
0.0274658203125,
0.0233306884765625,
-0.0013065338134765625,
0.01027679443359375,
-0.0087127685546875,
0.00971221923828125,
0.0310821533203125,
-0.0186614990234375,
0.0259552001953125,
-0.02301025390625,
0.004055023193359375,
-0.003284454345703125,
0.01316070556640625,
-0.062408447265625,
-0.01317596435546875,
0.039031982421875,
0.003177642822265625,
0.004016876220703125,
0.00024962425231933594,
-0.018341064453125,
-0.0128936767578125,
0.01270294189453125,
0.025115966796875,
-0.017547607421875,
-0.0081329345703125,
-0.077880859375,
-0.03326416015625,
0.04730224609375,
-0.0206756591796875,
0.018310546875,
-0.0423583984375,
-0.0312347412109375,
0.0165557861328125,
-0.00006222724914550781,
-0.020294189453125,
0.003917694091796875,
0.0160980224609375,
-0.03125,
-0.0034923553466796875,
-0.03851318359375,
0.00655364990234375,
-0.013885498046875,
0.0157470703125,
0.061981201171875,
-0.029083251953125,
0.00873565673828125,
0.0023956298828125,
0.01611328125,
0.07379150390625,
-0.055938720703125,
-0.02490234375,
-0.00506591796875,
-0.0035800933837890625,
0.0239105224609375,
-0.0254669189453125,
-0.01251983642578125,
-0.0162506103515625,
-0.0223541259765625,
0.01519775390625,
0.025970458984375,
0.05517578125,
-0.017608642578125,
-0.09521484375,
0.046722412109375,
-0.0341796875,
-0.035736083984375,
-0.025360107421875,
0.019744873046875,
-0.02288818359375,
0.013763427734375,
-0.007717132568359375,
0.0030364990234375,
0.033538818359375,
0.046234130859375,
0.005916595458984375,
0.005359649658203125,
0.04443359375,
0.00518035888671875,
-0.027313232421875,
0.007747650146484375,
0.0016527175903320312,
-0.031829833984375,
-0.03521728515625,
-0.0146484375,
0.0007920265197753906,
0.0118865966796875,
-0.03375244140625,
-0.06005859375,
0.043701171875,
0.024993896484375,
0.0156402587890625,
0.0109405517578125,
-0.04803466796875,
0.009979248046875,
0.06561279296875,
0.057464599609375,
0.02410888671875,
-0.048095703125,
0.02508544921875,
-0.04058837890625,
-0.09442138671875,
-0.008514404296875,
0.038848876953125,
-0.048095703125,
0.0217437744140625,
0.03265380859375,
-0.039398193359375,
-0.00885009765625,
0.015289306640625,
-0.062408447265625,
0.01302337646484375,
-0.0052337646484375,
0.00635528564453125,
-0.0682373046875,
-0.005825042724609375,
0.08795166015625,
-0.044464111328125,
0.00787353515625,
-0.012542724609375,
0.023468017578125,
0.035797119140625,
-0.0347900390625,
0.021270751953125,
0.06219482421875,
-0.05511474609375,
-0.01200103759765625,
0.024078369140625,
0.0026226043701171875,
-0.02337646484375,
-0.002902984619140625,
-0.020263671875,
0.0277252197265625,
0.01346588134765625,
0.0241241455078125,
-0.03521728515625,
0.039642333984375,
0.01006317138671875,
0.023895263671875,
-0.0260772705078125,
0.01476287841796875,
-0.0018024444580078125,
-0.005680084228515625,
0.004222869873046875,
0.0140533447265625,
0.044586181640625,
-0.030731201171875,
0.006389617919921875,
-0.0199432373046875,
-0.02117919921875,
-0.04498291015625,
0.0219573974609375,
-0.030670166015625,
-0.0224609375,
0.0217742919921875
] |
faa9e72f2998e896a4eb37be80f80c7825bece0c
|
Wordpress Stackexchange
Q: How to target the default Recent Posts and Recent Comments widgets with pre_get_posts? I added the following to my functions.php:
add_action('pre_get_posts', 'keyl_get_emp_posts');
function keyl_get_emp_posts($query) {
if ($query->is_main_query())
$query->set('post_type', 'employee');
}
and so far it's effectively filtering out the search results. The default widgets Recent Posts and Recent Comments aren't budging, though. What gives?
A: pre_get_posts is executed before each and every query. Your $query->is_main_query() is making this code change the query only for the Main query. So, if you're in an archive page, you're modifying only the archive posts, and not any of the others queries (widgets, menus, etc).
But be aware, that code you added there will change the query for ALL your main queries. So if you go to another post type archives (categories, etc) you will be modifying the query to get the post_type = employee
|
Q: How to target the default Recent Posts and Recent Comments widgets with pre_get_posts? I added the following to my functions.php:
add_action('pre_get_posts', 'keyl_get_emp_posts');
function keyl_get_emp_posts($query) {
if ($query->is_main_query())
$query->set('post_type', 'employee');
}
and so far it's effectively filtering out the search results. The default widgets Recent Posts and Recent Comments aren't budging, though. What gives?
A: pre_get_posts is executed before each and every query. Your $query->is_main_query() is making this code change the query only for the Main query. So, if you're in an archive page, you're modifying only the archive posts, and not any of the others queries (widgets, menus, etc).
But be aware, that code you added there will change the query for ALL your main queries. So if you go to another post type archives (categories, etc) you will be modifying the query to get the post_type = employee
A: Both the "Recents Posts" widget and the "Recent Comments" widget provide a filter that you can use to alter the query, and they both conveniently take the same argument.
function alter_recent_widget_post_type_wpse_54931($args) {
$args['post_type'] = 'employee';
return $args;
}
add_filter('widget_posts_args','alter_recent_widget_post_type_wpse_54931');
add_filter('widget_posts_args','alter_recent_widget_post_type_wpse_54931');
That will alter the widgets every time they run so if you need the widgets to function in multiple contexts you will need something more complicated.
|
wordpress
|
{
"language": "en",
"length": 207,
"provenance": "stackexchange_00019.jsonl.gz:420753",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54931"
}
|
[
0.07073974609375,
-0.018218994140625,
0.0269775390625,
-0.00730133056640625,
0.003208160400390625,
-0.033905029296875,
0.06817626953125,
-0.021240234375,
0.032318115234375,
0.02838134765625,
0.022796630859375,
-0.01873779296875,
0.01222991943359375,
-0.0430908203125,
-0.002239227294921875,
0.01163482666015625,
0.048431396484375,
-0.01447296142578125,
0.053436279296875,
-0.004291534423828125,
-0.0201568603515625,
-0.00016129016876220703,
0.08074951171875,
0.0341796875,
0.0094451904296875,
-0.0195159912109375,
0.08062744140625,
-0.0163116455078125,
0.023040771484375,
-0.003955841064453125,
0.0254669189453125,
-0.03765869140625,
0.00991058349609375,
0.0273590087890625,
-0.0184478759765625,
0.03790283203125,
-0.004688262939453125,
0.0185089111328125,
0.00591278076171875,
0.0101318359375,
-0.01143646240234375,
-0.00341033935546875,
-0.0205535888671875,
0.0221099853515625,
-0.047393798828125,
-0.0119171142578125,
-0.003940582275390625,
0.01154327392578125,
0.019317626953125,
0.0235443115234375,
-0.0019550323486328125,
0.05084228515625,
0.017913818359375,
-0.03729248046875,
0.00920867919921875,
0.00004774332046508789,
-0.043121337890625,
-0.04266357421875,
0.058258056640625,
0.0430908203125,
-0.000904083251953125,
-0.07391357421875,
0.003925323486328125,
-0.05914306640625,
-0.01001739501953125,
-0.0272979736328125,
0.0694580078125,
0.00711822509765625,
-0.029937744140625,
-0.0287017822265625,
0.034912109375,
0.0199127197265625,
0.034271240234375,
-0.014923095703125,
-0.0139007568359375,
-0.016265869140625,
0.004364013671875,
0.00684356689453125,
0.01535797119140625,
-0.018768310546875,
0.0216217041015625,
0.031219482421875,
-0.0214996337890625,
-0.0286712646484375,
-0.00936126708984375,
-0.03424072265625,
-0.013580322265625,
-0.00328826904296875,
-0.026123046875,
-0.00659942626953125,
-0.01308441162109375,
-0.03155517578125,
-0.0234527587890625,
0.01218414306640625,
0.0130462646484375,
-0.0297698974609375,
0.01715087890625,
0.031829833984375,
-0.004383087158203125,
0.0300140380859375,
-0.055877685546875,
-0.00439453125,
-0.004161834716796875,
-0.0244903564453125,
0.02642822265625,
0.01947021484375,
-0.048828125,
0.0230865478515625,
0.10101318359375,
0.07110595703125,
0.05120849609375,
0.03302001953125,
-0.011322021484375,
-0.001888275146484375,
-0.0372314453125,
-0.01174163818359375,
-0.04376220703125,
0.005558013916015625,
0.0154266357421875,
0.02349853515625,
0.01119232177734375,
0.013916015625,
0.0214691162109375,
-0.05694580078125,
0.031036376953125,
-0.00881195068359375,
-0.04376220703125,
-0.01122283935546875,
0.0093231201171875,
0.045867919921875,
-0.02252197265625,
-0.0050811767578125,
0.050994873046875,
0.00647735595703125,
0.0014276504516601562,
-0.03326416015625,
-0.0015268325805664062,
-0.0112457275390625,
0.0033702850341796875,
0.0287628173828125,
-0.01025390625,
-0.05609130859375,
0.004161834716796875,
0.01082611083984375,
0.0201416015625,
0.04217529296875,
0.025665283203125,
-0.0205230712890625,
-0.00704193115234375,
-0.01031494140625,
-0.040252685546875,
0.0014162063598632812,
0.03167724609375,
-0.01477813720703125,
0.0067596435546875,
-0.0303192138671875,
0.02569580078125,
-0.0234832763671875,
-0.0222320556640625,
-0.0280609130859375,
0.0306549072265625,
-0.01146697998046875,
-0.029388427734375,
-0.058990478515625,
-0.08062744140625,
0.00345611572265625,
-0.034027099609375,
-0.0019207000732421875,
0.0230560302734375,
0.045806884765625,
0.0058441162109375,
-0.02593994140625,
0.0570068359375,
0.00616455078125,
-0.034820556640625,
0.01000213623046875,
-0.052337646484375,
0.00954437255859375,
0.041748046875,
-0.0130615234375,
-0.0286865234375,
-0.043243408203125,
0.0159912109375,
0.01129913330078125,
-0.0662841796875,
0.025909423828125,
0.034454345703125,
0.07122802734375,
0.005458831787109375,
0.0233612060546875,
0.054962158203125,
0.0184783935546875,
-0.01751708984375,
-0.015777587890625,
-0.0019178390502929688,
0.00322723388671875,
-0.002277374267578125,
0.0013895034790039062,
-0.0133056640625,
0.016632080078125,
0.00911712646484375,
-0.008087158203125,
0.0018510818481445312,
0.0036144256591796875,
-0.07989501953125,
0.0181121826171875,
-0.041595458984375,
0.04150390625,
0.0032444000244140625,
0.01010894775390625,
0.01073455810546875,
0.0211334228515625,
-0.035003662109375,
-0.00627899169921875,
-0.022735595703125,
0.0015010833740234375,
-0.007381439208984375,
0.07769775390625,
0.0078582763671875,
0.038665771484375,
0.0080718994140625,
-0.06365966796875,
0.025665283203125,
0.012359619140625,
0.05194091796875,
0.0036830902099609375,
-0.005367279052734375,
-0.01279449462890625,
0.054443359375,
0.0181121826171875,
-0.0180511474609375,
-0.0110015869140625,
0.0124359130859375,
0.0159912109375,
-0.046844482421875,
-0.01471710205078125,
-0.006561279296875,
0.006633758544921875,
0.018096923828125,
0.0361328125,
0.0177764892578125,
0.03497314453125,
0.006473541259765625,
0.032989501953125,
0.0212554931640625,
-0.048614501953125,
0.021392822265625,
0.00992584228515625,
0.0095672607421875,
0.034942626953125,
-0.00623321533203125,
-0.01158905029296875,
0.0167236328125,
-0.0223846435546875,
0.037200927734375,
0.008087158203125,
0.024444580078125,
-0.0009522438049316406,
0.00533294677734375,
0.004241943359375,
-0.007152557373046875,
-0.04534912109375,
-0.04315185546875,
-0.00878143310546875,
-0.0021038055419921875,
-0.0060577392578125,
0.0301513671875,
0.03741455078125,
0.0009627342224121094,
-0.041717529296875,
0.006763458251953125,
0.0197906494140625,
0.0189056396484375,
0.036224365234375,
0.0161895751953125,
0.0034694671630859375,
-0.02386474609375,
-0.0273590087890625,
0.02880859375,
0.007537841796875,
-0.0083770751953125,
0.051300048828125,
-0.0310821533203125,
-0.0216217041015625,
-0.0595703125,
-0.054931640625,
-0.01128387451171875,
0.00043010711669921875,
-0.016357421875,
-0.0301055908203125,
0.001953125,
0.00936126708984375,
-0.01483154296875,
0.00991058349609375,
0.00774383544921875,
-0.031829833984375,
0.036590576171875,
-0.034149169921875,
0.033050537109375,
-0.027679443359375,
0.07611083984375,
0.060577392578125,
-0.020904541015625,
0.0278167724609375,
-0.01177215576171875,
0.0213470458984375,
-0.0102081298828125,
0.0242462158203125,
-0.00942230224609375,
-0.035064697265625,
-0.024505615234375,
-0.0080413818359375,
0.0207672119140625,
0.074462890625,
-0.0377197265625,
-0.042724609375,
0.0036449432373046875,
0.0276641845703125,
-0.04425048828125,
-0.034088134765625,
-0.00661468505859375,
-0.038238525390625,
-0.0192108154296875,
-0.0084075927734375,
-0.017242431640625,
0.0185699462890625,
-0.004154205322265625,
-0.0024871826171875,
0.0126953125,
-0.0061798095703125,
-0.054840087890625,
-0.019317626953125,
-0.046478271484375,
0.0158538818359375,
-0.0220184326171875,
-0.0069427490234375,
0.0068817138671875,
0.0782470703125,
0.0082244873046875,
-0.05718994140625,
0.020294189453125,
-0.00533294677734375,
-0.0294342041015625,
0.038604736328125,
0.006931304931640625,
-0.02044677734375,
0.03277587890625,
-0.005096435546875,
0.00650787353515625,
0.032318115234375,
-0.0247802734375,
-0.024078369140625,
-0.00553131103515625,
0.054962158203125,
0.012481689453125,
0.0159759521484375,
0.0109405517578125,
0.045623779296875,
0.0142822265625,
0.0003483295440673828,
0.0214996337890625,
-0.03826904296875,
-0.0088653564453125,
0.019073486328125,
-0.01090240478515625,
0.0040283203125,
-0.004150390625,
0.017059326171875,
-0.00008797645568847656,
-0.005889892578125,
0.040374755859375,
-0.035797119140625,
0.01461029052734375,
0.00949859619140625,
-0.0081329345703125,
-0.00740814208984375,
-0.002918243408203125,
-0.03948974609375,
0.05743408203125,
0.006622314453125,
0.005046844482421875,
0.017364501953125,
-0.00968170166015625,
0.02288818359375,
-0.0292816162109375,
0.0178985595703125,
-0.0609130859375,
0.0280303955078125,
-0.051177978515625,
0.007015228271484375,
-0.023223876953125,
0.06024169921875,
-0.061981201171875,
-0.007633209228515625,
0.0071258544921875,
0.01227569580078125,
-0.01073455810546875,
-0.061431884765625,
-0.0399169921875,
-0.019866943359375,
-0.09735107421875,
0.0033473968505859375,
-0.0021686553955078125,
-0.0310516357421875,
-0.021881103515625,
0.00798797607421875,
-0.06573486328125,
-0.04388427734375,
0.0594482421875,
0.0228271484375,
0.01372528076171875,
0.01189422607421875,
0.01023101806640625,
-0.0150299072265625,
-0.040069580078125,
0.021331787109375,
-0.06634521484375,
-0.01169586181640625,
0.0052337646484375,
0.05535888671875,
-0.01395416259765625,
-0.012115478515625,
-0.065185546875,
0.0201568603515625,
0.05767822265625,
-0.04425048828125,
0.0325927734375,
-0.02239990234375,
-0.00933837890625,
-0.010833740234375,
-0.00032901763916015625,
-0.037384033203125,
0.0211334228515625,
-0.01110076904296875,
-0.0634765625,
-0.03631591796875,
-0.04827880859375,
-0.005878448486328125,
-0.0262908935546875,
-0.045257568359375,
-0.04217529296875,
-0.04937744140625,
-0.0184173583984375,
0.023193359375,
-0.036895751953125,
0.021881103515625,
-0.0491943359375,
-0.037933349609375,
0.0191497802734375,
0.02398681640625,
-0.01617431640625,
-0.017669677734375,
0.018280029296875,
0.0234832763671875,
-0.038055419921875,
0.053924560546875,
-0.01351165771484375,
0.0308380126953125,
-0.025360107421875,
0.037261962890625,
0.06060791015625,
-0.0065155029296875,
-0.022186279296875,
0.0080108642578125,
0.00429534912109375,
-0.043060302734375,
0.08990478515625,
0.00318145751953125,
0.0153656005859375,
-0.00513458251953125,
-0.00870513916015625,
0.005405426025390625,
0.03326416015625,
0.003673553466796875,
-0.0350341796875,
-0.01371002197265625,
0.06854248046875,
-0.0086669921875,
0.0003829002380371094,
-0.059783935546875,
0.01554107666015625,
-0.0128021240234375,
0.035003662109375,
0.019744873046875,
0.009979248046875,
0.0201416015625,
-0.0191802978515625,
0.017547607421875,
-0.01812744140625,
0.0281219482421875,
0.050079345703125,
0.01396942138671875,
0.03271484375,
-0.0010366439819335938,
-0.01849365234375,
-0.0257110595703125,
-0.01369476318359375,
0.047119140625,
-0.01910400390625,
-0.0447998046875,
0.01166534423828125,
-0.0181732177734375,
0.01215362548828125,
0.02960205078125,
-0.0282440185546875,
0.027374267578125,
0.0457763671875,
-0.042755126953125,
-0.0396728515625,
-0.032379150390625,
-0.01035308837890625,
-0.08184814453125,
-0.02349853515625,
-0.0061798095703125,
0.0158233642578125,
0.044921875,
0.0460205078125,
0.018341064453125,
0.054412841796875,
-0.061614990234375,
0.044891357421875,
0.007137298583984375,
0.0164031982421875,
0.0037250518798828125,
0.033050537109375,
0.006999969482421875,
-0.0063018798828125,
-0.005279541015625,
0.00827789306640625,
-0.0066986083984375,
0.000530242919921875,
-0.0274505615234375,
-0.001354217529296875,
0.01800537109375,
0.02020263671875,
0.004917144775390625,
-0.0091552734375,
0.0323486328125,
0.054534912109375,
-0.018798828125,
-0.001979827880859375,
0.0020313262939453125,
0.0157928466796875,
0.00453948974609375,
-0.052154541015625,
0.075439453125,
-0.00882720947265625,
0.06341552734375,
-0.01580810546875,
-0.01348876953125,
0.03131103515625,
0.043731689453125,
-0.0086212158203125,
-0.0699462890625,
-0.01114654541015625,
-0.090576171875,
0.020355224609375,
-0.01258087158203125,
0.006046295166015625,
0.027008056640625,
-0.02984619140625,
0.050384521484375,
-0.03179931640625,
-0.01409912109375,
-0.0219573974609375,
0.0237579345703125,
0.0144195556640625,
0.015167236328125,
-0.017669677734375,
-0.0163116455078125,
-0.0703125,
-0.03167724609375,
-0.006298065185546875,
-0.019561767578125,
-0.0310211181640625,
0.0063629150390625,
0.00688934326171875,
0.035888671875,
-0.00405120849609375,
-0.022735595703125,
-0.0246429443359375,
-0.0116119384765625,
0.02069091796875,
0.07452392578125,
-0.0188446044921875,
0.0762939453125,
-0.004367828369140625,
0.03271484375,
-0.008514404296875,
0.004215240478515625,
-0.05950927734375,
0.019500732421875,
-0.0030975341796875,
-0.0654296875,
-0.01439666748046875,
0.005344390869140625,
-0.05364990234375,
0.03167724609375,
0.036468505859375,
0.0038700103759765625,
0.0033359527587890625,
0.0054779052734375,
0.00910186767578125,
-0.01172637939453125,
-0.029937744140625,
0.0028285980224609375,
0.0015134811401367188,
-0.0025806427001953125,
-0.0191650390625,
0.01296234130859375,
-0.0262298583984375,
0.0169219970703125,
0.01042938232421875,
-0.0269012451171875,
-0.01366424560546875,
0.03082275390625,
-0.065185546875,
0.0806884765625,
0.060882568359375,
0.0110321044921875,
0.03485107421875,
0.0006866455078125,
0.0081329345703125,
-0.01364898681640625,
-0.0325927734375,
0.00008779764175415039,
0.023834228515625,
0.0278167724609375,
-0.02703857421875,
0.003814697265625,
0.01119232177734375,
-0.0068511962890625,
0.004276275634765625,
-0.002605438232421875,
0.01548004150390625,
-0.05322265625,
0.0262908935546875,
-0.0017414093017578125,
-0.0086822509765625,
-0.00908660888671875,
0.0056915283203125,
-0.01141357421875,
-0.0256500244140625,
0.0238189697265625,
0.0033740997314453125,
-0.0192718505859375,
0.0096435546875,
0.0249786376953125,
-0.003620147705078125,
-0.028778076171875,
0.06005859375,
-0.010223388671875,
-0.031402587890625,
-0.0180206298828125,
0.00832366943359375,
-0.045623779296875,
-0.0209503173828125,
0.051300048828125,
-0.0159454345703125,
-0.0200347900390625,
-0.11956787109375,
-0.042236328125,
0.037322998046875,
-0.07177734375,
0.0192108154296875,
-0.018157958984375,
0.03729248046875,
0.0311126708984375,
0.0006680488586425781,
0.0069732666015625,
0.004741668701171875,
-0.0238494873046875,
-0.0511474609375,
-0.0121002197265625,
0.0261688232421875,
0.04833984375,
0.0152435302734375,
0.033843994140625,
0.01122283935546875,
-0.047393798828125,
-0.020843505859375,
-0.0531005859375,
0.0640869140625,
-0.0460205078125,
-0.0054779052734375,
-0.01480865478515625,
0.026458740234375,
0.00531768798828125,
0.0037174224853515625,
-0.027679443359375,
-0.03863525390625,
-0.006656646728515625,
-0.033843994140625,
-0.04840087890625,
0.036834716796875,
-0.016204833984375,
-0.01454925537109375,
0.0035533905029296875,
-0.0038127899169921875,
0.0078887939453125,
0.01361083984375,
0.004207611083984375,
0.0081024169921875,
-0.0013971328735351562,
-0.035675048828125,
0.04278564453125,
-0.036102294921875,
0.0474853515625,
-0.07098388671875,
-0.0082855224609375,
0.01230621337890625,
0.00960540771484375,
0.04534912109375,
0.00885772705078125,
-0.0296783447265625,
-0.002040863037109375,
0.0264892578125,
0.037322998046875,
-0.00551605224609375,
0.039306640625,
0.003337860107421875,
0.034088134765625,
0.056976318359375,
-0.015777587890625,
0.036376953125,
0.0217742919921875,
-0.033294677734375,
0.03277587890625,
0.0226898193359375,
0.0165863037109375,
-0.032867431640625,
0.047698974609375,
-0.030242919921875,
-0.0210723876953125,
0.0211029052734375,
-0.01044464111328125,
0.0204010009765625,
0.055938720703125,
0.125732421875,
-0.064697265625,
-0.004673004150390625,
-0.047882080078125,
0.07373046875,
0.04718017578125,
0.01904296875,
0.05499267578125,
0.026824951171875,
0.007732391357421875,
0.007312774658203125,
0.0142669677734375,
0.01428985595703125,
-0.00439453125,
0.039398193359375,
0.027252197265625,
0.03106689453125,
-0.0328369140625,
0.00670623779296875,
0.057952880859375,
0.0552978515625,
-0.039642333984375,
-0.046173095703125,
0.00989532470703125,
-0.0097808837890625,
-0.0096893310546875,
0.0158233642578125,
0.00707244873046875,
-0.004825592041015625,
0.0210418701171875,
-0.036346435546875,
-0.0177459716796875,
-0.0211639404296875,
0.0213470458984375,
-0.0313720703125,
-0.042877197265625,
0.038665771484375,
-0.0293426513671875,
0.00946807861328125,
-0.0460205078125,
0.01042938232421875,
0.0101165771484375,
0.016876220703125,
0.000507354736328125,
-0.0197601318359375,
0.01364898681640625,
0.0193328857421875,
-0.0078887939453125,
-0.0205535888671875,
-0.0115966796875,
-0.03497314453125,
-0.029998779296875,
-0.015655517578125,
0.032989501953125,
0.04779052734375,
0.00628662109375,
0.0195770263671875,
-0.03448486328125,
-0.0533447265625,
0.0229644775390625,
0.03057861328125,
-0.03466796875,
0.01404571533203125,
-0.022979736328125,
-0.0020771026611328125,
0.005035400390625,
-0.0121612548828125,
-0.026580810546875,
0.019989013671875,
0.01342010498046875,
-0.0205535888671875,
0.038055419921875,
-0.00617218017578125,
0.0243377685546875,
0.07110595703125,
-0.0045928955078125,
0.00510406494140625,
0.0063629150390625,
-0.07275390625,
0.0012674331665039062,
-0.033721923828125,
-0.061553955078125,
0.0015048980712890625,
0.028564453125,
-0.0311279296875,
0.0035915374755859375,
-0.0023136138916015625,
0.00014495849609375,
0.0270843505859375,
-0.0292816162109375,
-0.0029010772705078125,
0.0037689208984375,
0.0270233154296875,
0.00632476806640625,
0.011138916015625,
0.01099395751953125,
0.029296875,
-0.003932952880859375,
0.040924072265625,
-0.0081024169921875,
0.036529541015625,
0.01690673828125,
-0.00829315185546875,
0.0198211669921875,
-0.027679443359375,
0.00846099853515625,
0.0199432373046875,
-0.021087646484375,
-0.00586700439453125,
0.002422332763671875,
-0.0243377685546875,
0.0079193115234375,
0.027008056640625,
-0.051422119140625,
0.04583740234375,
-0.0228271484375,
0.0033168792724609375,
-0.036224365234375,
0.01496124267578125,
-0.0287322998046875,
0.020782470703125,
-0.0177764892578125,
-0.040924072265625,
0.05767822265625,
-0.02923583984375,
-0.029388427734375,
0.01403045654296875,
0.01409912109375,
-0.005771636962890625,
0.0194854736328125,
-0.00792694091796875,
0.0156707763671875,
0.032318115234375,
-0.0298919677734375,
0.0288848876953125,
0.00893402099609375,
-0.0124053955078125,
0.00896453857421875,
0.02935791015625,
-0.01541900634765625,
0.0209197998046875,
0.06353759765625,
0.0232696533203125,
-0.01812744140625,
0.056396484375,
-0.01216888427734375,
0.01105499267578125,
-0.024200439453125,
0.0183868408203125,
0.00409698486328125,
-0.0008649826049804688,
-0.01322174072265625,
-0.0182952880859375,
-0.00412750244140625,
-0.005565643310546875,
0.01241302490234375,
-0.0687255859375,
-0.00446319580078125,
-0.00823974609375,
0.0361328125,
0.0159759521484375,
-0.0811767578125,
0.0841064453125,
-0.01971435546875,
-0.002056121826171875,
-0.01377105712890625,
-0.0014514923095703125,
-0.0096588134765625,
-0.0081634521484375,
-0.01540374755859375,
0.0007281303405761719,
-0.04315185546875,
-0.0011463165283203125,
-0.012176513671875,
-0.007785797119140625,
0.0203857421875,
0.0052337646484375,
-0.011627197265625,
-0.022552490234375,
-0.01995849609375,
0.027008056640625,
-0.05224609375,
0.004638671875,
0.044219970703125,
-0.007129669189453125,
-0.044403076171875,
-0.061431884765625,
0.024200439453125,
-0.073974609375,
-0.0012121200561523438,
0.0196685791015625,
-0.026763916015625,
-0.004802703857421875,
-0.058746337890625,
-0.11236572265625,
0.040618896484375,
-0.007373809814453125,
-0.042694091796875,
-0.045013427734375,
0.00858306884765625,
-0.0023708343505859375,
-0.01873779296875,
-0.020294189453125,
-0.0093231201171875,
-0.0269012451171875,
0.01357269287109375,
0.008697509765625,
0.0377197265625,
0.0140838623046875,
-0.006298065185546875,
-0.052886962890625,
-0.01491546630859375,
-0.033233642578125,
0.0210113525390625,
-0.041351318359375,
0.0193634033203125,
0.0117340087890625,
0.0178375244140625,
-0.0272064208984375,
0.036224365234375,
0.01520538330078125,
0.03558349609375,
-0.0003230571746826172,
-0.0028095245361328125,
-0.060302734375,
-0.019683837890625,
0.051788330078125,
0.09844970703125,
0.01473236083984375,
-0.03399658203125,
0.02508544921875,
0.0430908203125,
-0.0125579833984375,
-0.00817108154296875,
0.01050567626953125,
-0.0201873779296875,
-0.0303192138671875,
-0.034820556640625,
-0.007266998291015625,
-0.0192413330078125,
-0.05682373046875,
-0.042724609375,
-0.01548004150390625,
-0.042083740234375,
0.00550079345703125,
0.0273284912109375,
-0.00003272294998168945,
0.02117919921875,
-0.0186614990234375,
-0.023101806640625,
0.003383636474609375,
0.005199432373046875,
-0.0078277587890625,
-0.0011119842529296875,
-0.05255126953125,
-0.0242919921875,
0.017425537109375,
-0.0171051025390625,
0.00424957275390625,
-0.01461029052734375,
0.04058837890625,
0.0251007080078125,
-0.018341064453125,
0.00620269775390625,
-0.006481170654296875,
-0.00949859619140625,
0.036651611328125,
0.01081085205078125,
0.01119232177734375,
0.05242919921875,
-0.0112457275390625,
0.04583740234375,
-0.0078125,
0.02813720703125,
-0.0007834434509277344,
-0.0089263916015625,
0.025238037109375,
-0.01032257080078125,
-0.006923675537109375,
-0.02777099609375,
-0.052276611328125,
-0.0360107421875,
-0.0156707763671875,
0.01230621337890625,
-0.03192138671875,
0.00658416748046875
] |
d296f934877ce7deafe96007136df78ce37d52f6
|
Wordpress Stackexchange
Q: the_post_thumbnail with lazyload JQ plugin I need to modify the_post_thumbnail function to run "Lazyload" on it,
i think there is two solutions :
1- modify the args to be something like this
the_post_thumbnail('product', array('data-original'=>$src, 'src'=>'grey.gif'));
(((NOT WORKING!)))
2- get only the image url from the function ... i've tried alot of snippets and nothing worked for me , like this one !
$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "size" );
any ideas??
thanks
A: If you want to apply lazyload to each attachment image, you can just add your hoot to wp_get_attachment_image_attributes filter:
add_filter( 'wp_get_attachment_image_attributes', 'wpse8170_add_lazyload_to_attachment_image', 10, 2 );
function wpse8170_add_lazyload_to_attachment_image( $attr, $attachment ) {
$attr['data-original'] = $attr['src'];
$attr['src'] = 'grey.gif';
return $attr;
}
Or if you can use second approach:
$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "size" );
// add more attributes if you need
printf( '<img src="grey.gif" data-original="%s"/>', esc_url( $thumbnail_src[0] ) );
|
Q: the_post_thumbnail with lazyload JQ plugin I need to modify the_post_thumbnail function to run "Lazyload" on it,
i think there is two solutions :
1- modify the args to be something like this
the_post_thumbnail('product', array('data-original'=>$src, 'src'=>'grey.gif'));
(((NOT WORKING!)))
2- get only the image url from the function ... i've tried alot of snippets and nothing worked for me , like this one !
$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "size" );
any ideas??
thanks
A: If you want to apply lazyload to each attachment image, you can just add your hoot to wp_get_attachment_image_attributes filter:
add_filter( 'wp_get_attachment_image_attributes', 'wpse8170_add_lazyload_to_attachment_image', 10, 2 );
function wpse8170_add_lazyload_to_attachment_image( $attr, $attachment ) {
$attr['data-original'] = $attr['src'];
$attr['src'] = 'grey.gif';
return $attr;
}
Or if you can use second approach:
$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "size" );
// add more attributes if you need
printf( '<img src="grey.gif" data-original="%s"/>', esc_url( $thumbnail_src[0] ) );
A: If you dont want to use a hook, in the loop you can do like this:
$loop = new WP_Query( array( 'posts_per_page' => -1 ) );
while ( $loop->have_posts() ) : $loop->the_post();
global $post;
if ( $image_id = get_post_thumbnail_id( $post->ID ) ){
if ($src = wp_get_attachment_image_src( $image_id, 'full' )){
$item.= '<img class="lazy" data-original="' . $src[0] . '"/>';
}
}
endwhile; wp_reset_query();
A: Add to your template's functions.php:
function lazyload_image( $html ) {
$html = str_replace( 'src=', 'data-src=', $html );
return $html;
}
...
add_filter( 'post_thumbnail_html', 'lazyload_image');
Personally i'm using my own lazyload plugin, unveil.
|
wordpress
|
{
"language": "en",
"length": 240,
"provenance": "stackexchange_00019.jsonl.gz:420768",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54986"
}
|
[
0.08111572265625,
-0.0391845703125,
0.0258331298828125,
-0.06414794921875,
0.02734375,
-0.0310516357421875,
0.06854248046875,
0.0226287841796875,
0.004467010498046875,
0.0017948150634765625,
-0.029327392578125,
-0.01012420654296875,
-0.0222930908203125,
-0.024627685546875,
-0.0018091201782226562,
-0.04071044921875,
0.0540771484375,
0.004665374755859375,
0.0531005859375,
-0.00431060791015625,
-0.021209716796875,
0.0304107666015625,
0.05078125,
0.0731201171875,
0.01812744140625,
-0.0270233154296875,
0.091064453125,
-0.006412506103515625,
-0.00383758544921875,
-0.0046234130859375,
0.0205841064453125,
-0.03192138671875,
0.038787841796875,
-0.042999267578125,
0.006168365478515625,
0.00567626953125,
0.00536346435546875,
-0.0264434814453125,
-0.0166473388671875,
0.0235748291015625,
0.027008056640625,
-0.016448974609375,
-0.016845703125,
0.0209197998046875,
-0.041351318359375,
-0.0008511543273925781,
0.015838623046875,
-0.0286865234375,
0.0284271240234375,
0.00931549072265625,
0.033660888671875,
0.0218505859375,
0.048309326171875,
-0.0006966590881347656,
-0.0182647705078125,
-0.002765655517578125,
-0.06072998046875,
0.020416259765625,
0.0305938720703125,
0.00789642333984375,
-0.01274871826171875,
-0.0158843994140625,
0.01334381103515625,
-0.01727294921875,
-0.0097198486328125,
0.026092529296875,
-0.01140594482421875,
-0.0030994415283203125,
-0.041229248046875,
-0.01288604736328125,
0.0283660888671875,
-0.049072265625,
-0.0211181640625,
-0.0029087066650390625,
-0.02044677734375,
0.00835418701171875,
0.033294677734375,
0.01139068603515625,
-0.01226806640625,
0.0062255859375,
0.02825927734375,
0.003002166748046875,
-0.03521728515625,
0.040679931640625,
0.0200347900390625,
0.0771484375,
-0.00724029541015625,
-0.054779052734375,
0.0088043212890625,
-0.03753662109375,
0.007129669189453125,
-0.0180511474609375,
-0.0184326171875,
0.00009709596633911133,
-0.01276397705078125,
-0.05682373046875,
0.004390716552734375,
-0.003986358642578125,
0.041351318359375,
0.00868988037109375,
0.024444580078125,
-0.060272216796875,
0.0250091552734375,
-0.0160064697265625,
0.01067352294921875,
-0.0052947998046875,
-0.0328369140625,
0.0177154541015625,
0.059722900390625,
0.059356689453125,
-0.0035457611083984375,
0.039154052734375,
-0.0137176513671875,
0.0221405029296875,
-0.029022216796875,
-0.014129638671875,
-0.06591796875,
0.01934814453125,
-0.03607177734375,
0.0300140380859375,
-0.0237274169921875,
-0.0230255126953125,
0.026702880859375,
-0.0083465576171875,
0.03338623046875,
0.0288238525390625,
-0.0282440185546875,
-0.012786865234375,
0.017059326171875,
-0.011871337890625,
-0.0289764404296875,
0.03985595703125,
0.032958984375,
-0.00926971435546875,
0.00521087646484375,
0.0062255859375,
-0.0192718505859375,
-0.06854248046875,
-0.02276611328125,
0.035400390625,
-0.01520538330078125,
-0.02325439453125,
0.0239410400390625,
-0.037139892578125,
-0.002346038818359375,
0.004764556884765625,
0.006710052490234375,
0.013824462890625,
-0.01438140869140625,
-0.024749755859375,
0.006134033203125,
-0.0255889892578125,
0.016998291015625,
0.025421142578125,
0.006404876708984375,
0.0195770263671875,
0.06854248046875,
-0.024322509765625,
-0.04718017578125,
-0.042633056640625,
0.026031494140625,
0.006900787353515625,
-0.0020885467529296875,
0.01019287109375,
-0.01361846923828125,
0.002193450927734375,
0.00004559755325317383,
-0.008270263671875,
0.02313232421875,
0.0269927978515625,
-0.002231597900390625,
0.0221405029296875,
-0.0120391845703125,
0.0028781890869140625,
-0.0012216567993164062,
-0.00762939453125,
-0.037078857421875,
0.01861572265625,
0.04461669921875,
0.004024505615234375,
-0.021575927734375,
-0.04022216796875,
0.08831787109375,
-0.0282440185546875,
-0.045806884765625,
0.0010585784912109375,
-0.00391387939453125,
0.0205841064453125,
0.03997802734375,
0.0157928466796875,
0.011932373046875,
-0.01035308837890625,
-0.0251312255859375,
0.0037746429443359375,
-0.00647735595703125,
-0.0154266357421875,
0.004795074462890625,
-0.005344390869140625,
-0.00074005126953125,
0.006549835205078125,
0.04296875,
-0.0274658203125,
0.02252197265625,
0.0029392242431640625,
-0.07183837890625,
0.0175018310546875,
-0.031982421875,
0.01424407958984375,
-0.01103973388671875,
0.039398193359375,
0.01342010498046875,
0.016510009765625,
-0.03753662109375,
0.036712646484375,
0.0212249755859375,
0.0183258056640625,
0.0018453598022460938,
0.0130615234375,
-0.00949859619140625,
0.035400390625,
-0.042144775390625,
-0.0125579833984375,
-0.04364013671875,
0.0111541748046875,
0.0233612060546875,
0.00701904296875,
-0.01873779296875,
-0.01284027099609375,
-0.017608642578125,
0.0194244384765625,
-0.059356689453125,
0.051055908203125,
-0.0218658447265625,
-0.0157928466796875,
-0.01485443115234375,
0.01812744140625,
-0.01401519775390625,
-0.07781982421875,
0.0017728805541992188,
0.054931640625,
0.045867919921875,
0.079833984375,
0.0352783203125,
0.03521728515625,
0.132568359375,
0.033355712890625,
0.037750244140625,
-0.01541900634765625,
-0.0178070068359375,
-0.006961822509765625,
0.00423431396484375,
-0.01549530029296875,
0.0248870849609375,
-0.050872802734375,
0.01288604736328125,
0.041778564453125,
0.016265869140625,
0.00428009033203125,
-0.0287628173828125,
0.04132080078125,
0.0003247261047363281,
0.030029296875,
-0.0037326812744140625,
0.002590179443359375,
0.03790283203125,
0.01488494873046875,
0.0158538818359375,
0.00493621826171875,
-0.050628662109375,
0.0357666015625,
0.03179931640625,
-0.007476806640625,
-0.0195159912109375,
0.0406494140625,
0.01189422607421875,
0.0037784576416015625,
-0.04388427734375,
0.01227569580078125,
-0.02703857421875,
0.0170745849609375,
-0.004001617431640625,
0.016082763671875,
-0.031768798828125,
0.003726959228515625,
-0.0293121337890625,
-0.045013427734375,
0.0242767333984375,
0.04986572265625,
-0.0288848876953125,
-0.017486572265625,
0.0009546279907226562,
0.026580810546875,
-0.0154876708984375,
0.0283050537109375,
0.023651123046875,
0.002712249755859375,
0.040069580078125,
-0.047119140625,
0.0416259765625,
-0.021636962890625,
0.1024169921875,
0.078125,
-0.023895263671875,
0.05462646484375,
-0.02252197265625,
-0.002887725830078125,
-0.03289794921875,
-0.0203857421875,
-0.056732177734375,
-0.01534271240234375,
-0.07537841796875,
0.01026153564453125,
-0.00550079345703125,
0.052001953125,
-0.04949951171875,
-0.0595703125,
-0.01033782958984375,
-0.007518768310546875,
-0.08929443359375,
-0.0802001953125,
-0.0013265609741210938,
-0.06689453125,
-0.0212554931640625,
0.0139923095703125,
-0.0406494140625,
-0.00015413761138916016,
0.03485107421875,
0.00406646728515625,
-0.035552978515625,
0.007251739501953125,
-0.05511474609375,
-0.0134735107421875,
-0.07537841796875,
0.02117919921875,
-0.0139617919921875,
0.044952392578125,
0.0241241455078125,
-0.003513336181640625,
0.007297515869140625,
-0.031951904296875,
0.006870269775390625,
0.057952880859375,
-0.00748443603515625,
-0.0286102294921875,
-0.0272064208984375,
0.030303955078125,
-0.033935546875,
-0.0002727508544921875,
0.00966644287109375,
0.0137939453125,
-0.01043701171875,
0.0014963150024414062,
-0.00836944580078125,
0.003559112548828125,
0.01078033447265625,
0.033355712890625,
0.017364501953125,
0.028167724609375,
0.040374755859375,
-0.0214996337890625,
-0.0250396728515625,
-0.028839111328125,
-0.05487060546875,
-0.01406097412109375,
0.02215576171875,
0.024871826171875,
0.0000010728836059570312,
0.0006766319274902344,
0.01277923583984375,
0.00754547119140625,
0.04718017578125,
-0.00270843505859375,
0.01129150390625,
-0.023162841796875,
-0.031707763671875,
-0.04925537109375,
0.05328369140625,
-0.00911712646484375,
-0.005237579345703125,
0.0250091552734375,
0.0071868896484375,
-0.0010747909545898438,
-0.01065826416015625,
-0.005924224853515625,
-0.0163421630859375,
0.0213623046875,
-0.0308837890625,
0.02703857421875,
-0.0290679931640625,
-0.01503753662109375,
-0.0086669921875,
0.044921875,
-0.0197906494140625,
-0.00826263427734375,
-0.0531005859375,
0.006839752197265625,
-0.03497314453125,
-0.051605224609375,
-0.005084991455078125,
0.0237884521484375,
-0.0694580078125,
0.00036644935607910156,
0.00986480712890625,
-0.0177154541015625,
0.0026493072509765625,
-0.01483154296875,
-0.0302734375,
-0.046112060546875,
0.01666259765625,
0.005062103271484375,
-0.024993896484375,
0.04052734375,
-0.0595703125,
0.056640625,
-0.03399658203125,
-0.0074615478515625,
-0.09326171875,
-0.017425537109375,
-0.007617950439453125,
0.08929443359375,
-0.023406982421875,
0.038909912109375,
-0.03936767578125,
0.058685302734375,
-0.01094818115234375,
0.0150299072265625,
-0.022369384765625,
0.0089569091796875,
-0.022796630859375,
0.00838470458984375,
-0.003803253173828125,
0.0045166015625,
-0.0207366943359375,
-0.0684814453125,
-0.046539306640625,
-0.033843994140625,
-0.0173492431640625,
0.0601806640625,
-0.0047760009765625,
0.01375579833984375,
-0.06048583984375,
-0.0236663818359375,
0.0247344970703125,
0.0419921875,
-0.0087432861328125,
0.013153076171875,
-0.04571533203125,
-0.053955078125,
0.05902099609375,
-0.01018524169921875,
-0.004673004150390625,
-0.005847930908203125,
0.039337158203125,
0.0010995864868164062,
-0.02374267578125,
-0.0309295654296875,
0.003170013427734375,
0.02960205078125,
-0.009307861328125,
0.044036865234375,
0.022186279296875,
0.006198883056640625,
0.031707763671875,
-0.007358551025390625,
0.031402587890625,
-0.03753662109375,
0.033538818359375,
0.00334930419921875,
-0.009124755859375,
0.025665283203125,
0.0193023681640625,
-0.0063934326171875,
-0.0084991455078125,
-0.02789306640625,
0.009979248046875,
0.027191162109375,
0.030548095703125,
-0.04302978515625,
0.0374755859375,
-0.0225677490234375,
-0.0273895263671875,
0.00836181640625,
-0.018096923828125,
0.03704833984375,
0.06524658203125,
-0.02545166015625,
0.038726806640625,
0.01806640625,
0.01174163818359375,
-0.01496124267578125,
0.044921875,
-0.0005135536193847656,
0.045440673828125,
0.01727294921875,
0.0095977783203125,
-0.053863525390625,
-0.001110076904296875,
-0.023284912109375,
0.01116943359375,
-0.0177764892578125,
-0.0413818359375,
0.0168304443359375,
0.032806396484375,
-0.0298309326171875,
-0.0404052734375,
0.036865234375,
0.034698486328125,
-0.03033447265625,
-0.02703857421875,
-0.0338134765625,
-0.004241943359375,
-0.053955078125,
0.04083251953125,
0.033935546875,
-0.0118408203125,
0.0684814453125,
0.0201568603515625,
0.040924072265625,
0.030975341796875,
-0.035125732421875,
0.0161895751953125,
-0.0010766983032226562,
0.02239990234375,
0.021636962890625,
0.0039520263671875,
-0.0283660888671875,
0.0333251953125,
0.00832366943359375,
-0.0670166015625,
-0.0196380615234375,
0.00797271728515625,
0.088623046875,
-0.0460205078125,
-0.035552978515625,
0.0299224853515625,
-0.0247039794921875,
0.00295257568359375,
0.0261077880859375,
-0.01117706298828125,
-0.04266357421875,
-0.01151275634765625,
0.02099609375,
0.054595947265625,
-0.0247955322265625,
-0.0247344970703125,
0.0245819091796875,
-0.0244598388671875,
-0.01023101806640625,
0.004177093505859375,
-0.047210693359375,
0.00592041015625,
0.01678466796875,
-0.0216827392578125,
-0.034393310546875,
-0.02642822265625,
0.050628662109375,
0.0188140869140625,
-0.01206207275390625,
-0.0223388671875,
0.026611328125,
0.0013427734375,
0.050628662109375,
-0.025970458984375,
-0.037841796875,
-0.03240966796875,
-0.00803375244140625,
0.039886474609375,
0.011688232421875,
-0.03765869140625,
-0.020751953125,
-0.017791748046875,
-0.0074310302734375,
0.035186767578125,
0.01033782958984375,
-0.0418701171875,
-0.01065826416015625,
-0.000457763671875,
0.0260162353515625,
-0.01458740234375,
-0.00876617431640625,
0.007091522216796875,
-0.003948211669921875,
-0.0030994415283203125,
0.0384521484375,
-0.006267547607421875,
0.01508331298828125,
-0.007442474365234375,
0.019805908203125,
0.0026760101318359375,
0.001041412353515625,
-0.00848388671875,
-0.01495361328125,
-0.0509033203125,
-0.08734130859375,
0.036773681640625,
0.036407470703125,
-0.024505615234375,
0.0577392578125,
0.0499267578125,
0.031036376953125,
0.004627227783203125,
-0.005374908447265625,
-0.01262664794921875,
-0.038177490234375,
0.0162811279296875,
0.003482818603515625,
0.0148773193359375,
-0.0215606689453125,
-0.046783447265625,
-0.0137939453125,
0.0024700164794921875,
-0.0071563720703125,
0.02947998046875,
-0.048614501953125,
0.0006041526794433594,
0.059600830078125,
-0.0135498046875,
0.037322998046875,
0.0982666015625,
0.007534027099609375,
0.0626220703125,
0.043853759765625,
0.0223236083984375,
0.039093017578125,
0.031494140625,
-0.00986480712890625,
-0.00855255126953125,
0.05023193359375,
0.01215362548828125,
-0.0103759765625,
0.027801513671875,
-0.0195465087890625,
0.033599853515625,
-0.06982421875,
0.0212860107421875,
0.06646728515625,
0.0192718505859375,
-0.0054168701171875,
-0.064208984375,
0.05322265625,
0.003326416015625,
0.0074920654296875,
-0.01265716552734375,
0.039520263671875,
-0.036590576171875,
-0.02020263671875,
-0.01258087158203125,
-0.039520263671875,
0.0007638931274414062,
-0.01450347900390625,
-0.044769287109375,
0.00794219970703125,
-0.06109619140625,
0.0284423828125,
0.055694580078125,
-0.02587890625,
-0.0148162841796875,
0.005962371826171875,
-0.041351318359375,
0.00536346435546875,
-0.043487548828125,
-0.0213470458984375,
-0.01114654541015625,
0.02362060546875,
0.0279541015625,
0.00974273681640625,
0.0721435546875,
0.04193115234375,
0.0250091552734375,
0.006458282470703125,
0.01111602783203125,
0.026885986328125,
0.01456451416015625,
-0.0073699951171875,
0.018646240234375,
0.02850341796875,
-0.029144287109375,
0.0215606689453125,
0.00585174560546875,
-0.00006091594696044922,
-0.00909423828125,
0.003917694091796875,
0.06622314453125,
-0.01849365234375,
-0.0230255126953125,
0.041412353515625,
0.0208587646484375,
-0.0262908935546875,
-0.0033359527587890625,
0.03564453125,
-0.06878662109375,
-0.054107666015625,
0.015106201171875,
-0.0478515625,
-0.0291900634765625,
-0.036895751953125,
-0.07000732421875,
0.055328369140625,
0.007007598876953125,
0.050994873046875,
-0.00807952880859375,
0.00647735595703125,
0.01305389404296875,
0.0028228759765625,
-0.0384521484375,
0.007293701171875,
-0.05291748046875,
0.0416259765625,
-0.044891357421875,
0.0213165283203125,
-0.0010223388671875,
-0.0192108154296875,
0.01480865478515625,
0.01363372802734375,
-0.07501220703125,
-0.01483154296875,
0.04547119140625,
0.01387786865234375,
0.036773681640625,
0.06512451171875,
-0.0041656494140625,
-0.007411956787109375,
0.045166015625,
-0.0193939208984375,
0.01922607421875,
0.005950927734375,
0.0096282958984375,
0.0300750732421875,
0.031585693359375,
0.038116455078125,
0.0038661956787109375,
0.032958984375,
-0.052459716796875,
0.0108642578125,
0.054656982421875,
-0.0382080078125,
0.00983428955078125,
0.021453857421875,
0.016143798828125,
0.006343841552734375,
-0.0396728515625,
0.00730133056640625,
0.01519775390625,
0.0222015380859375,
0.0045166015625,
0.02392578125,
-0.0088348388671875,
0.043914794921875,
0.0250701904296875,
-0.0107574462890625,
0.0140228271484375,
0.054351806640625,
-0.0038089752197265625,
0.0163116455078125,
0.0204010009765625,
-0.023834228515625,
0.0152435302734375,
0.0304718017578125,
0.00716400146484375,
-0.0248870849609375,
-0.0215301513671875,
0.01739501953125,
0.01116180419921875,
-0.0028171539306640625,
-0.01177978515625,
0.015228271484375,
-0.08837890625,
-0.040924072265625,
-0.048828125,
0.0143890380859375,
0.034759521484375,
0.040679931640625,
-0.0038089752197265625,
-0.0204010009765625,
-0.06024169921875,
-0.01453399658203125,
-0.0175933837890625,
-0.003421783447265625,
0.03179931640625,
0.04278564453125,
0.0027751922607421875,
0.033447265625,
-0.032623291015625,
-0.004009246826171875,
-0.005950927734375,
0.029937744140625,
-0.0113067626953125,
0.02392578125,
-0.021759033203125,
-0.0308990478515625,
-0.01323699951171875,
0.04412841796875,
0.03558349609375,
0.0008287429809570312,
0.045013427734375,
0.0147857666015625,
-0.056121826171875,
-0.0035724639892578125,
0.0102081298828125,
-0.0171051025390625,
0.039459228515625,
-0.0217742919921875,
0.046630859375,
0.006069183349609375,
-0.016265869140625,
-0.044158935546875,
0.00342559814453125,
0.037384033203125,
-0.0601806640625,
0.061614990234375,
-0.020416259765625,
-0.0212860107421875,
0.028289794921875,
-0.0260772705078125,
0.06591796875,
-0.03179931640625,
-0.05029296875,
-0.0091094970703125,
-0.006011962890625,
-0.027862548828125,
0.010650634765625,
0.032196044921875,
-0.0245513916015625,
0.030120849609375,
0.005878448486328125,
-0.00836181640625,
-0.00041294097900390625,
-0.005558013916015625,
0.0218505859375,
-0.006427764892578125,
0.0147552490234375,
0.002666473388671875,
-0.01015472412109375,
-0.00008469820022583008,
0.0139617919921875,
0.01456451416015625,
0.0301055908203125,
-0.0240936279296875,
0.02349853515625,
0.0183868408203125,
0.0238189697265625,
-0.00238800048828125,
0.00647735595703125,
0.045135498046875,
-0.036346435546875,
-0.0084686279296875,
0.01030731201171875,
-0.0187835693359375,
0.0099029541015625,
0.012298583984375,
0.0203704833984375,
-0.03558349609375,
-0.03900146484375,
0.00653076171875,
0.02130126953125,
0.0206756591796875,
0.0265960693359375,
-0.03594970703125,
-0.036407470703125,
-0.043426513671875,
-0.0288543701171875,
0.0213775634765625,
-0.00864410400390625,
0.02734375,
-0.015716552734375,
0.0357666015625,
-0.0004467964172363281,
0.035125732421875,
0.0280303955078125,
0.07318115234375,
0.03509521484375,
-0.0638427734375,
-0.0093994140625,
0.025909423828125,
-0.022796630859375,
-0.002162933349609375,
0.00009381771087646484,
0.0389404296875,
-0.0099334716796875,
0.005706787109375,
0.02777099609375,
0.051483154296875,
0.03924560546875,
-0.019927978515625,
0.00981903076171875,
0.0450439453125,
-0.01514434814453125,
-0.0229949951171875,
0.00960540771484375,
-0.0132904052734375,
-0.042022705078125,
-0.004192352294921875,
-0.013885498046875,
-0.0059814453125,
-0.0290374755859375,
0.01305389404296875,
-0.04351806640625,
0.05487060546875,
0.03485107421875,
-0.04290771484375,
0.005680084228515625,
0.0282440185546875,
-0.0223236083984375,
0.0258026123046875,
-0.033172607421875,
-0.004703521728515625,
-0.0029354095458984375,
-0.0157318115234375,
-0.039642333984375,
-0.047027587890625,
0.034515380859375,
-0.0289306640625,
0.0091400146484375,
0.032501220703125,
-0.032318115234375,
-0.014007568359375,
0.044403076171875,
0.01416015625,
0.0958251953125,
-0.0308074951171875,
-0.040069580078125,
0.0148773193359375,
-0.016265869140625,
-0.00885009765625,
-0.0462646484375,
-0.00732421875,
-0.051788330078125,
0.0228424072265625,
0.00042128562927246094,
-0.0175628662109375,
-0.0164947509765625,
-0.0280914306640625,
-0.0157623291015625,
0.045806884765625,
0.00524139404296875,
-0.021514892578125,
0.01290130615234375,
-0.01065826416015625,
-0.000308990478515625,
-0.014190673828125,
0.009552001953125,
-0.00629425048828125,
-0.0190887451171875,
0.017547607421875,
0.00789642333984375,
-0.00714874267578125,
0.05517578125,
-0.009033203125,
-0.04052734375,
-0.005573272705078125,
-0.01195526123046875,
-0.0019397735595703125,
0.0232696533203125,
-0.004596710205078125,
0.0343017578125,
0.0546875,
-0.0028057098388671875,
-0.007038116455078125,
-0.0117645263671875,
-0.0477294921875,
-0.0101165771484375,
-0.0172882080078125,
-0.018035888671875,
0.01352691650390625,
0.043304443359375,
0.061737060546875,
0.00844573974609375,
-0.035736083984375,
0.00453948974609375,
-0.0203399658203125,
-0.01355743408203125,
-0.022796630859375,
0.0216064453125,
-0.086181640625,
-0.03546142578125,
0.00547027587890625,
-0.004726409912109375,
-0.045745849609375,
-0.0019931793212890625,
-0.033935546875,
-0.0129547119140625,
0.0165557861328125,
0.0254364013671875,
-0.046600341796875,
0.030609130859375,
0.029205322265625,
-0.03173828125,
0.0021533966064453125,
0.0015697479248046875,
-0.00921630859375,
0.0081024169921875,
-0.005046844482421875,
-0.007568359375,
0.0020236968994140625,
-0.0016183853149414062,
0.0012063980102539062,
0.01491546630859375,
-0.0029735565185546875,
0.0130615234375,
-0.007518768310546875,
-0.0245819091796875,
0.0278778076171875,
0.0149078369140625,
0.0489501953125,
0.0188751220703125,
-0.00572967529296875,
0.01470947265625,
0.0168914794921875,
-0.026123046875,
-0.016204833984375,
-0.01143646240234375,
-0.0034942626953125,
-0.0239410400390625,
0.02325439453125,
0.018341064453125,
-0.00891876220703125,
0.00678253173828125,
0.005596160888671875,
-0.0022678375244140625,
0.0223846435546875,
-0.00780487060546875,
-0.04937744140625,
-0.040740966796875,
-0.01357269287109375
] |
2a6151b6e113c25f2a8197d7b55ce5e05b087be2
|
Wordpress Stackexchange
Q: remove from text-widget When you add a text widget to a sidebar in Wordpress the widget includes this code
<div class="textwidget">
How do I remove this without editing the core?
FYI - I think this line is located here:
wp-includes/default-widgets.php (line 383)
A: OK, attempting to remove the with jQuery is counter intuitive.
Modifying it via output buffering is inefficient.
And we shouldn't edit the actual widget code itself, since this will revert back next time we update WordPress.
I would suggest either creating your own text widget, or simply extend and modify the existing WordPress widget as follows (put the following code in your functions.php file):
add_action( 'widgets_init', 'register_my_widgets' );
function register_my_widgets() {
...
register_widget( 'My_Text_Widget' );
}
class My_Text_Widget extends WP_Widget_Text {
function widget( $args, $instance ) {
extract($args);
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
$text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance );
echo $before_widget;
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
<?php echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text; ?>
<?php
echo $after_widget;
}
}
|
Q: remove from text-widget When you add a text widget to a sidebar in Wordpress the widget includes this code
<div class="textwidget">
How do I remove this without editing the core?
FYI - I think this line is located here:
wp-includes/default-widgets.php (line 383)
A: OK, attempting to remove the with jQuery is counter intuitive.
Modifying it via output buffering is inefficient.
And we shouldn't edit the actual widget code itself, since this will revert back next time we update WordPress.
I would suggest either creating your own text widget, or simply extend and modify the existing WordPress widget as follows (put the following code in your functions.php file):
add_action( 'widgets_init', 'register_my_widgets' );
function register_my_widgets() {
...
register_widget( 'My_Text_Widget' );
}
class My_Text_Widget extends WP_Widget_Text {
function widget( $args, $instance ) {
extract($args);
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
$text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance );
echo $before_widget;
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
<?php echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text; ?>
<?php
echo $after_widget;
}
}
A: If you're looking to remove the actual div with the textwidget class applied to it but not it's content, this is a simple method using jQuery:
$('.textwidget').replaceWith($('.textwidget').contents());
A: You can use output buffering (http://php.net/manual/es/book.outcontrol.php) to get the whole generated page in a variable and remove the offending before echoing.
But it seems overly complicated for this case. You can just copy all the widget code and create a new widget (in a plugin or your functions.php) without that hardcoded div. It's really not that much code.
Also, any reason to remove that div that can not be solved in css?
A: *
*Edit file: /wp-includes/widgets/class-wp-widget-text.php
*Find, Delete: <div class="textwidget"> and </div>
*Done!
A: As per the comment, in the case it is probably better to just remove or replace the class name using jQuery then a php function, since that class is hardcoded anyhow.
To remove it.
jQuery('.textwidget').remove();
To set the css to hide it.
jQuery('.textwidget').css('display', 'none');
To change the class name
jQuery('.textwidget').attr('class', 'newName');
|
wordpress
|
{
"language": "en",
"length": 358,
"provenance": "stackexchange_00019.jsonl.gz:420769",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/54987"
}
|
[
0.029937744140625,
-0.0185699462890625,
0.00518035888671875,
-0.01279449462890625,
0.006488800048828125,
-0.036407470703125,
0.07537841796875,
-0.01092529296875,
0.01226043701171875,
0.00876617431640625,
-0.03265380859375,
-0.00782012939453125,
-0.03546142578125,
-0.017425537109375,
-0.029144287109375,
-0.043792724609375,
0.01763916015625,
0.00304412841796875,
0.031097412109375,
0.0046234130859375,
-0.0131988525390625,
0.016845703125,
0.021392822265625,
0.0352783203125,
-0.01220703125,
-0.022705078125,
0.1552734375,
-0.021881103515625,
0.003192901611328125,
-0.040863037109375,
0.0259857177734375,
-0.0199432373046875,
0.01430511474609375,
0.0222320556640625,
-0.0340576171875,
0.025909423828125,
-0.0211639404296875,
0.00733184814453125,
0.01091766357421875,
0.004695892333984375,
0.0207061767578125,
-0.0175018310546875,
-0.007965087890625,
0.026336669921875,
-0.0135955810546875,
-0.0242767333984375,
0.0217132568359375,
-0.0198822021484375,
0.0176544189453125,
-0.0173492431640625,
0.0038814544677734375,
-0.006420135498046875,
0.031280517578125,
-0.0465087890625,
-0.0191192626953125,
0.01419830322265625,
-0.017486572265625,
0.006122589111328125,
0.030548095703125,
0.029144287109375,
-0.014739990234375,
-0.01348876953125,
0.0045166015625,
-0.0303497314453125,
-0.013458251953125,
-0.022796630859375,
-0.011444091796875,
0.008087158203125,
-0.030364990234375,
0.01187896728515625,
0.0474853515625,
-0.0183563232421875,
-0.0242462158203125,
-0.04986572265625,
0.01024627685546875,
0.037872314453125,
-0.03814697265625,
-0.039825439453125,
0.0133819580078125,
0.008026123046875,
0.03509521484375,
0.0207672119140625,
-0.012237548828125,
0.021270751953125,
0.01052093505859375,
0.022979736328125,
-0.01401519775390625,
-0.0246124267578125,
-0.032257080078125,
-0.0033245086669921875,
-0.0034465789794921875,
-0.04351806640625,
0.005168914794921875,
-0.0126495361328125,
0.0014162063598632812,
-0.0369873046875,
-0.00989532470703125,
0.033905029296875,
-0.034149169921875,
0.0284881591796875,
0.0256805419921875,
-0.03692626953125,
0.06683349609375,
-0.060211181640625,
0.0281982421875,
0.00876617431640625,
-0.07733154296875,
0.0035247802734375,
0.068115234375,
0.074951171875,
0.035919189453125,
-0.031585693359375,
-0.00140380859375,
-0.01424407958984375,
-0.049102783203125,
0.0207061767578125,
0.0031890869140625,
-0.00830078125,
0.01149749755859375,
0.038818359375,
-0.004852294921875,
0.00921630859375,
0.009490966796875,
-0.032867431640625,
0.050048828125,
0.022552490234375,
-0.026824951171875,
-0.020751953125,
0.0242767333984375,
-0.0240020751953125,
-0.0308837890625,
0.0195465087890625,
0.039886474609375,
0.035980224609375,
0.019989013671875,
-0.009490966796875,
0.047698974609375,
-0.00881195068359375,
0.005340576171875,
-0.010650634765625,
0.0226287841796875,
-0.006862640380859375,
-0.01520538330078125,
-0.003513336181640625,
0.022308349609375,
0.0127105712890625,
0.005035400390625,
0.002765655517578125,
0.0159149169921875,
-0.032135009765625,
0.0245513916015625,
-0.05963134765625,
0.04150390625,
0.0399169921875,
-0.004695892333984375,
0.0086669921875,
0.09393310546875,
-0.049407958984375,
-0.06365966796875,
-0.0714111328125,
0.00960540771484375,
-0.031951904296875,
-0.042205810546875,
-0.0177764892578125,
-0.0301055908203125,
0.049041748046875,
0.0178375244140625,
0.0214080810546875,
0.0228118896484375,
-0.01654052734375,
0.0038356781005859375,
-0.0352783203125,
-0.00725555419921875,
0.02349853515625,
0.01220703125,
0.061767578125,
-0.01485443115234375,
0.0186004638671875,
0.005268096923828125,
-0.0027942657470703125,
-0.035064697265625,
-0.060638427734375,
0.006702423095703125,
-0.014312744140625,
-0.065673828125,
-0.01183319091796875,
0.0235748291015625,
0.0765380859375,
0.0205230712890625,
0.037322998046875,
0.04571533203125,
-0.03546142578125,
-0.050994873046875,
-0.00858306884765625,
-0.018280029296875,
-0.00862884521484375,
0.008270263671875,
-0.004459381103515625,
-0.0098114013671875,
0.02935791015625,
0.06256103515625,
0.0006003379821777344,
0.0194549560546875,
-0.04815673828125,
-0.10089111328125,
0.0064697265625,
-0.032257080078125,
0.04925537109375,
-0.00949859619140625,
0.0098419189453125,
0.0151214599609375,
0.0262298583984375,
-0.040069580078125,
-0.0028400421142578125,
-0.0278472900390625,
-0.0229644775390625,
0.029937744140625,
0.057159423828125,
0.01369476318359375,
-0.005859375,
0.006404876708984375,
-0.02716064453125,
0.0171966552734375,
0.03570556640625,
0.042083740234375,
-0.039459228515625,
-0.0056915283203125,
-0.04351806640625,
0.0251922607421875,
-0.0297698974609375,
-0.022064208984375,
0.060333251953125,
0.019622802734375,
-0.00041937828063964844,
-0.046661376953125,
-0.00579833984375,
-0.03741455078125,
-0.03790283203125,
-0.01522064208984375,
0.055908203125,
0.023406982421875,
0.0657958984375,
-0.0267333984375,
-0.0155792236328125,
0.0253143310546875,
-0.08050537109375,
0.0004017353057861328,
-0.014617919921875,
0.0159454345703125,
0.02978515625,
0.0018253326416015625,
-0.02398681640625,
0.017822265625,
-0.03411865234375,
0.0269317626953125,
0.02081298828125,
-0.0199127197265625,
-0.0012540817260742188,
-0.0345458984375,
0.005859375,
0.0134735107421875,
-0.033111572265625,
-0.0258026123046875,
-0.012908935546875,
0.0714111328125,
-0.0030498504638671875,
0.049468994140625,
0.03857421875,
-0.04278564453125,
-0.0048828125,
0.0169830322265625,
0.00801849365234375,
-0.0244903564453125,
-0.0085296630859375,
0.057373046875,
-0.0292205810546875,
-0.0435791015625,
0.006977081298828125,
-0.00792694091796875,
-0.019256591796875,
-0.02081298828125,
-0.00897979736328125,
0.0166778564453125,
-0.014312744140625,
0.0111236572265625,
-0.0255126953125,
0.03326416015625,
-0.0299835205078125,
0.032318115234375,
-0.024169921875,
-0.0209808349609375,
0.0196075439453125,
-0.01416015625,
0.042999267578125,
0.04248046875,
-0.043853759765625,
0.03326416015625,
0.00507354736328125,
0.0036468505859375,
-0.0015897750854492188,
0.0236968994140625,
0.040130615234375,
-0.00421142578125,
-0.01122283935546875,
0.015533447265625,
-0.0054931640625,
0.02801513671875,
-0.01678466796875,
-0.009765625,
0.040313720703125,
-0.09259033203125,
0.01166534423828125,
0.0017023086547851562,
0.051544189453125,
-0.00783538818359375,
-0.04962158203125,
0.01444244384765625,
-0.0008544921875,
-0.030914306640625,
-0.042449951171875,
0.033660888671875,
-0.016845703125,
-0.032989501953125,
0.0156402587890625,
-0.026397705078125,
0.015167236328125,
0.0284881591796875,
-0.0233154296875,
-0.025482177734375,
-0.0311126708984375,
-0.038360595703125,
-0.05169677734375,
-0.049468994140625,
-0.0244903564453125,
-0.004444122314453125,
0.006317138671875,
0.0089874267578125,
0.037994384765625,
0.0167236328125,
-0.0273895263671875,
0.032745361328125,
0.0194549560546875,
-0.00891876220703125,
0.026580810546875,
0.00574493408203125,
-0.043212890625,
-0.00820159912109375,
-0.0112457275390625,
0.02557373046875,
0.0007510185241699219,
-0.0031585693359375,
-0.0038356781005859375,
0.016693115234375,
0.00823211669921875,
0.0202484130859375,
0.017364501953125,
-0.00730133056640625,
-0.0147857666015625,
-0.0019350051879882812,
-0.039794921875,
-0.02520751953125,
0.01904296875,
-0.0208740234375,
0.027587890625,
-0.0274505615234375,
-0.00867462158203125,
0.03424072265625,
0.0193939208984375,
0.0030574798583984375,
0.0075531005859375,
0.01413726806640625,
-0.020111083984375,
0.058441162109375,
0.0009603500366210938,
0.0005307197570800781,
-0.0218658447265625,
0.0024166107177734375,
-0.032379150390625,
0.0138397216796875,
0.0007925033569335938,
0.00815582275390625,
0.018524169921875,
0.0011167526245117188,
0.0198822021484375,
-0.01458740234375,
0.03741455078125,
-0.017181396484375,
0.005992889404296875,
0.019012451171875,
-0.01280975341796875,
0.02862548828125,
0.052032470703125,
-0.0833740234375,
-0.01708984375,
-0.00420379638671875,
0.0267181396484375,
-0.00628662109375,
-0.05816650390625,
-0.01522064208984375,
-0.03204345703125,
-0.11883544921875,
0.0247650146484375,
0.00666046142578125,
-0.0127410888671875,
-0.014617919921875,
0.019439697265625,
-0.05047607421875,
-0.035675048828125,
0.0308380126953125,
-0.03485107421875,
0.03778076171875,
0.018646240234375,
0.00661468505859375,
0.007762908935546875,
-0.019195556640625,
-0.06304931640625,
-0.057098388671875,
0.01316070556640625,
-0.0909423828125,
0.0297698974609375,
0.026458740234375,
0.01393890380859375,
-0.0152435302734375,
0.004398345947265625,
0.0284271240234375,
-0.04534912109375,
0.0117645263671875,
-0.0075225830078125,
-0.0270843505859375,
0.030120849609375,
-0.00362396240234375,
-0.01384735107421875,
0.01458740234375,
0.0018243789672851562,
-0.047027587890625,
0.0028533935546875,
-0.03448486328125,
0.0024394989013671875,
0.0270843505859375,
-0.059356689453125,
-0.03826904296875,
-0.039794921875,
-0.0202178955078125,
0.01171875,
-0.045684814453125,
0.03839111328125,
-0.0352783203125,
-0.028106689453125,
0.02825927734375,
-0.0183563232421875,
-0.0276336669921875,
0.02081298828125,
0.032623291015625,
0.01441192626953125,
-0.023529052734375,
-0.015716552734375,
-0.01535797119140625,
0.03955078125,
0.0330810546875,
0.00897216796875,
0.0215301513671875,
-0.0209808349609375,
0.01340484619140625,
0.0225067138671875,
0.0037746429443359375,
-0.0142974853515625,
0.09375,
0.0166015625,
0.0006308555603027344,
-0.0030879974365234375,
-0.005863189697265625,
-0.0361328125,
0.01148223876953125,
0.0007991790771484375,
-0.0006985664367675781,
0.061065673828125,
-0.0030841827392578125,
-0.030181884765625,
0.0167999267578125,
0.014739990234375,
0.02423095703125,
-0.00693511962890625,
0.0020236968994140625,
0.037322998046875,
-0.0037631988525390625,
0.03045654296875,
-0.06414794921875,
-0.00533294677734375,
-0.00151824951171875,
-0.01297760009765625,
-0.033843994140625,
-0.0249176025390625,
0.01517486572265625,
-0.016510009765625,
-0.006092071533203125,
0.0225830078125,
0.00852203369140625,
0.061614990234375,
0.01202392578125,
-0.0001443624496459961,
-0.032379150390625,
0.003910064697265625,
0.037322998046875,
-0.0121612548828125,
0.052978515625,
0.0177001953125,
-0.002109527587890625,
-0.019561767578125,
-0.003810882568359375,
0.0200958251953125,
-0.005359649658203125,
-0.03717041015625,
-0.027099609375,
-0.004474639892578125,
-0.014923095703125,
0.01898193359375,
-0.0162200927734375,
-0.0236663818359375,
-0.003597259521484375,
-0.00286865234375,
0.038665771484375,
0.02978515625,
0.03515625,
0.0119781494140625,
-0.0175323486328125,
-0.0053558349609375,
0.0247802734375,
0.0098876953125,
-0.0200958251953125,
-0.025848388671875,
0.0313720703125,
0.035491943359375,
-0.0140838623046875,
-0.012847900390625,
0.01103973388671875,
-0.0178070068359375,
-0.0203094482421875,
0.055450439453125,
0.04559326171875,
-0.039642333984375,
-0.00450897216796875,
0.02557373046875,
0.034637451171875,
-0.03155517578125,
0.00395965576171875,
0.022979736328125,
-0.03839111328125,
0.01232147216796875,
0.01788330078125,
-0.0011959075927734375,
-0.0352783203125,
-0.044219970703125,
-0.0026454925537109375,
-0.00876617431640625,
-0.0279083251953125,
-0.091552734375,
-0.041412353515625,
0.001712799072265625,
0.0013151168823242188,
0.0247344970703125,
-0.0229034423828125,
0.0526123046875,
-0.0357666015625,
-0.004009246826171875,
-0.06787109375,
0.015777587890625,
0.0009784698486328125,
-0.0008392333984375,
-0.0408935546875,
-0.004177093505859375,
-0.03802490234375,
-0.0177001953125,
-0.059814453125,
-0.0477294921875,
-0.04693603515625,
0.00531005859375,
0.0009174346923828125,
0.0157623291015625,
-0.00676727294921875,
-0.0190887451171875,
-0.021514892578125,
0.0128631591796875,
0.031890869140625,
0.0301513671875,
-0.04229736328125,
0.07989501953125,
0.0221710205078125,
0.07354736328125,
0.001953125,
0.01983642578125,
0.00946044921875,
-0.024139404296875,
0.0307769775390625,
-0.037384033203125,
-0.00954437255859375,
-0.0210418701171875,
-0.039398193359375,
-0.054534912109375,
0.0072174072265625,
-0.0184326171875,
0.0270538330078125,
-0.0023479461669921875,
-0.0047149658203125,
-0.00908660888671875,
0.0168914794921875,
0.0012722015380859375,
0.03692626953125,
0.0228729248046875,
-0.04486083984375,
-0.0059814453125,
-0.0023326873779296875,
0.0215301513671875,
0.0074615478515625,
-0.050506591796875,
-0.0223541259765625,
0.04876708984375,
-0.04754638671875,
0.0733642578125,
0.03277587890625,
-0.0269927978515625,
0.03253173828125,
0.0082244873046875,
0.00917816162109375,
0.043609619140625,
-0.00397491455078125,
-0.0134429931640625,
0.010406494140625,
0.07574462890625,
0.0058135986328125,
-0.0134124755859375,
0.053680419921875,
-0.03118896484375,
0.0007925033569335938,
0.05120849609375,
0.066650390625,
-0.06195068359375,
-0.0194549560546875,
0.00807952880859375,
-0.0049896240234375,
0.0178375244140625,
0.006805419921875,
-0.0133514404296875,
-0.056365966796875,
0.0423583984375,
0.00567626953125,
0.0027065277099609375,
0.026519775390625,
0.0217742919921875,
-0.0101776123046875,
-0.023345947265625,
-0.00439453125,
0.022796630859375,
-0.018951416015625,
0.01087188720703125,
0.01934814453125,
0.006656646728515625,
-0.0191802978515625,
-0.0161590576171875,
0.03839111328125,
-0.051300048828125,
-0.11065673828125,
-0.0159912109375,
-0.00592041015625,
-0.05096435546875,
0.023040771484375,
-0.01404571533203125,
0.0311279296875,
0.038604736328125,
-0.0184326171875,
0.047088623046875,
-0.01056671142578125,
0.0201416015625,
-0.0243988037109375,
-0.023345947265625,
-0.004638671875,
0.0295257568359375,
-0.0528564453125,
0.03680419921875,
-0.028594970703125,
-0.0012464523315429688,
-0.0067138671875,
-0.0142822265625,
0.06292724609375,
-0.033599853515625,
-0.01087188720703125,
0.0128326416015625,
0.0232086181640625,
0.004055023193359375,
-0.019378662109375,
0.024017333984375,
-0.060455322265625,
-0.019622802734375,
-0.0117340087890625,
-0.04766845703125,
-0.0175323486328125,
-0.03466796875,
-0.0609130859375,
0.126708984375,
0.0306396484375,
0.01641845703125,
0.004146575927734375,
0.050048828125,
-0.038848876953125,
0.03460693359375,
-0.01088714599609375,
0.0086212158203125,
-0.00012993812561035156,
0.0101165771484375,
0.00899505615234375,
0.006450653076171875,
0.013763427734375,
0.0055389404296875,
-0.0006690025329589844,
-0.004787445068359375,
0.040924072265625,
-0.0088653564453125,
0.0250701904296875,
0.0491943359375,
-0.0206451416015625,
-0.0272216796875,
0.01849365234375,
0.00708770751953125,
-0.02374267578125,
0.004940032958984375,
0.06243896484375,
-0.0902099609375,
-0.016326904296875,
0.041473388671875,
0.024871826171875,
0.04937744140625,
0.008392333984375,
0.030242919921875,
0.047637939453125,
-0.0157318115234375,
-0.00995635986328125,
-0.0110626220703125,
-0.01137542724609375,
0.054931640625,
0.02947998046875,
-0.0186767578125,
-0.01401519775390625,
-0.040435791015625,
0.0484619140625,
0.0103912353515625,
0.0247802734375,
0.054901123046875,
0.030181884765625,
-0.005157470703125,
0.009368896484375,
0.032745361328125,
0.0304718017578125,
-0.031158447265625,
0.0211181640625,
0.019256591796875,
0.0167694091796875,
-0.01016998291015625,
0.055938720703125,
0.0149383544921875,
0.0185089111328125,
-0.037200927734375,
-0.027191162109375,
0.007389068603515625,
0.01087188720703125,
-0.00469207763671875,
-0.0252532958984375,
-0.004657745361328125,
-0.07183837890625,
-0.0032901763916015625,
-0.043487548828125,
-0.01210784912109375,
0.0372314453125,
0.01434326171875,
-0.0211639404296875,
-0.0182037353515625,
-0.00021648406982421875,
-0.01611328125,
-0.04498291015625,
-0.007343292236328125,
0.00502777099609375,
0.07281494140625,
0.0246124267578125,
0.0504150390625,
-0.0185699462890625,
-0.0379638671875,
-0.01067352294921875,
-0.00003910064697265625,
0.011810302734375,
0.01873779296875,
-0.037872314453125,
0.00384521484375,
0.0113372802734375,
0.0218048095703125,
0.048126220703125,
0.03497314453125,
0.05169677734375,
0.016265869140625,
-0.0215301513671875,
0.0295867919921875,
0.0094451904296875,
-0.0259246826171875,
0.0013589859008789062,
-0.0289459228515625,
0.005924224853515625,
-0.00262451171875,
-0.0153045654296875,
-0.00998687744140625,
0.040496826171875,
-0.015106201171875,
-0.02130126953125,
-0.009033203125,
0.004852294921875,
-0.025238037109375,
0.052154541015625,
-0.01727294921875,
0.037109375,
-0.0015125274658203125,
-0.07061767578125,
-0.0142822265625,
0.011077880859375,
-0.051361083984375,
0.01404571533203125,
0.04302978515625,
-0.05322265625,
0.0244598388671875,
0.0265655517578125,
0.004932403564453125,
0.005352020263671875,
-0.04705810546875,
0.0269775390625,
-0.00746917724609375,
0.005855560302734375,
0.0203094482421875,
0.004093170166015625,
0.01145172119140625,
0.033843994140625,
0.0237579345703125,
0.0323486328125,
-0.0206451416015625,
0.01727294921875,
0.0360107421875,
-0.0191497802734375,
0.005558013916015625,
-0.01480865478515625,
-0.02252197265625,
0.0259857177734375,
-0.01023101806640625,
-0.0115203857421875,
-0.01111602783203125,
-0.073486328125,
0.01715087890625,
0.0264434814453125,
-0.0178680419921875,
0.049285888671875,
-0.0236968994140625,
0.0043487548828125,
-0.03826904296875,
-0.025634765625,
-0.0181884765625,
0.00441741943359375,
0.01412200927734375,
-0.00909423828125,
0.035064697265625,
0.0011949539184570312,
-0.005176544189453125,
-0.00984954833984375,
0.0296630859375,
-0.00627899169921875,
0.0157623291015625,
0.026458740234375,
0.0254974365234375,
0.02520751953125,
-0.0181121826171875,
-0.02130126953125,
0.0299072265625,
-0.0123748779296875,
0.009124755859375,
0.0136566162109375,
0.036346435546875,
0.01319122314453125,
-0.027801513671875,
-0.025909423828125,
-0.0229644775390625,
0.000560760498046875,
-0.0228271484375,
0.005706787109375,
-0.00853729248046875,
-0.0032520294189453125,
-0.018768310546875,
0.00655364990234375,
-0.0276031494140625,
-0.059234619140625,
-0.0132293701171875,
0.016021728515625,
-0.05438232421875,
-0.03851318359375,
-0.07464599609375,
0.0104827880859375,
0.0257415771484375,
0.027435302734375,
-0.07940673828125,
0.07568359375,
-0.01009368896484375,
-0.0015001296997070312,
0.007205963134765625,
0.0106658935546875,
-0.025604248046875,
-0.023468017578125,
-0.0180816650390625,
-0.0249481201171875,
-0.06658935546875,
0.039459228515625,
-0.034820556640625,
0.006381988525390625,
0.0234222412109375,
-0.0104217529296875,
0.013580322265625,
-0.01511383056640625,
0.0100860595703125,
0.0291748046875,
-0.0187225341796875,
0.00411224365234375,
0.033966064453125,
0.014312744140625,
-0.034759521484375,
-0.07696533203125,
-0.006744384765625,
-0.031890869140625,
0.006999969482421875,
-0.00484466552734375,
-0.0273895263671875,
-0.041107177734375,
-0.056365966796875,
-0.07537841796875,
0.056365966796875,
-0.00731658935546875,
-0.0216217041015625,
0.0010242462158203125,
0.01898193359375,
-0.0298004150390625,
0.033538818359375,
0.022003173828125,
-0.031341552734375,
0.01450347900390625,
0.0192413330078125,
0.02197265625,
0.0309295654296875,
0.0253448486328125,
0.0161590576171875,
-0.08514404296875,
-0.00870513916015625,
-0.0482177734375,
0.044219970703125,
-0.0027713775634765625,
-0.028472900390625,
0.01654052734375,
0.0198822021484375,
-0.036529541015625,
-0.021392822265625,
0.00727081298828125,
0.0265045166015625,
-0.0192108154296875,
-0.039306640625,
-0.041534423828125,
-0.0174102783203125,
0.0657958984375,
0.03936767578125,
0.0174713134765625,
-0.0182037353515625,
-0.041168212890625,
-0.0032062530517578125,
-0.0181732177734375,
-0.0128326416015625,
0.01788330078125,
-0.0792236328125,
-0.0309295654296875,
0.011932373046875,
-0.01953125,
0.02392578125,
-0.007747650146484375,
-0.03790283203125,
0.0067138671875,
0.01026153564453125,
0.01189422607421875,
-0.07489013671875,
0.00777435302734375,
0.036834716796875,
-0.007297515869140625,
0.0504150390625,
-0.03643798828125,
0.018798828125,
0.040496826171875,
0.007526397705078125,
-0.037017822265625,
-0.041534423828125,
-0.0202178955078125,
0.037353515625,
-0.0294647216796875,
0.04852294921875,
-0.047119140625,
-0.004703521728515625,
-0.0439453125,
0.001316070556640625,
0.01690673828125,
0.009033203125,
-0.01047515869140625,
-0.00788116455078125,
0.028411865234375,
0.01580810546875,
-0.035858154296875,
0.039031982421875,
-0.0159912109375,
0.0233001708984375,
0.0139007568359375,
0.00789642333984375,
0.0653076171875,
-0.0054779052734375,
0.0088958740234375,
-0.0137786865234375,
0.00011646747589111328,
-0.05426025390625,
0.03076171875,
-0.007450103759765625,
-0.0037384033203125,
0.02294921875
] |
fc7eb028495f97e003c00d9e563ce4a93e82a87f
|
Wordpress Stackexchange
Q: How can I attach images to a post from the media library? Currently, there is no way to do this in a vanilla Wordpress install. Is there a way to retroactively attach an image from the Library to a post?
EDIT: Ah, let me clarify — when editing a post, and clicking the "Insert Media" button, I see no way to add past media. I can insert it into the post, but not add it to the post gallery.
A: There's a little glitch in Media panel, when attaching multiple files at once, do the following:
*
*Access Media Library panel
*Click the link Unattached
*Now you see only unattached files then select the files you want attach
*select Attach in Bulk Actions drop down and choose the page/post.
Right when accessing the panel, the Bulk Actions doen't shows the Attach option.
|
Q: How can I attach images to a post from the media library? Currently, there is no way to do this in a vanilla Wordpress install. Is there a way to retroactively attach an image from the Library to a post?
EDIT: Ah, let me clarify — when editing a post, and clicking the "Insert Media" button, I see no way to add past media. I can insert it into the post, but not add it to the post gallery.
A: There's a little glitch in Media panel, when attaching multiple files at once, do the following:
*
*Access Media Library panel
*Click the link Unattached
*Now you see only unattached files then select the files you want attach
*select Attach in Bulk Actions drop down and choose the page/post.
Right when accessing the panel, the Bulk Actions doen't shows the Attach option.
A: Not sure why you believe there's no way to attach an unattached item directly from the media library by default - in the list of media library items, You'll see a column for "Attached to". Items that are not attached to anything will say (Unattached) and then have a link to attach the item to a post.
A: This is not something that is currently supported in WordPress. There's some discussion about it here: http://core.trac.wordpress.org/ticket/6820
One plugin which does enable this functionality is:
http://skyphe.org/code/wordpress/file-gallery/
This plugin does a few extra things, but one option it provides is that after clicking "upload/insert" and going to the media library tab, you can tick check boxes beside images and choose to attach them to the current post.
There's also an old thread on WordPress support forums which pertains to adding a small bit of code to your functions.php file to enable this functionality but I think that only works within the Media Library section, not when in the Upload/Insert thickbox, so the above plugin might be your best bet.
http://wordpress.org/support/topic/detach-amp-re-attach-media-attachment-images-from-posts?replies=21
|
wordpress
|
{
"language": "en",
"length": 321,
"provenance": "stackexchange_00019.jsonl.gz:420783",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55042"
}
|
[
0.08648681640625,
0.021636962890625,
0.03497314453125,
-0.0029354095458984375,
0.015960693359375,
-0.03839111328125,
0.08868408203125,
-0.0609130859375,
0.034637451171875,
0.0075836181640625,
-0.0010280609130859375,
0.0017614364624023438,
-0.0213165283203125,
-0.026702880859375,
-0.031585693359375,
0.00490570068359375,
0.039398193359375,
-0.0239105224609375,
0.046844482421875,
0.0033111572265625,
-0.0057525634765625,
0.0149078369140625,
0.08349609375,
0.0160369873046875,
-0.002899169921875,
0.04949951171875,
0.0487060546875,
-0.01537322998046875,
0.012115478515625,
-0.0007987022399902344,
0.01442718505859375,
-0.0238037109375,
0.0227813720703125,
0.01739501953125,
-0.04107666015625,
-0.01401519775390625,
-0.0008902549743652344,
-0.007526397705078125,
-0.0201568603515625,
0.026336669921875,
-0.0170135498046875,
0.0285797119140625,
0.034271240234375,
0.019927978515625,
-0.004878997802734375,
-0.0110015869140625,
-0.0278472900390625,
-0.044158935546875,
0.0139312744140625,
-0.0236053466796875,
0.01018524169921875,
-0.009490966796875,
0.0263519287109375,
-0.034515380859375,
-0.0204620361328125,
-0.0310211181640625,
-0.02978515625,
0.0158538818359375,
0.0120849609375,
-0.01035308837890625,
-0.0017223358154296875,
0.00388336181640625,
0.01399993896484375,
0.003971099853515625,
0.035797119140625,
-0.00881195068359375,
0.023895263671875,
0.0211181640625,
-0.061920166015625,
0.0131378173828125,
0.0355224609375,
-0.046600341796875,
-0.00942230224609375,
-0.0447998046875,
0.050811767578125,
0.0197906494140625,
0.000025272369384765625,
-0.003200531005859375,
-0.01538848876953125,
0.0272369384765625,
-0.016357421875,
0.003368377685546875,
0.011627197265625,
-0.02685546875,
0.00254058837890625,
-0.0088958740234375,
-0.0201568603515625,
-0.00357818603515625,
0.01373291015625,
-0.0255279541015625,
-0.00901031494140625,
-0.0273895263671875,
0.0074920654296875,
0.01509857177734375,
-0.0249481201171875,
-0.0142974853515625,
0.05108642578125,
0.0195770263671875,
0.029083251953125,
0.0217437744140625,
-0.019073486328125,
-0.044586181640625,
0.01131439208984375,
-0.024078369140625,
-0.0024738311767578125,
-0.049346923828125,
-0.01140594482421875,
-0.041748046875,
0.01873779296875,
0.047027587890625,
-0.055419921875,
0.047271728515625,
0.038238525390625,
-0.006591796875,
0.003192901611328125,
0.025787353515625,
0.0190277099609375,
0.02691650390625,
-0.0135955810546875,
0.0168914794921875,
-0.0198211669921875,
0.01337432861328125,
-0.058013916015625,
-0.0023975372314453125,
0.01282501220703125,
-0.0256805419921875,
-0.0229644775390625,
0.0460205078125,
0.054534912109375,
0.0234832763671875,
-0.026611328125,
0.0103607177734375,
0.039794921875,
0.0182647705078125,
-0.0002903938293457031,
-0.01081085205078125,
-0.042236328125,
-0.0174102783203125,
0.007259368896484375,
0.003910064697265625,
0.003810882568359375,
-0.05938720703125,
0.007419586181640625,
0.0249786376953125,
0.0182037353515625,
0.0121917724609375,
0.0012159347534179688,
0.0279998779296875,
0.0084381103515625,
-0.05712890625,
0.048919677734375,
-0.0290985107421875,
-0.00450897216796875,
0.03338623046875,
0.022430419921875,
-0.0182037353515625,
0.07403564453125,
-0.041778564453125,
0.0288848876953125,
-0.050201416015625,
0.01666259765625,
0.0221099853515625,
0.03277587890625,
-0.01088714599609375,
-0.007335662841796875,
-0.02508544921875,
-0.0419921875,
-0.00724029541015625,
0.0234222412109375,
0.0445556640625,
-0.0201873779296875,
-0.041961669921875,
-0.0155029296875,
-0.00962066650390625,
-0.0266265869140625,
0.009185791015625,
0.005062103271484375,
0.0161590576171875,
0.0088043212890625,
0.06396484375,
0.03228759765625,
-0.003231048583984375,
0.060516357421875,
-0.005054473876953125,
-0.0269317626953125,
-0.01367950439453125,
0.01410675048828125,
0.0489501953125,
0.01108551025390625,
0.04095458984375,
-0.0157928466796875,
0.01276397705078125,
0.01092529296875,
-0.02191162109375,
-0.0204925537109375,
-0.02386474609375,
-0.004451751708984375,
0.0024204254150390625,
-0.0162811279296875,
0.024322509765625,
0.0061798095703125,
0.0203704833984375,
-0.0206146240234375,
0.0292816162109375,
-0.02081298828125,
0.01175689697265625,
-0.016937255859375,
0.01309967041015625,
-0.03790283203125,
-0.00754547119140625,
0.0411376953125,
0.0001519918441772461,
-0.0302581787109375,
-0.01274871826171875,
-0.0182342529296875,
0.04473876953125,
-0.015655517578125,
0.0042724609375,
-0.01416778564453125,
0.04278564453125,
-0.0255584716796875,
-0.016082763671875,
-0.04107666015625,
-0.01239776611328125,
0.04571533203125,
-0.0003457069396972656,
-0.032501220703125,
-0.028076171875,
-0.02435302734375,
0.01153564453125,
-0.07965087890625,
0.05938720703125,
-0.0175628662109375,
-0.05078125,
-0.03594970703125,
-0.01242828369140625,
-0.0347900390625,
-0.08074951171875,
-0.0017290115356445312,
0.065185546875,
0.028411865234375,
0.036224365234375,
0.0271453857421875,
0.07659912109375,
0.068603515625,
-0.00043463706970214844,
0.023162841796875,
0.01091766357421875,
0.016265869140625,
0.016387939453125,
-0.004833221435546875,
-0.006610870361328125,
0.02081298828125,
-0.0614013671875,
0.039764404296875,
0.031341552734375,
0.012786865234375,
0.01274871826171875,
-0.0247650146484375,
0.03076171875,
0.004619598388671875,
0.0296783447265625,
-0.0218658447265625,
0.004543304443359375,
0.0129852294921875,
0.022064208984375,
0.0164031982421875,
0.0184326171875,
-0.040771484375,
0.016815185546875,
0.0268096923828125,
0.0012912750244140625,
0.00678253173828125,
0.045623779296875,
-0.006000518798828125,
0.021881103515625,
-0.025604248046875,
-0.0193023681640625,
0.0229949951171875,
0.020538330078125,
0.002532958984375,
0.0038909912109375,
0.0063323974609375,
0.00122833251953125,
0.004734039306640625,
-0.042144775390625,
0.0294342041015625,
0.004787445068359375,
-0.04913330078125,
-0.0192108154296875,
0.006946563720703125,
0.040618896484375,
0.0220184326171875,
-0.01319122314453125,
0.01116180419921875,
0.008819580078125,
0.0012044906616210938,
-0.04351806640625,
0.040252685546875,
-0.0191497802734375,
0.0650634765625,
0.08416748046875,
-0.01062774658203125,
0.043182373046875,
-0.00910186767578125,
0.0157012939453125,
-0.00502777099609375,
0.00853729248046875,
-0.00975799560546875,
-0.0654296875,
0.00567626953125,
-0.02899169921875,
0.01617431640625,
0.0073394775390625,
-0.0266571044921875,
-0.052825927734375,
-0.00457000732421875,
-0.01210784912109375,
-0.0845947265625,
-0.046600341796875,
-0.00510406494140625,
-0.0684814453125,
0.006107330322265625,
0.000031828880310058594,
-0.042205810546875,
-0.019989013671875,
0.047607421875,
0.0101165771484375,
-0.00933074951171875,
-0.01428985595703125,
-0.0128631591796875,
-0.028533935546875,
-0.03509521484375,
-0.043914794921875,
-0.00191497802734375,
-0.0026111602783203125,
0.0014371871948242188,
0.05206298828125,
0.00009751319885253906,
-0.0352783203125,
-0.002002716064453125,
0.0185546875,
-0.004329681396484375,
-0.0205535888671875,
0.03912353515625,
0.0016307830810546875,
-0.0164031982421875,
0.0124053955078125,
0.0290679931640625,
0.053924560546875,
-0.06304931640625,
0.00634765625,
-0.0179290771484375,
-0.0261688232421875,
-0.02001953125,
0.0258331298828125,
0.0323486328125,
-0.0308837890625,
-0.007434844970703125,
-0.047607421875,
0.00685882568359375,
-0.0236053466796875,
-0.02642822265625,
-0.031494140625,
0.0111846923828125,
0.00943756103515625,
-0.049896240234375,
0.0192108154296875,
-0.03094482421875,
-0.0031757354736328125,
0.020416259765625,
-0.045989990234375,
0.00399017333984375,
-0.0176849365234375,
-0.027252197265625,
0.006927490234375,
0.018402099609375,
-0.006725311279296875,
0.035858154296875,
0.01351165771484375,
0.0418701171875,
-0.00934600830078125,
0.03131103515625,
-0.039703369140625,
-0.06353759765625,
0.0294036865234375,
-0.0582275390625,
0.0258331298828125,
-0.0631103515625,
-0.0234832763671875,
-0.01361846923828125,
0.0948486328125,
-0.053070068359375,
-0.033721923828125,
-0.0078582763671875,
0.01275634765625,
0.0159759521484375,
-0.0142059326171875,
0.0163421630859375,
-0.035858154296875,
-0.0310516357421875,
0.0008740425109863281,
0.0012674331665039062,
-0.0222015380859375,
-0.0113983154296875,
0.00897979736328125,
-0.0120697021484375,
-0.0223541259765625,
0.0205230712890625,
0.000003516674041748047,
0.010986328125,
-0.000240325927734375,
-0.018585205078125,
0.0030574798583984375,
-0.01505279541015625,
-0.02081298828125,
-0.11553955078125,
-0.018157958984375,
0.008453369140625,
0.07696533203125,
-0.0261688232421875,
0.01154327392578125,
-0.0257110595703125,
0.051666259765625,
0.0166778564453125,
-0.006237030029296875,
0.027557373046875,
0.007366180419921875,
0.0180816650390625,
-0.019317626953125,
0.0185546875,
-0.042449951171875,
-0.029937744140625,
-0.07586669921875,
-0.0133209228515625,
-0.01995849609375,
-0.020111083984375,
0.0309600830078125,
-0.034210205078125,
0.020263671875,
-0.0186004638671875,
-0.0112762451171875,
0.038116455078125,
0.054931640625,
-0.0205078125,
0.036590576171875,
-0.044677734375,
-0.0228271484375,
-0.01409149169921875,
-0.00237274169921875,
0.010009765625,
0.0255584716796875,
0.017913818359375,
0.00728607177734375,
0.0034275054931640625,
-0.064453125,
0.048614501953125,
0.036865234375,
-0.019683837890625,
0.0457763671875,
0.016876220703125,
-0.006725311279296875,
0.02557373046875,
-0.00250244140625,
0.00911712646484375,
-0.047882080078125,
0.06573486328125,
-0.00787353515625,
0.00616455078125,
0.0038890838623046875,
-0.022308349609375,
0.034637451171875,
0.0110626220703125,
-0.028472900390625,
-0.0267486572265625,
-0.051483154296875,
0.041748046875,
0.01019287109375,
0.043914794921875,
-0.049346923828125,
-0.04656982421875,
0.004360198974609375,
-0.040252685546875,
0.0518798828125,
0.0170135498046875,
-0.0040435791015625,
0.0245361328125,
0.02471923828125,
-0.0057373046875,
0.0009775161743164062,
0.00688934326171875,
-0.009002685546875,
0.04205322265625,
-0.0280303955078125,
-0.00844573974609375,
-0.0025424957275390625,
-0.004215240478515625,
0.006153106689453125,
0.00074005126953125,
-0.03271484375,
-0.0139923095703125,
-0.0214691162109375,
0.03167724609375,
-0.0128021240234375,
0.0237274169921875,
0.044464111328125,
0.0079193115234375,
-0.0018100738525390625,
-0.01214599609375,
-0.0157470703125,
-0.0012607574462890625,
-0.0443115234375,
0.023712158203125,
0.01158905029296875,
-0.01239776611328125,
0.0631103515625,
-0.0215911865234375,
-0.00753021240234375,
0.0169677734375,
-0.013641357421875,
0.007419586181640625,
0.023773193359375,
0.025390625,
0.0293121337890625,
-0.0008287429809570312,
-0.035888671875,
0.0224456787109375,
-0.00717926025390625,
-0.03955078125,
0.057861328125,
0.01398468017578125,
0.0452880859375,
-0.00844573974609375,
-0.0782470703125,
0.02288818359375,
-0.091552734375,
-0.0270233154296875,
0.036224365234375,
-0.007762908935546875,
-0.05682373046875,
-0.0273590087890625,
0.01026153564453125,
0.030242919921875,
-0.0163116455078125,
-0.00978851318359375,
-0.024566650390625,
-0.00970458984375,
0.031951904296875,
-0.005725860595703125,
-0.01210784912109375,
0.01617431640625,
-0.0005559921264648438,
-0.0234222412109375,
-0.0066070556640625,
-0.0175018310546875,
0.02423095703125,
0.00917816162109375,
-0.0181732177734375,
-0.037384033203125,
0.066650390625,
-0.033233642578125,
0.023406982421875,
-0.0229339599609375,
-0.005855560302734375,
0.016998291015625,
0.0206146240234375,
0.0528564453125,
0.006805419921875,
0.035369873046875,
-0.01337432861328125,
-0.037200927734375,
-0.02899169921875,
0.01358795166015625,
-0.0115966796875,
-0.0181427001953125,
-0.023681640625,
0.0152435302734375,
0.04815673828125,
-0.002201080322265625,
-0.018707275390625,
0.0041046142578125,
-0.004055023193359375,
-0.004489898681640625,
0.065185546875,
0.0193939208984375,
0.01505279541015625,
-0.0106964111328125,
0.078369140625,
0.01369476318359375,
0.0001245737075805664,
-0.05194091796875,
-0.04266357421875,
-0.0283355712890625,
-0.08953857421875,
0.0104217529296875,
0.04522705078125,
-0.012603759765625,
0.055450439453125,
0.006130218505859375,
0.032073974609375,
0.0168304443359375,
-0.0229949951171875,
0.0007710456848144531,
-0.01458740234375,
0.02459716796875,
-0.0266265869140625,
-0.020233154296875,
0.053497314453125,
-0.028167724609375,
0.03271484375,
-0.033203125,
-0.0294036865234375,
0.0153045654296875,
-0.0194244384765625,
-0.00397491455078125,
0.067138671875,
-0.0291900634765625,
0.00489044189453125,
0.057525634765625,
0.01509857177734375,
0.050506591796875,
0.01336669921875,
0.005542755126953125,
0.044891357421875,
0.037139892578125,
-0.020843505859375,
-0.0433349609375,
0.042022705078125,
0.01294708251953125,
-0.0178070068359375,
0.032257080078125,
-0.0250091552734375,
0.0172271728515625,
-0.05535888671875,
0.013946533203125,
0.0272369384765625,
0.0246124267578125,
0.00031185150146484375,
-0.0204010009765625,
0.040740966796875,
-0.0287628173828125,
0.0181427001953125,
0.0028171539306640625,
0.061248779296875,
-0.013885498046875,
-0.0195770263671875,
0.012481689453125,
-0.0179901123046875,
0.0040283203125,
-0.0006985664367675781,
-0.005931854248046875,
-0.00738525390625,
-0.038604736328125,
-0.03717041015625,
0.040374755859375,
-0.0389404296875,
-0.0022106170654296875,
0.0109405517578125,
-0.066162109375,
-0.004131317138671875,
-0.03778076171875,
-0.03509521484375,
-0.03680419921875,
0.016510009765625,
0.0074615478515625,
-0.00492095947265625,
0.0579833984375,
0.0380859375,
-0.007762908935546875,
0.00911712646484375,
0.004848480224609375,
-0.008697509765625,
0.0185546875,
-0.0152587890625,
0.035491943359375,
0.0034999847412109375,
-0.04052734375,
0.00455474853515625,
-0.025482177734375,
-0.0067138671875,
-0.01678466796875,
-0.0244903564453125,
0.07208251953125,
-0.0740966796875,
0.01727294921875,
0.027252197265625,
0.033233642578125,
-0.004779815673828125,
0.0020389556884765625,
0.01132965087890625,
-0.042724609375,
-0.01186370849609375,
0.0011358261108398438,
-0.0316162109375,
-0.00971221923828125,
-0.0181884765625,
-0.071044921875,
0.07623291015625,
-0.01544952392578125,
0.04083251953125,
-0.0208587646484375,
0.04327392578125,
0.0338134765625,
0.027191162109375,
-0.0292816162109375,
0.042388916015625,
-0.004055023193359375,
0.022491455078125,
-0.06878662109375,
-0.00809478759765625,
-0.0159912109375,
0.03070068359375,
0.07257080078125,
0.01299285888671875,
-0.0506591796875,
-0.035797119140625,
0.038726806640625,
0.061065673828125,
0.025665283203125,
0.033935546875,
0.00785064697265625,
0.0038242340087890625,
0.03143310546875,
-0.01519775390625,
0.039031982421875,
-0.0377197265625,
-0.00452423095703125,
0.0028514862060546875,
-0.0037403106689453125,
-0.019927978515625,
0.0181732177734375,
0.04510498046875,
-0.01206207275390625,
-0.002414703369140625,
0.01535797119140625,
-0.034637451171875,
0.03448486328125,
0.031585693359375,
0.005626678466796875,
0.0587158203125,
0.0195159912109375,
-0.004810333251953125,
0.0289154052734375,
-0.012908935546875,
0.03521728515625,
0.031280517578125,
0.019622802734375,
0.01479339599609375,
0.01126861572265625,
0.0247650146484375,
0.0177001953125,
-0.016754150390625,
0.056884765625,
-0.003753662109375,
0.01433563232421875,
-0.07220458984375,
-0.007110595703125,
0.034271240234375,
0.0594482421875,
-0.03472900390625,
0.01224517822265625,
0.022430419921875,
-0.0204010009765625,
-0.032806396484375,
-0.049896240234375,
-0.04071044921875,
-0.0565185546875,
-0.06268310546875,
-0.0197601318359375,
-0.002552032470703125,
0.006069183349609375,
0.053985595703125,
0.0033016204833984375,
0.0264434814453125,
-0.03643798828125,
-0.03350830078125,
-0.00716400146484375,
0.00981903076171875,
-0.0086669921875,
0.0162506103515625,
-0.00983428955078125,
0.050445556640625,
0.00901031494140625,
0.0104827880859375,
-0.0169219970703125,
0.041717529296875,
-0.01165771484375,
0.02911376953125,
-0.015869140625,
-0.04150390625,
0.001308441162109375,
0.0194244384765625,
0.035186767578125,
0.015899658203125,
0.045196533203125,
0.04010009765625,
-0.03363037109375,
-0.004306793212890625,
0.0390625,
-0.01158905029296875,
0.03179931640625,
-0.047332763671875,
0.046905517578125,
0.0280609130859375,
-0.01065826416015625,
-0.0145111083984375,
-0.01922607421875,
0.07696533203125,
-0.056243896484375,
0.0199127197265625,
-0.01528167724609375,
-0.04339599609375,
0.0183563232421875,
-0.006256103515625,
0.07330322265625,
-0.0159149169921875,
-0.030303955078125,
-0.00911712646484375,
-0.0008111000061035156,
-0.0672607421875,
0.01383209228515625,
0.03558349609375,
-0.034271240234375,
0.01146697998046875,
-0.026824951171875,
0.013916015625,
0.0233306884765625,
-0.040740966796875,
0.0122833251953125,
0.00528717041015625,
0.0063934326171875,
0.00489044189453125,
-0.031341552734375,
-0.019012451171875,
-0.04364013671875,
0.0245361328125,
0.0399169921875,
0.034423828125,
0.0036907196044921875,
0.052734375,
-0.0305328369140625,
0.0112457275390625,
-0.03887939453125,
0.0175018310546875,
-0.0718994140625,
0.00860595703125,
0.01389312744140625,
-0.0128021240234375,
0.01763916015625,
0.0364990234375,
0.01398468017578125,
-0.05267333984375,
-0.0300140380859375,
0.0026264190673828125,
0.005977630615234375,
0.0223388671875,
0.0310516357421875,
-0.00974273681640625,
0.00955963134765625,
-0.01837158203125,
-0.0196990966796875,
0.04083251953125,
0.0080108642578125,
-0.0174102783203125,
0.0082855224609375,
0.037139892578125,
0.007114410400390625,
0.008819580078125,
0.009918212890625,
0.030303955078125,
0.03350830078125,
-0.007190704345703125,
-0.036834716796875,
0.010467529296875,
-0.0080413818359375,
-0.00865936279296875,
0.00827789306640625,
0.036041259765625,
0.00814056396484375,
-0.050567626953125,
0.0247650146484375,
0.0279693603515625,
0.043426513671875,
0.00543212890625,
0.001567840576171875,
-0.00778961181640625,
-0.01323699951171875,
0.0006775856018066406,
-0.014068603515625,
-0.0296630859375,
-0.06329345703125,
0.00328826904296875,
0.042694091796875,
-0.0355224609375,
0.01776123046875,
-0.08502197265625,
0.00334930419921875,
0.0273284912109375,
0.022369384765625,
-0.07147216796875,
0.053436279296875,
0.0006275177001953125,
0.0048980712890625,
0.0135345458984375,
-0.0186614990234375,
0.0191192626953125,
0.076171875,
-0.0428466796875,
-0.07666015625,
-0.033203125,
0.0272216796875,
-0.06866455078125,
0.037506103515625,
0.0238037109375,
-0.037506103515625,
0.03314208984375,
0.04815673828125,
0.0570068359375,
0.09942626953125,
0.00991058349609375,
-0.034912109375,
0.0012197494506835938,
-0.005702972412109375,
0.011993408203125,
-0.005512237548828125,
0.01230621337890625,
-0.035400390625,
-0.0010833740234375,
-0.0240478515625,
0.01409912109375,
0.0130157470703125,
-0.033233642578125,
-0.0850830078125,
0.006183624267578125,
-0.0096435546875,
-0.04669189453125,
-0.0577392578125,
0.037200927734375,
-0.00433349609375,
-0.0031528472900390625,
-0.0278472900390625,
0.0004572868347167969,
0.0187225341796875,
0.0301666259765625,
-0.0021419525146484375,
0.033660888671875,
-0.004718780517578125,
-0.00506591796875,
-0.0223236083984375,
0.0023288726806640625,
-0.0027408599853515625,
0.00543975830078125,
0.02227783203125,
-0.023223876953125,
0.04315185546875,
0.03204345703125,
-0.0531005859375,
0.0206298828125,
-0.01413726806640625,
0.02655029296875,
-0.0340576171875,
-0.04205322265625,
-0.033172607421875,
-0.0189056396484375,
0.08807373046875,
0.074951171875,
0.0285797119140625,
-0.0322265625,
0.039520263671875,
0.0009436607360839844,
-0.029022216796875,
0.0010786056518554688,
-0.001556396484375,
-0.0100555419921875,
-0.007122039794921875,
-0.0291748046875,
-0.002399444580078125,
-0.005096435546875,
-0.0122833251953125,
-0.0254669189453125,
-0.01248931884765625,
0.0027217864990234375,
0.006557464599609375,
-0.03643798828125,
0.0157318115234375,
0.055755615234375,
-0.0325927734375,
0.0220947265625,
0.01393890380859375,
-0.00601959228515625,
0.03717041015625,
0.034149169921875,
0.043701171875,
0.0027256011962890625,
0.008270263671875,
0.0173797607421875,
0.028839111328125,
0.01424407958984375,
-0.0018262863159179688,
-0.03533935546875,
-0.0000756978988647461,
-0.0105133056640625,
-0.01885986328125,
-0.0188140869140625,
0.0435791015625,
0.035858154296875,
-0.0113677978515625,
0.063720703125,
-0.033935546875,
-0.0244293212890625,
-0.00955963134765625,
-0.01244354248046875,
-0.047149658203125,
0.038421630859375,
0.023162841796875,
-0.036956787109375,
0.0009646415710449219,
-0.0081634521484375,
-0.04107666015625,
-0.035858154296875,
0.00511932373046875,
-0.00982666015625,
-0.0307159423828125,
0.0160064697265625
] |
f975554c4a234ff23706d7204ebcc0e2a931d382
|
Wordpress Stackexchange
Q: force enqueue script to be first in order of prominence I have a few scripts which are being enqueued,
the problem is that I want to force the order of prominece to which these scripts are loaded. There is one in particular which is loaded from a plugin before the theme ones which requires jquery however the plugin does not require jquery (bad dev on the plugin but I'd rather not touch 3rd party code for futureproofing reasons)
is there some way to mess with the enqueue order at runtime?
Thanks very much
A: You just need to enqueue your scripts before plugin does it. You can do it by setting priority to 0 for your hook. For example, do the following:
add_filter( 'wp_enqueue_scripts', 'wpse8170_enqueue_my_scripts', 0 );
// or if you enqueue your scripts on init action
// add_action( 'init', 'wpse8170_enqueue_my_scripts', 0 );
function wpse8170_enqueue_my_scripts() {
wp_enqueue_script( 'myscript', 'http://path/to/my/script.js', array( 'jquery' ) );
// my else scripts go here...
}
Setting up priority for your hooks will put it to the beginning of calling queue and your scripts will be added first.
|
Q: force enqueue script to be first in order of prominence I have a few scripts which are being enqueued,
the problem is that I want to force the order of prominece to which these scripts are loaded. There is one in particular which is loaded from a plugin before the theme ones which requires jquery however the plugin does not require jquery (bad dev on the plugin but I'd rather not touch 3rd party code for futureproofing reasons)
is there some way to mess with the enqueue order at runtime?
Thanks very much
A: You just need to enqueue your scripts before plugin does it. You can do it by setting priority to 0 for your hook. For example, do the following:
add_filter( 'wp_enqueue_scripts', 'wpse8170_enqueue_my_scripts', 0 );
// or if you enqueue your scripts on init action
// add_action( 'init', 'wpse8170_enqueue_my_scripts', 0 );
function wpse8170_enqueue_my_scripts() {
wp_enqueue_script( 'myscript', 'http://path/to/my/script.js', array( 'jquery' ) );
// my else scripts go here...
}
Setting up priority for your hooks will put it to the beginning of calling queue and your scripts will be added first.
A: To add script before other scripts, use wp_register_script() instead of wp_enqueue_script(), and then manually add your script to be first at queue:
wp_register_script('handle', get_template_directory_uri()."/custom.js");
array_unshift(wp_scripts()->queue, 'handle');
|
wordpress
|
{
"language": "en",
"length": 210,
"provenance": "stackexchange_00019.jsonl.gz:420794",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55084"
}
|
[
0.0185699462890625,
0.00652313232421875,
-0.0540771484375,
-0.031402587890625,
0.01448822021484375,
-0.040740966796875,
0.0212249755859375,
0.0216522216796875,
-0.024810791015625,
0.004398345947265625,
-0.04046630859375,
0.0111846923828125,
-0.0531005859375,
-0.0088043212890625,
-0.0005702972412109375,
-0.0810546875,
0.035675048828125,
-0.042144775390625,
-0.021728515625,
-0.03057861328125,
0.004154205322265625,
0.00518798828125,
-0.007843017578125,
0.09423828125,
-0.006771087646484375,
-0.026519775390625,
0.0863037109375,
0.009765625,
-0.00833892822265625,
-0.019287109375,
0.0161590576171875,
-0.00885772705078125,
0.0115814208984375,
0.01288604736328125,
-0.003368377685546875,
-0.0179901123046875,
0.0133056640625,
-0.00020897388458251953,
0.008453369140625,
0.020263671875,
0.01561737060546875,
0.005428314208984375,
-0.0168304443359375,
0.0357666015625,
-0.032867431640625,
-0.0462646484375,
0.0097808837890625,
-0.019622802734375,
0.0018453598022460938,
0.00228118896484375,
0.0088348388671875,
-0.001865386962890625,
0.0185699462890625,
0.0028209686279296875,
-0.0020847320556640625,
0.0211334228515625,
-0.0478515625,
-0.01513671875,
-0.00968170166015625,
0.0909423828125,
0.051025390625,
0.03363037109375,
-0.028045654296875,
-0.050628662109375,
-0.02398681640625,
-0.0037555694580078125,
0.0037994384765625,
0.0060577392578125,
-0.02642822265625,
-0.00608062744140625,
0.037200927734375,
-0.01227569580078125,
-0.0168304443359375,
-0.0036792755126953125,
-0.03692626953125,
-0.0014734268188476562,
0.0311431884765625,
-0.0029087066650390625,
0.0209503173828125,
-0.00048828125,
0.005275726318359375,
-0.039642333984375,
0.026214599609375,
-0.0191192626953125,
-0.002048492431640625,
-0.01067352294921875,
-0.013580322265625,
0.01079559326171875,
-0.02984619140625,
-0.0215301513671875,
-0.041351318359375,
0.0188751220703125,
0.0021915435791015625,
-0.027252197265625,
-0.050933837890625,
0.0203094482421875,
0.05084228515625,
0.03619384765625,
0.0303192138671875,
0.022552490234375,
0.0014629364013671875,
-0.057647705078125,
0.035064697265625,
-0.024017333984375,
-0.02581787109375,
-0.0038776397705078125,
0.007595062255859375,
-0.0401611328125,
-0.01318359375,
0.0276947021484375,
-0.029693603515625,
-0.00881195068359375,
0.033966064453125,
0.017669677734375,
-0.00783538818359375,
-0.052215576171875,
-0.036529541015625,
0.039703369140625,
-0.01232147216796875,
0.00211334228515625,
0.011199951171875,
0.023651123046875,
-0.01107025146484375,
-0.038360595703125,
-0.002162933349609375,
-0.03594970703125,
-0.03692626953125,
-0.00005650520324707031,
-0.039642333984375,
0.0310516357421875,
-0.0109405517578125,
0.003368377685546875,
0.050018310546875,
0.030914306640625,
-0.0022296905517578125,
-0.0143280029296875,
0.0216064453125,
-0.00860595703125,
-0.031036376953125,
0.0150604248046875,
-0.0247955322265625,
-0.03082275390625,
-0.0165252685546875,
-0.0445556640625,
-0.0257415771484375,
0.00534820556640625,
0.0012083053588867188,
0.0185394287109375,
0.0057220458984375,
-0.032989501953125,
-0.005725860595703125,
-0.04156494140625,
0.046112060546875,
-0.005756378173828125,
-0.0095672607421875,
-0.005672454833984375,
0.01259613037109375,
-0.004817962646484375,
-0.039031982421875,
-0.018463134765625,
-0.06365966796875,
0.0145263671875,
0.023529052734375,
-0.0538330078125,
-0.0312347412109375,
-0.028350830078125,
0.03375244140625,
-0.0026073455810546875,
0.0355224609375,
0.0305023193359375,
-0.01535797119140625,
-0.00887298583984375,
0.043731689453125,
0.0193634033203125,
-0.016632080078125,
0.0355224609375,
0.01482391357421875,
0.0013761520385742188,
0.02294921875,
-0.005222320556640625,
-0.033477783203125,
-0.039581298828125,
0.05072021484375,
-0.034332275390625,
-0.053924560546875,
0.020721435546875,
0.024749755859375,
0.07647705078125,
-0.00989532470703125,
0.021484375,
0.0684814453125,
0.0220794677734375,
-0.038909912109375,
0.005680084228515625,
-0.01114654541015625,
0.004608154296875,
0.024017333984375,
0.02679443359375,
0.00983428955078125,
-0.02880859375,
0.0225677490234375,
0.00882720947265625,
-0.01215362548828125,
-0.024261474609375,
-0.029144287109375,
-0.0223236083984375,
-0.0094757080078125,
0.0297698974609375,
0.033843994140625,
-0.00489044189453125,
-0.0025806427001953125,
0.02777099609375,
-0.0019817352294921875,
-0.0732421875,
-0.05987548828125,
0.0421142578125,
-0.0325927734375,
0.09295654296875,
-0.007266998291015625,
0.047576904296875,
0.0132904052734375,
-0.100341796875,
0.025238037109375,
0.01209259033203125,
-0.016326904296875,
0.00646209716796875,
-0.022369384765625,
-0.0008296966552734375,
0.00848388671875,
0.004779815673828125,
0.03448486328125,
0.0242156982421875,
0.03021240234375,
0.06805419921875,
0.0016803741455078125,
-0.00666046142578125,
0.006107330322265625,
-0.04388427734375,
0.0187225341796875,
0.01538848876953125,
0.01457977294921875,
0.043548583984375,
-0.0136566162109375,
0.031982421875,
-0.013214111328125,
-0.05780029296875,
0.00807952880859375,
0.00936126708984375,
0.0217437744140625,
0.026763916015625,
-0.0247955322265625,
0.00048470497131347656,
0.031707763671875,
-0.0323486328125,
0.018829345703125,
0.043670654296875,
0.029327392578125,
0.01044464111328125,
-0.01354217529296875,
0.003650665283203125,
0.00829315185546875,
-0.00733184814453125,
-0.04754638671875,
0.01035308837890625,
0.0266571044921875,
-0.0229949951171875,
0.01166534423828125,
-0.004547119140625,
-0.005764007568359375,
-0.008819580078125,
0.0292205810546875,
-0.0302734375,
-0.0127716064453125,
-0.0207672119140625,
0.04168701171875,
-0.050048828125,
-0.029052734375,
0.021728515625,
-0.022430419921875,
-0.0228729248046875,
0.0027561187744140625,
0.0097503662109375,
-0.0235137939453125,
-0.0003387928009033203,
-0.01302337646484375,
-0.0252685546875,
0.028656005859375,
0.03985595703125,
-0.007354736328125,
-0.028076171875,
0.01450347900390625,
-0.015655517578125,
-0.0208892822265625,
0.0015630722045898438,
0.005290985107421875,
-0.0548095703125,
0.0161895751953125,
-0.0253753662109375,
0.038116455078125,
-0.037017822265625,
0.00815582275390625,
0.06121826171875,
-0.00787353515625,
0.01513671875,
-0.004314422607421875,
0.01114654541015625,
0.0022830963134765625,
-0.01407623291015625,
-0.0139007568359375,
0.0011930465698242188,
-0.058563232421875,
0.01474761962890625,
0.04296875,
0.08673095703125,
0.0243988037109375,
-0.0174407958984375,
0.020751953125,
0.06451416015625,
-0.04425048828125,
-0.10357666015625,
0.002597808837890625,
-0.053955078125,
0.06756591796875,
-0.02734375,
-0.002101898193359375,
-0.052581787109375,
0.0014581680297851562,
0.0259246826171875,
-0.042236328125,
-0.00926971435546875,
-0.004474639892578125,
-0.022857666015625,
-0.01207733154296875,
0.057647705078125,
0.00865936279296875,
0.0008730888366699219,
0.0196533203125,
0.0413818359375,
0.019805908203125,
-0.053314208984375,
0.01245880126953125,
0.0045623779296875,
-0.04052734375,
0.00015854835510253906,
0.033050537109375,
-0.0499267578125,
-0.01235198974609375,
0.005565643310546875,
-0.01470947265625,
0.01377105712890625,
0.007472991943359375,
-0.006195068359375,
-0.03790283203125,
-0.038970947265625,
-0.0020503997802734375,
0.0718994140625,
0.0182952880859375,
-0.0258636474609375,
0.04913330078125,
-0.05267333984375,
-0.01103973388671875,
0.0311126708984375,
-0.02349853515625,
-0.02484130859375,
-0.006023406982421875,
-0.03448486328125,
-0.0012950897216796875,
0.00530242919921875,
-0.0015001296997070312,
-0.006046295166015625,
-0.00992584228515625,
0.00412750244140625,
0.04302978515625,
-0.0279388427734375,
-0.004825592041015625,
-0.01708984375,
0.0655517578125,
-0.019287109375,
-0.005428314208984375,
0.00921630859375,
-0.006664276123046875,
-0.0141143798828125,
-0.0303802490234375,
-0.041839599609375,
0.019287109375,
-0.0095672607421875,
-0.0450439453125,
0.0277557373046875,
-0.0284576416015625,
0.0204010009765625,
-0.00399017333984375,
0.034576416015625,
-0.07220458984375,
-0.018035888671875,
0.01019287109375,
0.029632568359375,
-0.027008056640625,
-0.048583984375,
-0.0262298583984375,
-0.03509521484375,
-0.06756591796875,
0.0244903564453125,
-0.00952911376953125,
0.00254058837890625,
-0.019561767578125,
-0.0005316734313964844,
-0.03759765625,
-0.0458984375,
0.03948974609375,
-0.09130859375,
-0.002071380615234375,
0.0167083740234375,
-0.033294677734375,
-0.022705078125,
-0.04052734375,
-0.043975830078125,
-0.09954833984375,
-0.00760650634765625,
-0.060791015625,
0.06365966796875,
0.017822265625,
-0.002819061279296875,
-0.0241241455078125,
0.04534912109375,
-0.0230560302734375,
0.00856781005859375,
0.0232391357421875,
0.03619384765625,
-0.0145263671875,
-0.0022525787353515625,
-0.0005474090576171875,
-0.037078857421875,
0.0020999908447265625,
-0.006099700927734375,
-0.042449951171875,
-0.0159759521484375,
-0.0168609619140625,
0.0285797119140625,
0.03369140625,
-0.039703369140625,
-0.048187255859375,
-0.03326416015625,
-0.0176849365234375,
-0.008819580078125,
0.005229949951171875,
-0.0193939208984375,
-0.03857421875,
-0.043243408203125,
0.006488800048828125,
-0.056365966796875,
0.0112152099609375,
-0.0029354095458984375,
0.062744140625,
0.0310211181640625,
0.01528167724609375,
0.06890869140625,
0.006229400634765625,
0.0020732879638671875,
0.026153564453125,
0.0592041015625,
-0.01468658447265625,
-0.003276824951171875,
0.06640625,
-0.0101776123046875,
0.015960693359375,
0.01319122314453125,
0.040863037109375,
0.024658203125,
-0.011322021484375,
0.006931304931640625,
0.045440673828125,
-0.0704345703125,
-0.031036376953125,
-0.017333984375,
0.023468017578125,
0.028656005859375,
-0.013336181640625,
-0.024169921875,
0.01535797119140625,
0.01070404052734375,
-0.00827789306640625,
-0.0076751708984375,
0.01107025146484375,
0.028289794921875,
0.040557861328125,
-0.0036487579345703125,
0.003574371337890625,
0.036346435546875,
-0.01107025146484375,
0.01812744140625,
0.01557159423828125,
0.01329803466796875,
0.0223846435546875,
0.0226287841796875,
0.00655364990234375,
-0.0028209686279296875,
-0.004558563232421875,
0.02398681640625,
-0.007015228271484375,
-0.0225067138671875,
-0.051849365234375,
0.003582000732421875,
0.084716796875,
-0.0059661865234375,
-0.00254058837890625,
0.039764404296875,
0.033172607421875,
-0.034759521484375,
-0.0172882080078125,
-0.0266571044921875,
0.016815185546875,
-0.040283203125,
0.04425048828125,
0.0181121826171875,
-0.018524169921875,
-0.035247802734375,
0.02642822265625,
0.028228759765625,
-0.0248870849609375,
-0.0082855224609375,
0.00768280029296875,
-0.005336761474609375,
0.031494140625,
0.03338623046875,
-0.01361083984375,
-0.0012140274047851562,
0.00550079345703125,
0.0183563232421875,
-0.00789642333984375,
0.0297393798828125,
-0.0082855224609375,
-0.0078277587890625,
-0.0125274658203125,
-0.00904083251953125,
0.04351806640625,
-0.007038116455078125,
-0.0174102783203125,
0.0419921875,
0.0350341796875,
-0.031463623046875,
-0.0355224609375,
-0.049041748046875,
0.0201568603515625,
0.017822265625,
0.006435394287109375,
0.038726806640625,
0.01227569580078125,
0.03509521484375,
-0.00339508056640625,
-0.00717926025390625,
-0.01108551025390625,
-0.0014371871948242188,
0.0162811279296875,
0.01560211181640625,
0.010498046875,
-0.06634521484375,
-0.0556640625,
0.0032901763916015625,
0.003803253173828125,
0.031524658203125,
-0.00717926025390625,
0.0360107421875,
-0.029449462890625,
-0.01534271240234375,
-0.03729248046875,
0.028533935546875,
-0.006092071533203125,
-0.010101318359375,
-0.01715087890625,
-0.0364990234375,
-0.06439208984375,
-0.0389404296875,
-0.07196044921875,
-0.033111572265625,
-0.026641845703125,
0.0280914306640625,
-0.01427459716796875,
0.018280029296875,
-0.0406494140625,
-0.0478515625,
-0.0031604766845703125,
-0.00891876220703125,
-0.004425048828125,
0.01506805419921875,
-0.054351806640625,
0.09820556640625,
0.0203704833984375,
-0.00913238525390625,
0.00408935546875,
0.048065185546875,
0.0240631103515625,
0.01300048828125,
-0.04730224609375,
-0.07598876953125,
0.042694091796875,
0.0341796875,
-0.0212860107421875,
0.0244140625,
0.0273590087890625,
0.026458740234375,
0.052276611328125,
0.033355712890625,
0.01537322998046875,
0.0136260986328125,
-0.05157470703125,
0.0312347412109375,
0.0157012939453125,
0.07232666015625,
0.003353118896484375,
0.0189666748046875,
-0.02496337890625,
-0.0127716064453125,
0.0205841064453125,
-0.00968170166015625,
0.025848388671875,
-0.017578125,
-0.04852294921875,
0.03961181640625,
-0.0027179718017578125,
0.0247650146484375,
0.00921630859375,
-0.030242919921875,
0.0254364013671875,
-0.0279083251953125,
0.0201263427734375,
-0.018768310546875,
-0.054901123046875,
-0.00411224365234375,
-0.0157470703125,
-0.0128631591796875,
-0.0111236572265625,
-0.0141143798828125,
-0.01111602783203125,
-0.003566741943359375,
0.0293121337890625,
-0.01100921630859375,
0.0063934326171875,
-0.01529693603515625,
-0.0229949951171875,
-0.024993896484375,
-0.035369873046875,
0.0170745849609375,
0.008636474609375,
0.0899658203125,
0.00823974609375,
-0.009307861328125,
0.05474853515625,
-0.016143798828125,
-0.048004150390625,
-0.01611328125,
-0.06768798828125,
0.0224151611328125,
0.0095977783203125,
0.055145263671875,
-0.007495880126953125,
0.0360107421875,
0.00818634033203125,
0.00861358642578125,
0.0162506103515625,
-0.0380859375,
-0.01534271240234375,
0.0175933837890625,
-0.0133209228515625,
-0.040435791015625,
0.030120849609375,
-0.0097503662109375,
0.0207672119140625,
0.01555633544921875,
0.0013561248779296875,
-0.006801605224609375,
-0.016021728515625,
-0.01153564453125,
0.005092620849609375,
-0.04425048828125,
0.0309906005859375,
0.03961181640625,
-0.05352783203125,
0.027557373046875,
0.0147247314453125,
-0.04205322265625,
-0.007488250732421875,
-0.05792236328125,
0.04302978515625,
-0.041168212890625,
-0.0013494491577148438,
-0.01277923583984375,
0.0430908203125,
0.0230712890625,
-0.0180206298828125,
0.0511474609375,
-0.0469970703125,
-0.045928955078125,
0.0163421630859375,
-0.054473876953125,
-0.0494384765625,
-0.03515625,
-0.04052734375,
0.09185791015625,
-0.006839752197265625,
-0.0025463104248046875,
0.005664825439453125,
0.036834716796875,
-0.0224609375,
0.014495849609375,
-0.0222320556640625,
0.0364990234375,
-0.03948974609375,
0.070556640625,
-0.042236328125,
-0.0162353515625,
0.0305633544921875,
0.05426025390625,
0.00337982177734375,
-0.00843048095703125,
0.00579071044921875,
0.01337432861328125,
0.06182861328125,
0.083740234375,
0.03271484375,
-0.0206146240234375,
0.00960540771484375,
0.0008754730224609375,
-0.024383544921875,
-0.01495361328125,
0.027740478515625,
-0.07830810546875,
-0.0239410400390625,
0.015533447265625,
0.01971435546875,
0.0260772705078125,
-0.019439697265625,
0.004161834716796875,
-0.0487060546875,
0.0157623291015625,
0.040191650390625,
0.04443359375,
-0.01239776611328125,
0.038482666015625,
-0.005840301513671875,
0.00481414794921875,
-0.0823974609375,
0.005832672119140625,
0.006450653076171875,
-0.01444244384765625,
-0.002788543701171875,
0.045318603515625,
0.03045654296875,
-0.0250091552734375,
-0.016021728515625,
-0.00336456298828125,
-0.0010986328125,
-0.035400390625,
0.0316162109375,
0.01448822021484375,
0.01515960693359375,
-0.017913818359375,
0.000058650970458984375,
0.013519287109375,
0.033782958984375,
-0.031585693359375,
-0.0018854141235351562,
0.009765625,
0.012298583984375,
0.0003304481506347656,
-0.032196044921875,
0.01445770263671875,
-0.03887939453125,
-0.0174560546875,
0.00487518310546875,
-0.0095977783203125,
0.0023937225341796875,
0.01007080078125,
0.0020542144775390625,
-0.00308990478515625,
0.0058135986328125,
0.0036830902099609375,
-0.0298004150390625,
0.042816162109375,
0.006511688232421875,
0.053436279296875,
-0.01442718505859375,
0.03973388671875,
-0.0537109375,
-0.0166015625,
-0.019287109375,
0.0117340087890625,
-0.00830841064453125,
0.0224609375,
-0.04534912109375,
-0.007747650146484375,
-0.0238037109375,
0.046630859375,
0.027191162109375,
-0.00690460205078125,
0.039154052734375,
0.04302978515625,
-0.0347900390625,
-0.0014371871948242188,
0.0684814453125,
0.00458526611328125,
0.0041961669921875,
0.0036830902099609375,
0.0155792236328125,
0.025238037109375,
-0.0170135498046875,
-0.0018396377563476562,
0.057525634765625,
0.0260772705078125,
-0.0263824462890625,
0.01284027099609375,
0.003437042236328125,
-0.040191650390625,
0.034423828125,
0.034149169921875,
0.08123779296875,
0.0093994140625,
0.0009274482727050781,
-0.015411376953125,
-0.01446533203125,
0.0004551410675048828,
0.00897216796875,
0.03839111328125,
0.01380157470703125,
0.0128021240234375,
0.0882568359375,
-0.050262451171875,
-0.01236724853515625,
0.03790283203125,
0.037933349609375,
-0.025543212890625,
0.01751708984375,
0.0235443115234375,
-0.030364990234375,
-0.00733184814453125,
0.0028057098388671875,
0.00800323486328125,
0.026824951171875,
-0.018646240234375,
0.0330810546875,
0.0213470458984375,
0.0504150390625,
-0.061065673828125,
0.05303955078125,
0.03204345703125,
-0.019927978515625,
-0.0277099609375,
-0.01250457763671875,
-0.0134429931640625,
-0.041717529296875,
-0.00766754150390625,
0.0255279541015625,
0.0189361572265625,
0.01139068603515625,
-0.048187255859375,
0.033447265625,
0.0071563720703125,
0.0304412841796875,
-0.030731201171875,
-0.022216796875,
-0.0103759765625,
-0.00835418701171875,
0.0096435546875,
0.0007219314575195312,
-0.0083160400390625,
-0.0224151611328125,
0.0062255859375,
-0.0504150390625,
0.00531005859375,
0.0177001953125,
-0.004486083984375,
0.01373291015625,
0.042755126953125,
0.00460052490234375,
0.0130767822265625,
-0.0188751220703125,
0.0170440673828125,
0.0182952880859375,
0.003582000732421875,
0.0022335052490234375,
-0.0284271240234375,
0.005756378173828125,
0.040557861328125,
0.055633544921875,
0.0162506103515625,
0.03167724609375,
-0.0014257431030273438,
-0.022125244140625,
-0.0172882080078125,
-0.0482177734375,
-0.03765869140625,
-0.0008063316345214844,
0.0103607177734375,
0.0165557861328125,
0.03997802734375,
-0.0222015380859375,
-0.0057220458984375,
0.00806427001953125,
0.050750732421875,
0.008544921875,
-0.07183837890625,
0.052032470703125,
-0.057861328125,
0.031463623046875,
0.0014600753784179688,
0.038238525390625,
-0.006572723388671875,
-0.0187225341796875,
-0.0426025390625,
-0.046234130859375,
-0.01947021484375,
0.06866455078125,
-0.015472412109375,
-0.01311492919921875,
0.0237884521484375,
0.0006632804870605469,
0.0209808349609375,
-0.03399658203125,
-0.033966064453125,
0.022064208984375,
-0.0300750732421875,
-0.0165863037109375,
0.01824951171875,
0.0379638671875,
-0.011962890625,
-0.04595947265625,
-0.004878997802734375,
-0.00197601318359375,
0.032684326171875,
-0.0143890380859375,
0.0184478759765625,
0.03936767578125,
-0.023101806640625,
-0.052734375,
0.10540771484375,
-0.017303466796875,
-0.01113128662109375,
-0.07745361328125,
0.0135345458984375,
0.0007929801940917969,
-0.0022602081298828125,
-0.0209503173828125,
-0.041778564453125,
-0.0401611328125,
0.03533935546875,
-0.00942230224609375,
0.0152435302734375,
0.021392822265625,
-0.040740966796875,
-0.0163726806640625,
-0.01221466064453125,
0.01271820068359375,
-0.00925445556640625,
-0.054443359375,
0.023345947265625,
0.016815185546875,
0.036041259765625,
0.0123443603515625,
0.03118896484375,
0.035400390625,
-0.0277252197265625,
-0.0098419189453125,
-0.006069183349609375,
-0.0230255126953125,
0.01256561279296875,
0.1011962890625,
0.0285186767578125,
0.0206451416015625,
-0.04815673828125,
-0.0249176025390625,
-0.01898193359375,
0.01097869873046875,
-0.0265655517578125,
0.01180267333984375,
-0.062103271484375,
-0.0190887451171875,
-0.00841522216796875,
-0.004802703857421875,
-0.00916290283203125,
-0.041107177734375,
-0.0364990234375,
-0.0213470458984375,
-0.0377197265625,
0.016021728515625,
-0.03765869140625,
-0.0231781005859375,
0.08514404296875,
-0.032318115234375,
0.018035888671875,
0.0118255615234375,
0.0269622802734375,
0.052825927734375,
0.01320648193359375,
-0.00634765625,
0.0300140380859375,
-0.0347900390625,
0.0012884140014648438,
0.006801605224609375,
0.0243682861328125,
-0.0095977783203125,
0.01084136962890625,
0.0021877288818359375,
0.0035457611083984375,
0.0118560791015625,
0.00394439697265625,
-0.0098876953125,
-0.0128631591796875,
-0.016448974609375,
0.0181732177734375,
-0.06439208984375,
0.0271759033203125,
-0.00559234619140625,
-0.0219573974609375,
-0.0065460205078125,
0.047821044921875,
0.07305908203125,
-0.033843994140625,
0.011505126953125,
0.02325439453125,
-0.0130767822265625,
0.0196533203125,
-0.011688232421875,
-0.0173797607421875,
-0.0179290771484375,
-0.0297088623046875
] |
0975649038c77a4590a5e63803bd35bc886135f4
|
Wordpress Stackexchange
Q: Organize uploaded media files I have a blog with all media stored in a folder called upload (organize media was disabled), I've activate it to organize new uploads by date. But how can i organize old files?
I want this because i need to migrate the site to a Wordpress MU site, and i need to have files organizated.
A: Thans but I've found the solution, what it need to do is to edit the site (Network -> Sites -> Edit -> Settings ) and change the following parameters:
Uploads Use Yearmonth Folders 0
Upload Path wp-content/blogs.dir/1/uploads
Fileupload Url http://www.mydomain.com/myblog/uploads
|
Q: Organize uploaded media files I have a blog with all media stored in a folder called upload (organize media was disabled), I've activate it to organize new uploads by date. But how can i organize old files?
I want this because i need to migrate the site to a Wordpress MU site, and i need to have files organizated.
A: Thans but I've found the solution, what it need to do is to edit the site (Network -> Sites -> Edit -> Settings ) and change the following parameters:
Uploads Use Yearmonth Folders 0
Upload Path wp-content/blogs.dir/1/uploads
Fileupload Url http://www.mydomain.com/myblog/uploads
A: Maybe this plugin can help: http://wordpress.org/extend/plugins/wp-filemanager/
A: You can hard-code this change for all your sites like this:
1. Create a new php file with a path like this: wp-content/mu-plugins/no_date_assets.php
If the wp-content/mu-plugins folder does not already exist, you will have to manually create it.
2. In that file paste the following:
<?php
$uploads_use_yearmonth_folders = get_option( 'uploads_use_yearmonth_folders', 1 );
if ( $uploads_use_yearmonth_folders ) {
update_option( 'uploads_use_yearmonth_folders', 0 );
}
That's all!
This will make all future uploads not use the year/month folders.
|
wordpress
|
{
"language": "en",
"length": 184,
"provenance": "stackexchange_00019.jsonl.gz:420817",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55170"
}
|
[
0.015533447265625,
-0.0026683807373046875,
-0.0180511474609375,
-0.022216796875,
0.0128326416015625,
-0.0089263916015625,
0.0229644775390625,
-0.002780914306640625,
0.042236328125,
0.031585693359375,
-0.0185089111328125,
-0.00027489662170410156,
0.0175628662109375,
-0.019012451171875,
-0.0222625732421875,
0.003444671630859375,
0.035980224609375,
-0.01605224609375,
0.0494384765625,
0.007122039794921875,
-0.007762908935546875,
0.022308349609375,
0.088134765625,
-0.0246429443359375,
0.0055694580078125,
0.0222930908203125,
0.004253387451171875,
-0.022216796875,
0.0118255615234375,
-0.02685546875,
0.0164337158203125,
0.01513671875,
0.017822265625,
-0.00421142578125,
0.0223846435546875,
0.026824951171875,
0.0251312255859375,
-0.006561279296875,
0.033966064453125,
0.0089111328125,
0.0109100341796875,
-0.007080078125,
0.041046142578125,
0.001155853271484375,
0.0215911865234375,
-0.041412353515625,
0.034027099609375,
-0.054901123046875,
0.0222015380859375,
0.000011861324310302734,
0.0016002655029296875,
-0.03924560546875,
0.0196685791015625,
-0.031219482421875,
-0.03594970703125,
-0.054962158203125,
0.0173492431640625,
0.0009741783142089844,
0.0052490234375,
-0.0135955810546875,
-0.017578125,
0.029022216796875,
0.0197601318359375,
0.0188751220703125,
-0.00820159912109375,
0.00954437255859375,
0.0189208984375,
0.007007598876953125,
-0.10870361328125,
-0.035797119140625,
0.06414794921875,
-0.06512451171875,
0.00974273681640625,
-0.0418701171875,
0.0180816650390625,
0.0196685791015625,
-0.030242919921875,
-0.027191162109375,
0.03106689453125,
-0.012115478515625,
0.0193939208984375,
0.007038116455078125,
0.0037212371826171875,
-0.08135986328125,
0.0382080078125,
-0.0587158203125,
0.0072784423828125,
-0.002399444580078125,
-0.0254364013671875,
0.042938232421875,
-0.0205078125,
-0.0116729736328125,
0.0247039794921875,
0.00821685791015625,
-0.0256500244140625,
0.00945281982421875,
0.033203125,
0.061737060546875,
-0.034088134765625,
-0.01305389404296875,
-0.042633056640625,
-0.00824737548828125,
-0.03704833984375,
-0.0159454345703125,
0.026123046875,
-0.00795745849609375,
-0.0338134765625,
-0.09820556640625,
0.01476287841796875,
0.0227508544921875,
-0.041168212890625,
0.034942626953125,
-0.006320953369140625,
-0.033843994140625,
0.0211944580078125,
0.023162841796875,
-0.035491943359375,
0.0733642578125,
0.01495361328125,
0.040924072265625,
0.006496429443359375,
0.0287933349609375,
-0.04461669921875,
-0.03643798828125,
0.01183319091796875,
-0.038665771484375,
-0.0369873046875,
0.040924072265625,
-0.00992584228515625,
0.0025463104248046875,
-0.01242828369140625,
0.03851318359375,
0.0008835792541503906,
-0.01580810546875,
-0.028106689453125,
0.0019741058349609375,
0.01393890380859375,
-0.0208740234375,
0.002094268798828125,
0.0269775390625,
0.003459930419921875,
-0.062103271484375,
-0.038116455078125,
-0.00046634674072265625,
-0.00505828857421875,
0.048248291015625,
0.039794921875,
-0.0006594657897949219,
-0.01800537109375,
-0.07952880859375,
-0.005596160888671875,
0.0099029541015625,
0.041839599609375,
-0.0036563873291015625,
-0.0251007080078125,
-0.0362548828125,
0.047607421875,
-0.06439208984375,
0.0039825439453125,
-0.0594482421875,
0.0151519775390625,
0.0185546875,
0.05633544921875,
-0.037506103515625,
-0.0258026123046875,
-0.0372314453125,
-0.06512451171875,
-0.019378662109375,
0.0203704833984375,
-0.0152130126953125,
-0.0123138427734375,
-0.031463623046875,
0.044158935546875,
-0.003559112548828125,
-0.00908660888671875,
0.036285400390625,
0.0002237558364868164,
0.0006036758422851562,
-0.005893707275390625,
0.06622314453125,
0.027313232421875,
-0.00864410400390625,
0.00812530517578125,
0.0199432373046875,
-0.055999755859375,
-0.0097198486328125,
0.0015964508056640625,
0.00421905517578125,
0.02972412109375,
0.0018854141235351562,
0.0819091796875,
0.0028781890869140625,
-0.072021484375,
0.01197052001953125,
0.00069427490234375,
0.037811279296875,
-0.01364898681640625,
0.03094482421875,
0.0093231201171875,
-0.0426025390625,
-0.021087646484375,
0.0133819580078125,
-0.042205810546875,
0.0306243896484375,
-0.0189666748046875,
-0.0202484130859375,
0.0069122314453125,
0.00009655952453613281,
-0.032135009765625,
-0.04345703125,
0.0361328125,
-0.006633758544921875,
-0.0203094482421875,
-0.0289154052734375,
-0.026519775390625,
0.04833984375,
-0.01434326171875,
-0.0031948089599609375,
-0.02496337890625,
0.01523590087890625,
-0.037109375,
0.004726409912109375,
-0.039031982421875,
0.047821044921875,
0.006099700927734375,
-0.015106201171875,
-0.03216552734375,
-0.01528167724609375,
-0.0150146484375,
0.006465911865234375,
-0.04095458984375,
0.031463623046875,
-0.01520538330078125,
0.019073486328125,
-0.0220947265625,
-0.0181732177734375,
-0.019775390625,
-0.059844970703125,
0.024322509765625,
0.054595947265625,
0.023834228515625,
0.01338958740234375,
0.030975341796875,
0.08660888671875,
0.054534912109375,
-0.0243377685546875,
0.00450897216796875,
0.03900146484375,
-0.0038585662841796875,
0.0657958984375,
-0.015869140625,
0.01324462890625,
-0.00141143798828125,
-0.0178985595703125,
-0.0193634033203125,
0.024810791015625,
-0.0257720947265625,
-0.0098114013671875,
-0.005859375,
0.0009908676147460938,
0.0001857280731201172,
-0.045562744140625,
-0.0230865478515625,
-0.0283355712890625,
0.034820556640625,
0.0418701171875,
0.0562744140625,
0.053192138671875,
-0.012725830078125,
0.028900146484375,
-0.0043487548828125,
-0.01531982421875,
0.023712158203125,
0.044586181640625,
-0.0006852149963378906,
-0.01096343994140625,
-0.007720947265625,
-0.02301025390625,
0.01413726806640625,
0.021575927734375,
-0.01934814453125,
-0.00647735595703125,
-0.031768798828125,
-0.0116119384765625,
-0.0043182373046875,
-0.044189453125,
0.00992584228515625,
-0.0019855499267578125,
-0.0205535888671875,
-0.000005424022674560547,
0.01398468017578125,
0.04248046875,
-0.0015058517456054688,
0.033172607421875,
-0.0102691650390625,
0.01203155517578125,
-0.030975341796875,
-0.035919189453125,
0.0323486328125,
-0.0256195068359375,
0.05413818359375,
0.06689453125,
-0.0157623291015625,
0.0125885009765625,
-0.002071380615234375,
0.0136871337890625,
0.0272674560546875,
0.01059722900390625,
-0.0008568763732910156,
-0.003620147705078125,
-0.058746337890625,
-0.0238189697265625,
0.01861572265625,
-0.019622802734375,
0.002410888671875,
-0.0229644775390625,
-0.01044464111328125,
-0.01442718505859375,
-0.0848388671875,
-0.0460205078125,
-0.0212860107421875,
-0.0980224609375,
0.00567626953125,
-0.001766204833984375,
-0.05340576171875,
-0.013519287109375,
0.044921875,
0.0186004638671875,
0.002361297607421875,
-0.0016307830810546875,
-0.01500701904296875,
-0.00583648681640625,
-0.03594970703125,
0.01100921630859375,
-0.00719451904296875,
0.007129669189453125,
-0.00362396240234375,
0.028564453125,
-0.0222930908203125,
-0.04193115234375,
0.0002465248107910156,
0.0005025863647460938,
0.017669677734375,
0.0190582275390625,
0.060150146484375,
-0.029327392578125,
0.00444793701171875,
0.004444122314453125,
0.0799560546875,
0.0716552734375,
-0.07568359375,
0.0008687973022460938,
-0.016387939453125,
-0.024749755859375,
-0.04901123046875,
0.057159423828125,
0.04925537109375,
-0.0482177734375,
-0.0386962890625,
-0.06475830078125,
0.0252227783203125,
-0.016448974609375,
-0.0151824951171875,
-0.042449951171875,
-0.0088043212890625,
-0.013031005859375,
-0.0377197265625,
0.0004754066467285156,
0.006500244140625,
0.0205230712890625,
0.002529144287109375,
-0.02557373046875,
-0.022979736328125,
0.005397796630859375,
0.00064849853515625,
0.00213623046875,
0.01474761962890625,
-0.0113677978515625,
-0.01432037353515625,
0.00024175643920898438,
0.013214111328125,
-0.0272216796875,
0.017303466796875,
-0.0748291015625,
-0.03564453125,
0.0273284912109375,
-0.06414794921875,
0.006519317626953125,
-0.0635986328125,
-0.0107574462890625,
-0.031463623046875,
0.07513427734375,
-0.056915283203125,
-0.00850677490234375,
-0.0252685546875,
0.00734710693359375,
-0.03887939453125,
-0.03411865234375,
-0.03515625,
-0.005863189697265625,
-0.034423828125,
-0.02239990234375,
-0.0035877227783203125,
-0.034515380859375,
-0.0156402587890625,
-0.0200958251953125,
-0.023651123046875,
-0.0211029052734375,
0.030517578125,
0.027313232421875,
0.02252197265625,
-0.004749298095703125,
0.027008056640625,
-0.004283905029296875,
-0.016387939453125,
0.01300048828125,
-0.1046142578125,
-0.0176849365234375,
-0.01313018798828125,
0.05047607421875,
-0.01439666748046875,
0.01389312744140625,
-0.0286407470703125,
0.055694580078125,
-0.01111602783203125,
-0.004669189453125,
-0.003509521484375,
0.015289306640625,
0.0009889602661132812,
-0.021820068359375,
-0.0167236328125,
-0.03961181640625,
-0.006954193115234375,
-0.09393310546875,
-0.0460205078125,
-0.0526123046875,
-0.042022705078125,
0.0546875,
-0.047210693359375,
0.00937652587890625,
-0.01213836669921875,
-0.01812744140625,
-0.051300048828125,
0.0226593017578125,
-0.037384033203125,
-0.00414276123046875,
-0.0126190185546875,
-0.0379638671875,
0.004329681396484375,
0.0011987686157226562,
-0.01593017578125,
0.0178985595703125,
0.059967041015625,
0.0220489501953125,
-0.0005660057067871094,
-0.0635986328125,
0.021392822265625,
0.0160980224609375,
0.0208740234375,
0.0369873046875,
-0.00432586669921875,
-0.0068511962890625,
0.0301666259765625,
-0.0242919921875,
-0.0075531005859375,
-0.005096435546875,
0.00724029541015625,
-0.00110626220703125,
-0.020660400390625,
-0.0017385482788085938,
-0.018890380859375,
0.045013427734375,
0.041168212890625,
-0.0123138427734375,
-0.007427215576171875,
-0.0221710205078125,
0.04132080078125,
0.0004954338073730469,
-0.0220489501953125,
-0.044189453125,
-0.10382080078125,
0.03173828125,
-0.09039306640625,
0.02099609375,
-0.02374267578125,
0.004390716552734375,
0.056549072265625,
0.0543212890625,
-0.01055145263671875,
0.0024127960205078125,
0.0244140625,
-0.0281219482421875,
0.0275726318359375,
-0.0033721923828125,
-0.0244903564453125,
-0.0033206939697265625,
-0.005859375,
0.0145721435546875,
0.0026302337646484375,
-0.037872314453125,
0.01221466064453125,
-0.004459381103515625,
0.0101165771484375,
0.0224609375,
-0.044158935546875,
0.01451873779296875,
0.052520751953125,
-0.031951904296875,
0.00943756103515625,
-0.03143310546875,
0.024871826171875,
-0.03961181640625,
-0.00237274169921875,
0.00226593017578125,
-0.0143280029296875,
-0.01291656494140625,
0.0251922607421875,
-0.0168304443359375,
-0.0012102127075195312,
0.006381988525390625,
-0.01361083984375,
-0.003719329833984375,
0.0362548828125,
0.03863525390625,
-0.02301025390625,
-0.01776123046875,
0.0360107421875,
0.01238250732421875,
-0.0246734619140625,
0.0257568359375,
0.00923919677734375,
0.0264739990234375,
-0.0009546279907226562,
-0.03277587890625,
0.021148681640625,
-0.04864501953125,
0.0142364501953125,
0.0038890838623046875,
-0.0230560302734375,
-0.0362548828125,
0.00734710693359375,
0.013275146484375,
0.0194854736328125,
-0.034576416015625,
0.0019502639770507812,
-0.0209197998046875,
-0.04840087890625,
-0.0159759521484375,
0.035858154296875,
-0.0214080810546875,
-0.01104736328125,
-0.0179290771484375,
0.0249481201171875,
0.0090484619140625,
0.0010499954223632812,
-0.052703857421875,
-0.037841796875,
-0.022369384765625,
-0.006740570068359375,
0.068115234375,
-0.0241851806640625,
0.002239227294921875,
-0.0154266357421875,
0.022705078125,
0.0234375,
0.039398193359375,
-0.02490234375,
-0.047210693359375,
-0.044464111328125,
0.003177642822265625,
-0.042144775390625,
-0.0305023193359375,
-0.028900146484375,
0.000005066394805908203,
-0.0577392578125,
-0.018768310546875,
-0.039306640625,
0.02459716796875,
-0.0030193328857421875,
0.0306854248046875,
-0.000400543212890625,
0.00860595703125,
-0.02703857421875,
0.0146636962890625,
0.006656646728515625,
0.0252532958984375,
0.003925323486328125,
0.039703369140625,
0.025970458984375,
0.020965576171875,
-0.03631591796875,
-0.0237579345703125,
0.00814056396484375,
-0.04412841796875,
-0.04986572265625,
0.0139923095703125,
-0.06597900390625,
0.04388427734375,
0.0552978515625,
-0.006855010986328125,
0.030792236328125,
-0.0303497314453125,
0.0023899078369140625,
-0.01500701904296875,
0.0098876953125,
-0.059814453125,
0.0196533203125,
-0.016204833984375,
-0.033935546875,
0.055938720703125,
-0.0011415481567382812,
0.0293426513671875,
0.01531219482421875,
-0.041351318359375,
0.033111572265625,
0.01488494873046875,
0.0092620849609375,
0.01395416259765625,
-0.00103759765625,
-0.01383209228515625,
-0.0008840560913085938,
0.01439666748046875,
0.010162353515625,
-0.0265045166015625,
0.00801849365234375,
0.06561279296875,
0.0194549560546875,
0.0634765625,
-0.00360107421875,
0.0091552734375,
0.04217529296875,
-0.032989501953125,
0.015228271484375,
0.0006175041198730469,
0.037261962890625,
0.0026702880859375,
0.0017604827880859375,
0.01035308837890625,
-0.016448974609375,
0.02667236328125,
-0.01055145263671875,
0.01494598388671875,
-0.0013437271118164062,
0.033599853515625,
-0.004116058349609375,
-0.0292816162109375,
-0.00799560546875,
-0.0116424560546875,
-0.0013246536254882812,
0.022552490234375,
0.0207366943359375,
0.01404571533203125,
-0.01959228515625,
-0.0543212890625,
0.0205230712890625,
-0.024017333984375,
0.015533447265625,
0.0323486328125,
-0.05755615234375,
0.0172271728515625,
-0.01617431640625,
-0.018768310546875,
-0.0260162353515625,
-0.001499176025390625,
-0.056976318359375,
-0.022186279296875,
0.0543212890625,
0.055419921875,
-0.01384735107421875,
-0.040740966796875,
0.0418701171875,
0.0010652542114257812,
-0.015899658203125,
-0.0318603515625,
0.0099334716796875,
0.0008230209350585938,
-0.004421234130859375,
0.01678466796875,
-0.00310516357421875,
-0.04205322265625,
0.01470947265625,
0.0120086669921875,
0.0080108642578125,
-0.06512451171875,
0.0013370513916015625,
0.04339599609375,
0.0017156600952148438,
0.003086090087890625,
-0.0002644062042236328,
0.0396728515625,
-0.06719970703125,
-0.02325439453125,
0.01195526123046875,
-0.0262451171875,
-0.02099609375,
0.007457733154296875,
-0.054290771484375,
0.0782470703125,
-0.0212860107421875,
0.046966552734375,
0.0221710205078125,
0.0249481201171875,
-0.0010175704956054688,
0.0089263916015625,
-0.02911376953125,
0.038177490234375,
-0.06103515625,
0.01153564453125,
-0.1015625,
0.0011425018310546875,
-0.0295257568359375,
0.0299530029296875,
0.08416748046875,
0.01568603515625,
-0.047027587890625,
-0.0195465087890625,
0.04620361328125,
0.03717041015625,
0.007358551025390625,
0.061614990234375,
-0.0254364013671875,
-0.0089263916015625,
0.01312255859375,
0.004016876220703125,
0.021881103515625,
0.029449462890625,
-0.0758056640625,
0.0019426345825195312,
0.0158233642578125,
0.0106201171875,
-0.005626678466796875,
-0.0001348257064819336,
-0.01337432861328125,
-0.005893707275390625,
0.020843505859375,
0.00789642333984375,
0.0345458984375,
0.0026798248291015625,
0.02899169921875,
-0.036376953125,
-0.01033782958984375,
-0.01168060302734375,
0.044891357421875,
-0.01427459716796875,
0.04278564453125,
0.0238037109375,
0.029083251953125,
0.01512908935546875,
-0.0435791015625,
0.00698089599609375,
-0.0029697418212890625,
-0.046356201171875,
0.038543701171875,
0.00836181640625,
0.0293426513671875,
-0.045623779296875,
-0.058074951171875,
0.015960693359375,
0.058868408203125,
-0.016357421875,
-0.01207733154296875,
0.01329803466796875,
0.0081939697265625,
0.0015420913696289062,
-0.0300140380859375,
-0.01049041748046875,
-0.021331787109375,
-0.00659942626953125,
-0.01221466064453125,
-0.00424957275390625,
0.0175018310546875,
0.04132080078125,
0.01517486572265625,
0.03271484375,
-0.0390625,
-0.0260467529296875,
-0.00717926025390625,
0.03753662109375,
0.016998291015625,
-0.002719879150390625,
-0.058441162109375,
0.05615234375,
-0.0155029296875,
0.03338623046875,
-0.006824493408203125,
0.020721435546875,
0.0006780624389648438,
0.013397216796875,
-0.04852294921875,
-0.0484619140625,
0.019195556640625,
0.04351806640625,
0.0260162353515625,
0.01345062255859375,
0.03240966796875,
0.0302581787109375,
-0.0266571044921875,
0.006511688232421875,
0.0570068359375,
-0.0100250244140625,
0.0212554931640625,
-0.03240966796875,
0.01983642578125,
0.03265380859375,
-0.003894805908203125,
-0.019012451171875,
-0.01428985595703125,
0.0802001953125,
-0.03875732421875,
0.032440185546875,
-0.01093292236328125,
-0.0242767333984375,
0.03131103515625,
-0.0104522705078125,
0.051544189453125,
-0.01363372802734375,
-0.034027099609375,
-0.0091400146484375,
-0.07489013671875,
-0.00659942626953125,
0.0352783203125,
0.041229248046875,
0.0239715576171875,
-0.0261383056640625,
-0.01152801513671875,
-0.0200042724609375,
-0.0156707763671875,
0.013824462890625,
0.011810302734375,
0.04473876953125,
0.0129852294921875,
0.0264434814453125,
-0.06829833984375,
-0.034820556640625,
-0.0435791015625,
0.0290679931640625,
0.04364013671875,
0.0799560546875,
0.01042938232421875,
0.03875732421875,
0.01360321044921875,
-0.0229034423828125,
0.0227508544921875,
0.016571044921875,
-0.03533935546875,
0.0304412841796875,
0.0265350341796875,
-0.01534271240234375,
0.007526397705078125,
-0.0043792724609375,
0.0198974609375,
-0.042510986328125,
-0.035491943359375,
-0.015106201171875,
0.0192108154296875,
0.040924072265625,
0.005550384521484375,
-0.022613525390625,
-0.0109405517578125,
0.00334930419921875,
-0.0004105567932128906,
0.01526641845703125,
-0.00914764404296875,
-0.0283203125,
0.0089874267578125,
0.0005083084106445312,
-0.058441162109375,
0.0273284912109375,
-0.04779052734375,
0.0419921875,
0.03790283203125,
0.015655517578125,
-0.032928466796875,
0.0097503662109375,
-0.0228424072265625,
0.0201416015625,
-0.00785064697265625,
0.044677734375,
0.0267486572265625,
-0.06622314453125,
0.0019006729125976562,
0.0245361328125,
0.030029296875,
-0.0220489501953125,
0.00409698486328125,
0.01355743408203125,
-0.01904296875,
0.0289154052734375,
-0.032440185546875,
-0.01824951171875,
-0.024261474609375,
0.002521514892578125,
0.036407470703125,
0.0072479248046875,
-0.0023345947265625,
-0.033538818359375,
-0.0261688232421875,
0.043670654296875,
0.01172637939453125,
-0.024688720703125,
0.0247039794921875,
-0.02850341796875,
-0.0205841064453125,
0.018341064453125,
-0.00627899169921875,
-0.0186004638671875,
0.0292510986328125,
-0.01509857177734375,
-0.0732421875,
-0.046844482421875,
0.06390380859375,
-0.0330810546875,
0.00141143798828125,
-0.00775146484375,
-0.01453399658203125,
0.0333251953125,
0.024749755859375,
0.0019388198852539062,
0.0660400390625,
0.0187835693359375,
-0.016754150390625,
-0.0016069412231445312,
0.0080108642578125,
-0.0003077983856201172,
-0.0019683837890625,
0.006969451904296875,
-0.01107025146484375,
0.0018444061279296875,
-0.003437042236328125,
-0.034027099609375,
-0.02447509765625,
-0.049957275390625,
-0.06903076171875,
0.008697509765625,
0.00443267822265625,
-0.05303955078125,
-0.052459716796875,
0.046234130859375,
-0.011932373046875,
0.034393310546875,
-0.0021686553955078125,
-0.0206146240234375,
0.0204620361328125,
0.027191162109375,
-0.0097198486328125,
0.033782958984375,
0.017059326171875,
-0.01561737060546875,
-0.032562255859375,
-0.00829315185546875,
-0.014801025390625,
-0.00749969482421875,
0.052093505859375,
-0.024871826171875,
0.04974365234375,
0.052398681640625,
-0.0318603515625,
0.042877197265625,
-0.0167083740234375,
-0.048309326171875,
0.005908966064453125,
-0.00469970703125,
-0.07366943359375,
-0.038787841796875,
0.046142578125,
0.095947265625,
0.028076171875,
-0.016143798828125,
-0.030914306640625,
-0.0012102127075195312,
-0.0243377685546875,
-0.0156097412109375,
0.02105712890625,
-0.062286376953125,
-0.0016002655029296875,
-0.0207977294921875,
0.01113128662109375,
-0.01277923583984375,
-0.0008797645568847656,
-0.0161285400390625,
-0.0210723876953125,
0.0029144287109375,
0.01357269287109375,
-0.04058837890625,
-0.004871368408203125,
0.037384033203125,
-0.024932861328125,
0.0104827880859375,
-0.0079193115234375,
0.0153045654296875,
0.020599365234375,
-0.0004017353057861328,
-0.00820159912109375,
0.0228118896484375,
-0.0192108154296875,
0.0153961181640625,
0.0159454345703125,
-0.00705718994140625,
0.0016260147094726562,
0.0083160400390625,
0.0006313323974609375,
-0.0209503173828125,
-0.0012788772583007812,
-0.0199432373046875,
-0.010589599609375,
0.02630615234375,
-0.01540374755859375,
0.0615234375,
0.0108489990234375,
-0.047271728515625,
-0.0103302001953125,
0.0159912109375,
-0.029571533203125,
-0.0118560791015625,
0.01123046875,
-0.0474853515625,
0.0246124267578125,
-0.0196990966796875,
0.01457977294921875,
-0.0257720947265625,
0.0298614501953125,
-0.03765869140625,
-0.02496337890625,
0.02239990234375
] |
4b94ae1aef8335fb9bd7a75e978d8673c26880d0
|
Wordpress Stackexchange
Q: Update Wordpress automatically on its own Is it possible to update Wordpress automatically so that when there's a new version of Wordpress, my installation will update itself automatically without me having to login to admin > update ?
A: Since version 3.7 it is, see https://codex.wordpress.org/Configuring_Automatic_Background_Updates.
|
Q: Update Wordpress automatically on its own Is it possible to update Wordpress automatically so that when there's a new version of Wordpress, my installation will update itself automatically without me having to login to admin > update ?
A: Since version 3.7 it is, see https://codex.wordpress.org/Configuring_Automatic_Background_Updates.
A: Yes it is. Though perhaps not in the way you might be thinking.
If you check out some of the shared hosting sites, many of them have the capability to automatically update your WordPress site.
Of course, as Milo has said, it can be rather disastrous too. Especially on a site with lots of plugins installed.
So the answer is to have an external script that does a "manual" upgrade as per the WordPress documentation.
Firstly, the script needs to check to see if an upgrade is needed. The code is always available as "http://wordpress.org/latest.zip" so you could write a PHP script that checked if an HTTP head request to that URL returned a 304 (not changed) or a 200. If the later, you would start the download and then ...
You will want to make the script do a backup of both the site and the database before doing the upgrade of course.
I would also recommend a script that can restore the site quickly. For when it all goes horribly wrong ;)
|
wordpress
|
{
"language": "en",
"length": 222,
"provenance": "stackexchange_00019.jsonl.gz:420833",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55213"
}
|
[
0.042633056640625,
0.0130462646484375,
-0.0032100677490234375,
-0.054901123046875,
0.01102447509765625,
-0.00782012939453125,
0.0046844482421875,
-0.01019287109375,
0.0271148681640625,
0.00927734375,
-0.06854248046875,
0.006175994873046875,
-0.0187530517578125,
0.003448486328125,
-0.021270751953125,
-0.034820556640625,
0.056182861328125,
-0.0175018310546875,
0.0352783203125,
0.003940582275390625,
0.006130218505859375,
0.03717041015625,
0.0171356201171875,
0.06207275390625,
0.03131103515625,
0.00799560546875,
0.033538818359375,
-0.0227813720703125,
0.03472900390625,
0.01201629638671875,
0.0391845703125,
-0.044891357421875,
-0.0021190643310546875,
0.051666259765625,
-0.02264404296875,
-0.0204315185546875,
0.00283050537109375,
0.0213775634765625,
0.0162353515625,
0.00572967529296875,
0.025360107421875,
-0.01415252685546875,
0.078857421875,
0.022491455078125,
0.01666259765625,
-0.0034313201904296875,
0.0118865966796875,
-0.05035400390625,
0.03472900390625,
-0.0118865966796875,
0.0005450248718261719,
0.03973388671875,
0.0130615234375,
0.00244903564453125,
0.00746917724609375,
0.0174560546875,
0.031982421875,
0.031280517578125,
0.058258056640625,
-0.1065673828125,
-0.07659912109375,
-0.03466796875,
0.05718994140625,
0.012451171875,
-0.0068511962890625,
-0.002620697021484375,
0.018280029296875,
0.00012028217315673828,
-0.06317138671875,
-0.00864410400390625,
0.057647705078125,
-0.01367950439453125,
0.0123748779296875,
0.01006317138671875,
0.01428985595703125,
-0.05029296875,
0.01003265380859375,
-0.0233154296875,
0.033233642578125,
0.0240478515625,
0.03607177734375,
-0.00273895263671875,
0.037506103515625,
-0.038543701171875,
0.0237579345703125,
-0.0007061958312988281,
0.01027679443359375,
-0.01194000244140625,
-0.019927978515625,
-0.056732177734375,
-0.01535797119140625,
-0.00838470458984375,
-0.0625,
0.00035500526428222656,
-0.016998291015625,
-0.031005859375,
0.0035953521728515625,
0.04876708984375,
-0.0232391357421875,
0.032440185546875,
-0.03936767578125,
-0.0084381103515625,
0.033935546875,
-0.0499267578125,
-0.03802490234375,
0.016845703125,
0.03204345703125,
0.00872039794921875,
-0.0150909423828125,
0.01329803466796875,
-0.0262603759765625,
-0.043792724609375,
0.0054168701171875,
-0.00257110595703125,
0.001148223876953125,
0.00044465065002441406,
-0.033935546875,
0.050140380859375,
-0.01837158203125,
0.035888671875,
-0.02264404296875,
0.01331329345703125,
-0.03900146484375,
-0.0079193115234375,
0.006671905517578125,
-0.00855255126953125,
0.012786865234375,
-0.005077362060546875,
0.0078887939453125,
-0.0264892578125,
-0.03741455078125,
0.046600341796875,
0.0743408203125,
0.0093994140625,
-0.007144927978515625,
0.0021457672119140625,
0.01496124267578125,
0.01119232177734375,
-0.00032210350036621094,
0.0173492431640625,
0.023345947265625,
-0.050567626953125,
-0.03594970703125,
0.01378631591796875,
0.018798828125,
-0.004413604736328125,
0.004100799560546875,
0.02691650390625,
0.016754150390625,
0.00041174888610839844,
0.004974365234375,
-0.00042700767517089844,
0.00104522705078125,
0.002166748046875,
0.0743408203125,
-0.041534423828125,
0.05865478515625,
-0.042694091796875,
0.036712646484375,
-0.01849365234375,
-0.00368499755859375,
-0.005054473876953125,
0.039459228515625,
0.041229248046875,
0.02105712890625,
0.0296783447265625,
-0.0183563232421875,
0.0097808837890625,
0.02813720703125,
-0.043426513671875,
0.0440673828125,
-0.00775146484375,
0.08209228515625,
0.0035076141357421875,
0.0032367706298828125,
0.0113677978515625,
0.00646209716796875,
-0.006969451904296875,
0.0281982421875,
0.01218414306640625,
-0.01311492919921875,
-0.028533935546875,
0.03594970703125,
-0.01486968994140625,
-0.0262298583984375,
-0.02850341796875,
-0.0150604248046875,
0.037139892578125,
0.07373046875,
0.021148681640625,
-0.03192138671875,
-0.0693359375,
-0.03497314453125,
0.050384521484375,
-0.0096435546875,
-0.021240234375,
-0.016448974609375,
0.0276336669921875,
-0.01739501953125,
-0.039520263671875,
-0.0156402587890625,
0.0009551048278808594,
-0.006801605224609375,
-0.00043654441833496094,
-0.03277587890625,
-0.01995849609375,
-0.00977325439453125,
0.0243072509765625,
0.0721435546875,
0.020172119140625,
-0.0276031494140625,
-0.01468658447265625,
0.0450439453125,
-0.0811767578125,
-0.0791015625,
-0.0163421630859375,
-0.05670166015625,
0.0144195556640625,
-0.00833892822265625,
0.047607421875,
-0.017974853515625,
-0.023590087890625,
-0.0188751220703125,
-0.036895751953125,
0.0186767578125,
-0.05126953125,
-0.0023174285888671875,
-0.034912109375,
0.00308990478515625,
-0.0254669189453125,
-0.0084228515625,
0.056976318359375,
-0.02911376953125,
-0.03369140625,
-0.048828125,
-0.036224365234375,
-0.07073974609375,
-0.08721923828125,
0.010650634765625,
0.08953857421875,
0.0232391357421875,
-0.0019683837890625,
-0.01543426513671875,
0.0184173583984375,
0.0648193359375,
-0.00983428955078125,
0.00389862060546875,
0.0251617431640625,
0.007965087890625,
0.0298309326171875,
-0.0185699462890625,
0.002956390380859375,
0.026123046875,
-0.06329345703125,
-0.003955841064453125,
0.0445556640625,
0.00807952880859375,
-0.0020961761474609375,
-0.0235748291015625,
-0.00899505615234375,
0.00838470458984375,
-0.05328369140625,
-0.04595947265625,
-0.0139007568359375,
0.01593017578125,
-0.00820159912109375,
0.05413818359375,
0.047393798828125,
0.00560760498046875,
-0.038818359375,
0.003101348876953125,
0.03240966796875,
0.00971221923828125,
0.0287628173828125,
-0.035003662109375,
-0.007770538330078125,
0.00608062744140625,
0.0005488395690917969,
-0.0220489501953125,
-0.0064697265625,
-0.020721435546875,
-0.045257568359375,
-0.0095062255859375,
0.00734710693359375,
0.0078125,
-0.042083740234375,
0.042724609375,
0.0190582275390625,
-0.04345703125,
-0.032012939453125,
0.0105743408203125,
-0.003490447998046875,
-0.041412353515625,
0.0242767333984375,
-0.00386810302734375,
-0.0208587646484375,
0.001140594482421875,
-0.0018301010131835938,
0.0127105712890625,
-0.0167694091796875,
0.01111602783203125,
0.047027587890625,
0.006214141845703125,
0.003002166748046875,
0.0099639892578125,
0.0143280029296875,
0.026275634765625,
-0.00652313232421875,
-0.0163116455078125,
0.044036865234375,
-0.103759765625,
-0.0286712646484375,
0.01557159423828125,
0.04010009765625,
-0.038970947265625,
-0.050994873046875,
-0.0255584716796875,
0.012298583984375,
-0.096435546875,
-0.0704345703125,
-0.03704833984375,
-0.046417236328125,
-0.01885986328125,
-0.020477294921875,
-0.01168060302734375,
0.0145111083984375,
-0.00827789306640625,
0.01232147216796875,
0.004241943359375,
-0.0200042724609375,
-0.0196533203125,
-0.04205322265625,
-0.06048583984375,
-0.0171051025390625,
0.006931304931640625,
0.0258941650390625,
0.0006642341613769531,
0.055999755859375,
-0.0026912689208984375,
-0.08349609375,
-0.0164337158203125,
0.0302886962890625,
-0.006587982177734375,
0.031829833984375,
0.006671905517578125,
-0.0060882568359375,
0.006610870361328125,
0.012664794921875,
0.0017290115356445312,
0.0164031982421875,
-0.0260772705078125,
-0.0155029296875,
-0.0223236083984375,
-0.04388427734375,
-0.0010814666748046875,
-0.0033550262451171875,
0.01361846923828125,
-0.013092041015625,
0.0034885406494140625,
-0.0433349609375,
0.0133056640625,
0.0279693603515625,
-0.0017251968383789062,
-0.0249786376953125,
-0.0184478759765625,
-0.039093017578125,
0.0016880035400390625,
-0.00800323486328125,
-0.04608154296875,
0.00803375244140625,
-0.0158233642578125,
-0.0195159912109375,
-0.0069580078125,
-0.03131103515625,
-0.043914794921875,
0.0263214111328125,
-0.003879547119140625,
-0.049591064453125,
0.0728759765625,
0.00507354736328125,
-0.00860595703125,
-0.01219940185546875,
0.02618408203125,
-0.0231781005859375,
-0.032867431640625,
0.03857421875,
-0.0200958251953125,
0.01806640625,
-0.052581787109375,
-0.018646240234375,
-0.0184173583984375,
0.082275390625,
-0.0433349609375,
-0.0010728836059570312,
0.051788330078125,
0.0311279296875,
-0.06787109375,
-0.037017822265625,
-0.087646484375,
-0.00545501708984375,
-0.0164031982421875,
-0.0205078125,
-0.033050537109375,
0.00551605224609375,
-0.035125732421875,
0.049774169921875,
0.00037598609924316406,
-0.0270843505859375,
0.01309967041015625,
-0.0555419921875,
-0.001636505126953125,
-0.01104736328125,
-0.0279693603515625,
-0.034332275390625,
0.006717681884765625,
-0.041290283203125,
-0.08172607421875,
-0.00782012939453125,
-0.0152130126953125,
0.053375244140625,
0.0006284713745117188,
0.035614013671875,
-0.0240631103515625,
0.0298614501953125,
0.0037899017333984375,
0.039825439453125,
-0.02374267578125,
-0.00551605224609375,
-0.02252197265625,
0.006885528564453125,
0.0038356781005859375,
-0.0069427490234375,
0.0032825469970703125,
-0.057647705078125,
-0.0421142578125,
-0.035064697265625,
-0.0300445556640625,
0.0223541259765625,
-0.0199737548828125,
-0.017578125,
0.0037631988525390625,
-0.0026645660400390625,
-0.0416259765625,
0.0214080810546875,
-0.0257110595703125,
0.0018243789672851562,
-0.020294189453125,
-0.0139007568359375,
0.0709228515625,
0.0076446533203125,
0.0001436471939086914,
0.00014984607696533203,
0.0916748046875,
0.0048675537109375,
-0.034454345703125,
-0.048828125,
-0.0186004638671875,
0.0318603515625,
0.0299072265625,
0.01381683349609375,
0.01953125,
-0.019775390625,
-0.006443023681640625,
0.0214691162109375,
-0.01885986328125,
-0.01313018798828125,
0.034271240234375,
-0.0027904510498046875,
-0.0202484130859375,
0.00856781005859375,
-0.02294921875,
0.040008544921875,
0.006748199462890625,
0.0085296630859375,
-0.0103302001953125,
-0.0178680419921875,
0.007312774658203125,
0.017303466796875,
0.0005097389221191406,
-0.01537322998046875,
-0.0406494140625,
0.0243988037109375,
0.00594329833984375,
-0.01337432861328125,
0.0162811279296875,
-0.0110626220703125,
0.0019969940185546875,
-0.007801055908203125,
-0.0281982421875,
-0.0227508544921875,
-0.0155487060546875,
-0.0133819580078125,
-0.001041412353515625,
-0.0147705078125,
-0.0309295654296875,
-0.015716552734375,
-0.01529693603515625,
0.0601806640625,
-0.01523590087890625,
-0.06878662109375,
0.0227203369140625,
-0.01715087890625,
0.030120849609375,
0.0506591796875,
-0.001880645751953125,
0.049560546875,
0.0281524658203125,
-0.0084686279296875,
-0.04052734375,
-0.00948333740234375,
-0.0022258758544921875,
-0.06439208984375,
-0.05462646484375,
-0.014862060546875,
-0.0229034423828125,
0.04559326171875,
-0.03778076171875,
0.008270263671875,
-0.0185089111328125,
-0.022003173828125,
0.0206756591796875,
0.029052734375,
-0.023193359375,
0.00881195068359375,
0.05255126953125,
0.016510009765625,
-0.054840087890625,
0.05328369140625,
-0.05084228515625,
-0.036224365234375,
0.046417236328125,
0.0780029296875,
0.0185699462890625,
-0.0012769699096679688,
-0.028289794921875,
-0.0281524658203125,
0.0019969940185546875,
0.0226898193359375,
0.001567840576171875,
-0.0316162109375,
-0.016815185546875,
0.043487548828125,
0.053955078125,
-0.022796630859375,
-0.004974365234375,
-0.00937652587890625,
-0.035614013671875,
-0.0009937286376953125,
0.007694244384765625,
-0.005191802978515625,
-0.0238037109375,
-0.0246429443359375,
0.026947021484375,
-0.0172119140625,
-0.03253173828125,
-0.029022216796875,
-0.0030612945556640625,
-0.01377105712890625,
-0.0019292831420898438,
0.041839599609375,
0.00319671630859375,
-0.019622802734375,
-0.008544921875,
-0.0006990432739257812,
-0.00014901161193847656,
0.0107269287109375,
0.04376220703125,
-0.0173492431640625,
-0.0238494873046875,
-0.01006317138671875,
-0.0655517578125,
-0.041351318359375,
-0.060882568359375,
-0.032806396484375,
-0.054290771484375,
0.024017333984375,
0.0013437271118164062,
0.003574371337890625,
-0.024261474609375,
-0.0163726806640625,
-0.02679443359375,
0.0386962890625,
0.0259857177734375,
0.037078857421875,
0.025970458984375,
0.0279541015625,
-0.0352783203125,
0.045562744140625,
0.0149078369140625,
-0.01171875,
-0.037872314453125,
-0.0185699462890625,
0.002902984619140625,
-0.0211029052734375,
0.003082275390625,
0.005001068115234375,
0.01345062255859375,
-0.019805908203125,
-0.0076446533203125,
-0.0026950836181640625,
-0.006313323974609375,
-0.0312042236328125,
-0.01375579833984375,
-0.0157928466796875,
0.08160400390625,
-0.00901031494140625,
0.013916015625,
-0.00725555419921875,
-0.0258636474609375,
-0.003452301025390625,
-0.0274505615234375,
-0.0183868408203125,
0.007747650146484375,
-0.00681304931640625,
-0.0165252685546875,
0.039794921875,
-0.064453125,
0.06549072265625,
0.06787109375,
-0.00220489501953125,
0.0291290283203125,
0.01983642578125,
0.01163482666015625,
0.0078277587890625,
-0.005237579345703125,
-0.00868988037109375,
-0.005100250244140625,
0.022064208984375,
-0.0038204193115234375,
-0.006526947021484375,
0.017425537109375,
-0.0059051513671875,
0.042388916015625,
0.054290771484375,
0.09039306640625,
-0.058441162109375,
0.002414703369140625,
-0.00034809112548828125,
-0.03973388671875,
0.04058837890625,
0.0037708282470703125,
-0.042877197265625,
-0.0477294921875,
0.03729248046875,
-0.05224609375,
-0.01934814453125,
-0.0018138885498046875,
-0.007678985595703125,
-0.0183258056640625,
-0.0046539306640625,
0.03143310546875,
0.026092529296875,
0.003612518310546875,
0.01393890380859375,
-0.0017766952514648438,
0.0162506103515625,
-0.02337646484375,
-0.0081787109375,
0.0125885009765625,
-0.0288848876953125,
-0.041595458984375,
0.0285186767578125,
-0.02142333984375,
0.01033782958984375,
-0.0135498046875,
0.0301055908203125,
0.01519012451171875,
0.0394287109375,
-0.003505706787109375,
0.00583648681640625,
0.004085540771484375,
-0.00481414794921875,
-0.00646209716796875,
-0.036102294921875,
0.030975341796875,
0.048431396484375,
-0.0406494140625,
0.0218658447265625,
0.00608062744140625,
-0.0404052734375,
-0.00888824462890625,
-0.0335693359375,
0.056182861328125,
-0.0308380126953125,
0.0013132095336914062,
0.0199127197265625,
0.018402099609375,
-0.00925445556640625,
0.0156707763671875,
0.00232696533203125,
-0.03759765625,
-0.01346588134765625,
-0.00201416015625,
-0.03509521484375,
-0.006534576416015625,
0.002536773681640625,
-0.021392822265625,
0.134521484375,
0.0246124267578125,
-0.0254364013671875,
-0.01374053955078125,
0.078857421875,
-0.0263214111328125,
0.0672607421875,
-0.0218048095703125,
0.0462646484375,
0.0072479248046875,
-0.0098876953125,
-0.036376953125,
-0.00432586669921875,
-0.0218048095703125,
0.0079193115234375,
-0.0231781005859375,
-0.005435943603515625,
-0.0251617431640625,
0.0084228515625,
0.032318115234375,
0.028533935546875,
0.0291900634765625,
0.0222015380859375,
0.00677490234375,
0.0293121337890625,
0.0302581787109375,
-0.0196990966796875,
0.04241943359375,
-0.032318115234375,
-0.0240936279296875,
0.036895751953125,
0.022003173828125,
0.023651123046875,
-0.023406982421875,
0.042694091796875,
-0.0187835693359375,
-0.0021991729736328125,
0.0224456787109375,
0.01678466796875,
0.034332275390625,
0.005359649658203125,
0.02337646484375,
0.0115203857421875,
0.01580810546875,
-0.0249786376953125,
0.035400390625,
-0.012054443359375,
-0.0208740234375,
-0.01129150390625,
0.0018777847290039062,
-0.0166015625,
-0.0199127197265625,
-0.0294036865234375,
0.032012939453125,
-0.0162200927734375,
0.0053558349609375,
0.0012369155883789062,
0.054901123046875,
-0.021331787109375,
-0.004058837890625,
-0.006134033203125,
0.01026153564453125,
-0.0111846923828125,
-0.004718780517578125,
0.00699615478515625,
-0.014068603515625,
0.00260162353515625,
-0.01995849609375,
0.00611114501953125,
-0.01505279541015625,
-0.04241943359375,
-0.042755126953125,
0.009674072265625,
0.037750244140625,
0.01483154296875,
-0.002964019775390625,
0.0325927734375,
-0.025421142578125,
-0.0028476715087890625,
-0.016815185546875,
0.0176849365234375,
0.00897979736328125,
0.0131683349609375,
-0.0134735107421875,
0.028656005859375,
-0.01441192626953125,
0.0144500732421875,
-0.018157958984375,
0.0188140869140625,
-0.0034160614013671875,
0.03472900390625,
-0.061187744140625,
-0.0309295654296875,
0.0125732421875,
0.047088623046875,
-0.019287109375,
-0.00980377197265625,
0.05609130859375,
0.073974609375,
-0.0552978515625,
-0.0303802490234375,
0.0270843505859375,
-0.01337432861328125,
0.0268707275390625,
-0.041656494140625,
0.033599853515625,
0.00882720947265625,
-0.01043701171875,
-0.01312255859375,
0.019287109375,
0.03509521484375,
-0.002391815185546875,
0.018707275390625,
0.0109405517578125,
-0.0230865478515625,
0.0233612060546875,
0.01412200927734375,
0.034942626953125,
0.0284423828125,
-0.01441192626953125,
0.00583648681640625,
-0.00545501708984375,
-0.0263671875,
-0.0004010200500488281,
0.015594482421875,
-0.028839111328125,
0.03936767578125,
-0.0059051513671875,
0.03173828125,
-0.007396697998046875,
-0.01371002197265625,
-0.007762908935546875,
-0.032562255859375,
0.03741455078125,
-0.007083892822265625,
-0.0523681640625,
-0.038787841796875,
-0.0240020751953125,
0.046875,
0.031707763671875,
0.0736083984375,
-0.0149383544921875,
0.02569580078125,
-0.0221710205078125,
-0.00542449951171875,
-0.0289459228515625,
0.01134490966796875,
-0.054656982421875,
0.00931549072265625,
0.006877899169921875,
0.002994537353515625,
-0.057098388671875,
0.05450439453125,
0.008392333984375,
0.011810302734375,
0.044769287109375,
-0.01116943359375,
0.0026264190673828125,
-0.0095062255859375,
-0.006633758544921875,
-0.028411865234375,
-0.041656494140625,
-0.0035686492919921875,
0.02862548828125,
-0.0174560546875,
-0.0279388427734375,
-0.03570556640625,
0.006641387939453125,
-0.0025882720947265625,
0.003204345703125,
-0.0013523101806640625,
0.0189056396484375,
-0.01313018798828125,
0.020477294921875,
-0.01392364501953125,
0.011077880859375,
0.004535675048828125,
-0.019256591796875,
0.022369384765625,
-0.002330780029296875,
0.03167724609375,
-0.0042877197265625,
0.00799560546875,
0.0263519287109375,
0.037322998046875,
0.0526123046875,
-0.0201263427734375,
0.0277862548828125,
-0.011993408203125,
0.0007753372192382812,
0.035369873046875,
0.0181732177734375,
-0.01137542724609375,
-0.039886474609375,
-0.004398345947265625,
-0.00774383544921875,
-0.02130126953125,
-0.03350830078125,
-0.004638671875,
0.026763916015625,
0.010467529296875,
0.0018444061279296875,
-0.04730224609375,
0.03277587890625,
-0.01263427734375,
0.046173095703125,
-0.0173492431640625,
-0.0517578125,
-0.007038116455078125,
-0.0220489501953125,
0.025634765625,
-0.048492431640625,
-0.04449462890625,
0.06884765625,
0.00342559814453125,
-0.01201629638671875,
-0.0061492919921875,
-0.0184783935546875,
0.004993438720703125,
-0.0081329345703125,
0.021453857421875,
0.03375244140625,
0.025970458984375,
-0.005016326904296875,
0.0623779296875,
-0.03802490234375,
-0.0249176025390625,
-0.059539794921875,
-0.01495361328125,
-0.059417724609375,
0.007537841796875,
-0.0232391357421875,
0.027923583984375,
0.055328369140625,
-0.032623291015625,
-0.1085205078125,
-0.0029201507568359375,
-0.0198822021484375,
-0.044647216796875,
-0.030181884765625,
0.00470733642578125,
-0.01126861572265625,
-0.035614013671875,
-0.025909423828125,
-0.0187835693359375,
-0.00568389892578125,
0.0421142578125,
0.007778167724609375,
0.044036865234375,
-0.03192138671875,
0.04248046875,
-0.0221710205078125,
0.0548095703125,
0.04278564453125,
-0.024322509765625,
0.01450347900390625,
0.01039886474609375,
0.0094757080078125,
0.0340576171875,
-0.03729248046875,
-0.0123138427734375,
-0.035552978515625,
-0.0244293212890625,
-0.0017805099487304688,
-0.0212249755859375,
-0.0168914794921875,
-0.002716064453125,
0.068359375,
0.029937744140625,
0.01483154296875,
-0.0299835205078125,
-0.0125732421875,
-0.006328582763671875,
0.020965576171875,
-0.005474090576171875,
0.0015621185302734375,
-0.05035400390625,
-0.0119171142578125,
0.00848388671875,
-0.0079193115234375,
-0.047943115234375,
0.024627685546875,
-0.0268096923828125,
-0.008392333984375,
0.007038116455078125,
-0.0241546630859375,
-0.0005402565002441406,
-0.04620361328125,
0.06964111328125,
-0.0240631103515625,
0.04522705078125,
0.0244293212890625,
0.004547119140625,
0.0628662109375,
0.1041259765625,
0.032440185546875,
0.05560302734375,
-0.06976318359375,
-0.030426025390625,
0.0288238525390625,
0.003017425537109375,
0.00342559814453125,
-0.03619384765625,
-0.002300262451171875,
0.01806640625,
0.0303955078125,
0.028106689453125,
-0.07086181640625,
0.0242767333984375,
0.01849365234375,
0.009735107421875,
-0.0031795501708984375,
-0.048492431640625,
-0.0305938720703125,
0.039703369140625,
-0.046722412109375,
-0.0266571044921875,
-0.01129913330078125,
-0.043121337890625,
0.019744873046875,
0.01157379150390625,
0.0298309326171875,
-0.01666259765625,
0.008331298828125,
-0.0309295654296875,
0.006412506103515625,
0.004383087158203125
] |
e2c3368117c7fe5b99532edcf335f71f8cea27d7
|
Wordpress Stackexchange
Q: Why $ for jquery doesn't work? I used the following to enqueue jquery plugins:
<?php
function my_scripts_method() {
wp_enqueue_script(
'custom functions',
get_template_directory_uri() . '/js/main.js',
array('jquery'),
'1',
true
);
wp_enqueue_script(
'dotdotdot & lightbox',
get_template_directory_uri() . '/js/plugins.js',
array('jquery'),
'1',
true
);
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
And I don't know it it's related but jquery only responds to calling jquery(... and not $(.... Why is that?
A: Use closure for your scripts:
(function($){
$(document).ready(function() {
// do something...
});
})(jQuery);
It is safe way to use jQuery.
|
Q: Why $ for jquery doesn't work? I used the following to enqueue jquery plugins:
<?php
function my_scripts_method() {
wp_enqueue_script(
'custom functions',
get_template_directory_uri() . '/js/main.js',
array('jquery'),
'1',
true
);
wp_enqueue_script(
'dotdotdot & lightbox',
get_template_directory_uri() . '/js/plugins.js',
array('jquery'),
'1',
true
);
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
And I don't know it it's related but jquery only responds to calling jquery(... and not $(.... Why is that?
A: Use closure for your scripts:
(function($){
$(document).ready(function() {
// do something...
});
})(jQuery);
It is safe way to use jQuery.
A: jQuery supplied with WordPress is in noConflict mode to avoid issues with other libraries that may use the $ as their object reference.
See wp_enqueue_script: jQuery noConflict wrappers for more info.
|
wordpress
|
{
"language": "en",
"length": 116,
"provenance": "stackexchange_00019.jsonl.gz:420837",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55230"
}
|
[
0.02655029296875,
-0.0093536376953125,
-0.044647216796875,
-0.006557464599609375,
0.0028839111328125,
-0.04449462890625,
0.0469970703125,
0.0136871337890625,
-0.0085601806640625,
0.03533935546875,
-0.039703369140625,
0.03570556640625,
-0.0256500244140625,
0.00670623779296875,
-0.0185699462890625,
-0.032257080078125,
0.04534912109375,
-0.08526611328125,
-0.049591064453125,
-0.03118896484375,
0.0305023193359375,
-0.01294708251953125,
0.01169586181640625,
0.09918212890625,
0.034271240234375,
-0.0008606910705566406,
0.0894775390625,
-0.021636962890625,
0.032501220703125,
-0.01324462890625,
0.0306396484375,
-0.039581298828125,
0.0162353515625,
0.0153961181640625,
-0.0138092041015625,
-0.0031833648681640625,
0.0223388671875,
0.017059326171875,
0.0200958251953125,
0.01202392578125,
0.0257110595703125,
-0.01971435546875,
0.0256195068359375,
0.039703369140625,
-0.005870819091796875,
-0.0421142578125,
0.0421142578125,
-0.03076171875,
0.0010614395141601562,
-0.0108489990234375,
-0.00030350685119628906,
0.00475311279296875,
0.0079498291015625,
-0.014739990234375,
0.0059814453125,
0.02728271484375,
-0.00826263427734375,
-0.035003662109375,
0.0162353515625,
0.089599609375,
0.001834869384765625,
-0.0155792236328125,
-0.01161956787109375,
-0.07879638671875,
-0.0072479248046875,
-0.0264739990234375,
-0.0128631591796875,
-0.0006170272827148438,
-0.01177978515625,
0.0236358642578125,
0.04144287109375,
-0.0081787109375,
-0.0231170654296875,
0.0099639892578125,
-0.0209197998046875,
-0.0098724365234375,
0.0266265869140625,
0.00424957275390625,
-0.00870513916015625,
0.022918701171875,
0.025177001953125,
0.007411956787109375,
-0.00504302978515625,
0.02410888671875,
-0.01306915283203125,
0.05767822265625,
-0.01264190673828125,
-0.038238525390625,
-0.04266357421875,
-0.03570556640625,
-0.041748046875,
-0.0081939697265625,
-0.05169677734375,
-0.0294342041015625,
-0.01837158203125,
0.0011301040649414062,
0.0276641845703125,
0.036224365234375,
0.00925445556640625,
0.01885986328125,
0.006832122802734375,
-0.0299224853515625,
0.028289794921875,
-0.0258026123046875,
-0.02166748046875,
0.031463623046875,
0.0286102294921875,
0.06671142578125,
0.011199951171875,
0.022705078125,
0.007579803466796875,
-0.015289306640625,
0.0229949951171875,
-0.0076141357421875,
0.0304412841796875,
-0.064697265625,
-0.0531005859375,
0.051544189453125,
0.0005717277526855469,
-0.0013837814331054688,
0.01422882080078125,
0.0552978515625,
-0.035003662109375,
-0.036468505859375,
-0.00015234947204589844,
-0.0101165771484375,
0.019744873046875,
-0.0443115234375,
0.01033782958984375,
0.0300140380859375,
-0.0258331298828125,
-0.006366729736328125,
0.054107666015625,
0.00754547119140625,
-0.0089111328125,
-0.031463623046875,
0.059783935546875,
-0.024383544921875,
0.0201873779296875,
-0.0338134765625,
0.0027313232421875,
0.0225067138671875,
0.0186920166015625,
-0.026947021484375,
-0.02728271484375,
-0.0008096694946289062,
0.0229034423828125,
0.027679443359375,
-0.0236663818359375,
-0.03289794921875,
0.0280914306640625,
-0.016754150390625,
0.042022705078125,
0.014617919921875,
-0.0106658935546875,
-0.01123046875,
0.05633544921875,
-0.045623779296875,
-0.0266876220703125,
-0.03985595703125,
-0.006046295166015625,
0.0276947021484375,
0.020111083984375,
-0.007610321044921875,
0.0140533447265625,
-0.05120849609375,
-0.00894927978515625,
0.01313018798828125,
0.02056884765625,
0.056640625,
-0.006256103515625,
-0.048828125,
0.00588226318359375,
0.02264404296875,
-0.006122589111328125,
0.0309600830078125,
-0.0147247314453125,
0.0223846435546875,
0.048797607421875,
-0.0113067626953125,
-0.016143798828125,
-0.032989501953125,
0.06854248046875,
-0.01666259765625,
-0.037445068359375,
-0.007541656494140625,
0.029449462890625,
0.036865234375,
-0.01541900634765625,
0.019989013671875,
0.06988525390625,
0.026092529296875,
-0.032501220703125,
0.0217437744140625,
0.00899505615234375,
-0.028839111328125,
-0.004947662353515625,
0.00604248046875,
-0.0007562637329101562,
-0.0159454345703125,
0.01462554931640625,
-0.0225830078125,
0.021453857421875,
-0.027587890625,
-0.0576171875,
-0.01390838623046875,
-0.023284912109375,
0.039703369140625,
0.00579833984375,
0.02020263671875,
0.005809783935546875,
0.0240020751953125,
-0.039581298828125,
-0.01500701904296875,
-0.045074462890625,
0.005847930908203125,
-0.02545166015625,
0.05548095703125,
-0.001865386962890625,
0.032379150390625,
0.00811767578125,
-0.053924560546875,
0.007274627685546875,
-0.0021228790283203125,
0.0164337158203125,
0.00033736228942871094,
-0.03179931640625,
-0.00948333740234375,
-0.0299835205078125,
0.00548553466796875,
-0.042816162109375,
0.061676025390625,
0.033111572265625,
0.06829833984375,
-0.00136566162109375,
-0.00943756103515625,
-0.004558563232421875,
-0.0235748291015625,
0.01024627685546875,
0.0175018310546875,
0.0215606689453125,
0.03253173828125,
-0.0372314453125,
-0.033111572265625,
0.038360595703125,
-0.030181884765625,
0.003330230712890625,
-0.021575927734375,
0.0025463104248046875,
0.0033779144287109375,
-0.0208587646484375,
-0.0009627342224121094,
0.031890869140625,
-0.06256103515625,
0.005519866943359375,
0.056243896484375,
0.007411956787109375,
0.0208587646484375,
-0.0190277099609375,
0.01305389404296875,
-0.00351715087890625,
-0.006500244140625,
-0.01161956787109375,
0.0050506591796875,
0.03558349609375,
-0.01702880859375,
0.0093994140625,
0.01264190673828125,
-0.00017452239990234375,
-0.00818634033203125,
-0.0021533966064453125,
-0.0721435546875,
-0.003383636474609375,
0.065185546875,
0.022491455078125,
0.0210113525390625,
-0.055694580078125,
-0.019256591796875,
0.0227508544921875,
0.05657958984375,
0.0221710205078125,
0.0249176025390625,
0.016387939453125,
-0.00649261474609375,
0.035552978515625,
0.009552001953125,
0.0027008056640625,
0.014678955078125,
0.060760498046875,
0.0263824462890625,
0.05816650390625,
0.001720428466796875,
-0.00629425048828125,
0.051605224609375,
-0.0002739429473876953,
-0.04010009765625,
0.07159423828125,
-0.01546478271484375,
0.0181121826171875,
-0.0197906494140625,
0.046875,
0.0273284912109375,
-0.01459503173828125,
-0.0008530616760253906,
0.00482940673828125,
0.03753662109375,
0.0408935546875,
-0.007801055908203125,
0.006988525390625,
-0.01088714599609375,
-0.041290283203125,
-0.0301513671875,
0.01361083984375,
0.05621337890625,
-0.0164031982421875,
-0.049560546875,
0.0022182464599609375,
0.00946807861328125,
-0.10980224609375,
-0.1329345703125,
0.00591278076171875,
-0.09381103515625,
0.03912353515625,
-0.008453369140625,
-0.028778076171875,
-0.025115966796875,
0.0333251953125,
0.022979736328125,
-0.007755279541015625,
-0.02215576171875,
-0.046112060546875,
-0.045989990234375,
-0.07666015625,
0.024566650390625,
0.01015472412109375,
0.007152557373046875,
0.0116119384765625,
0.0014209747314453125,
0.0133056640625,
-0.040771484375,
0.0181732177734375,
0.0161590576171875,
-0.01558685302734375,
0.0243682861328125,
0.04107666015625,
-0.0272216796875,
-0.0306854248046875,
0.006542205810546875,
0.017822265625,
0.0272674560546875,
-0.044769287109375,
-0.0091552734375,
-0.0272674560546875,
-0.023162841796875,
0.01361846923828125,
0.0455322265625,
0.01068878173828125,
-0.01348114013671875,
0.054290771484375,
-0.031646728515625,
-0.0157318115234375,
0.0083160400390625,
-0.044464111328125,
0.0221710205078125,
0.00868988037109375,
-0.00675201416015625,
-0.01146697998046875,
0.0200347900390625,
0.031463623046875,
-0.007595062255859375,
-0.030609130859375,
-0.01117706298828125,
0.056671142578125,
0.01485443115234375,
0.054656982421875,
-0.01806640625,
0.040252685546875,
-0.036468505859375,
0.0023746490478515625,
0.002285003662109375,
-0.0208282470703125,
0.00457000732421875,
-0.0401611328125,
-0.0208282470703125,
0.0164642333984375,
0.01500701904296875,
-0.0036907196044921875,
0.01111602783203125,
-0.0012664794921875,
-0.005706787109375,
0.00112152099609375,
0.0203704833984375,
-0.051910400390625,
-0.00901031494140625,
0.0245208740234375,
0.0195770263671875,
-0.05145263671875,
-0.058380126953125,
-0.05633544921875,
-0.01259613037109375,
-0.06793212890625,
-0.0043487548828125,
-0.0221405029296875,
-0.0408935546875,
-0.01129150390625,
0.00466156005859375,
-0.04388427734375,
-0.0294342041015625,
0.027130126953125,
-0.043792724609375,
0.0079803466796875,
-0.004497528076171875,
0.0023059844970703125,
-0.056365966796875,
0.01214599609375,
-0.038421630859375,
-0.0557861328125,
-0.0196075439453125,
-0.001071929931640625,
0.06878662109375,
0.0221710205078125,
-0.036529541015625,
-0.0209808349609375,
0.043670654296875,
0.0213775634765625,
0.0093536376953125,
0.01222991943359375,
-0.006908416748046875,
0.0092926025390625,
-0.0167694091796875,
0.00179290771484375,
-0.027313232421875,
0.002300262451171875,
0.01486968994140625,
-0.0266571044921875,
-0.0227203369140625,
-0.0340576171875,
-0.052398681640625,
0.0172576904296875,
-0.043365478515625,
-0.025726318359375,
-0.01355743408203125,
-0.03857421875,
-0.022430419921875,
-0.005615234375,
-0.040618896484375,
0.007755279541015625,
-0.031524658203125,
0.02777099609375,
-0.0190887451171875,
0.004150390625,
0.0025730133056640625,
0.04345703125,
0.0143890380859375,
-0.010650634765625,
-0.0061187744140625,
0.0211029052734375,
0.0247344970703125,
0.038421630859375,
0.0233612060546875,
-0.03021240234375,
-0.0259857177734375,
0.060821533203125,
0.002948760986328125,
0.0173797607421875,
-0.026763916015625,
0.07122802734375,
0.0109405517578125,
0.0020751953125,
0.00750732421875,
0.031829833984375,
-0.05352783203125,
0.0012636184692382812,
0.004550933837890625,
0.005664825439453125,
-0.00856781005859375,
-0.01024627685546875,
0.00971221923828125,
-0.0036754608154296875,
-0.01056671142578125,
-0.051849365234375,
0.01346588134765625,
-0.053985595703125,
0.1014404296875,
0.0234222412109375,
-0.00669097900390625,
0.07659912109375,
0.04388427734375,
-0.00902557373046875,
0.0261993408203125,
0.0215606689453125,
-0.00506591796875,
0.0136260986328125,
0.05218505859375,
-0.012237548828125,
-0.005260467529296875,
-0.013519287109375,
0.0457763671875,
0.04888916015625,
-0.011138916015625,
-0.0196990966796875,
-0.001251220703125,
0.015838623046875,
-0.054901123046875,
0.01806640625,
0.0241546630859375,
0.0249176025390625,
-0.0244293212890625,
-0.016204833984375,
0.04150390625,
-0.022216796875,
-0.01873779296875,
0.044525146484375,
0.0272979736328125,
-0.0156402587890625,
-0.048065185546875,
0.04296875,
0.02880859375,
-0.0185394287109375,
0.0001875162124633789,
0.046417236328125,
-0.019073486328125,
0.0718994140625,
0.0008826255798339844,
-0.038543701171875,
0.0252227783203125,
0.0308685302734375,
-0.02783203125,
-0.0262451171875,
-0.031707763671875,
0.01432037353515625,
0.01125335693359375,
0.0010099411010742188,
0.01806640625,
0.0163421630859375,
0.034454345703125,
-0.03546142578125,
0.028289794921875,
0.0094757080078125,
-0.000797271728515625,
-0.03857421875,
-0.0086669921875,
0.04559326171875,
0.059326171875,
0.0110626220703125,
0.01029205322265625,
-0.0165557861328125,
0.00022590160369873047,
0.00232696533203125,
-0.00634765625,
-0.03692626953125,
-0.0254974365234375,
0.0199737548828125,
0.005504608154296875,
0.0171356201171875,
-0.06817626953125,
-0.047149658203125,
-0.0196075439453125,
0.007747650146484375,
0.03717041015625,
-0.0265960693359375,
0.054168701171875,
-0.040130615234375,
-0.01050567626953125,
-0.0219573974609375,
0.0156402587890625,
0.058197021484375,
0.065185546875,
-0.03106689453125,
-0.00921630859375,
-0.029388427734375,
-0.0245361328125,
-0.0250244140625,
-0.0399169921875,
-0.041656494140625,
0.004199981689453125,
-0.0029544830322265625,
-0.0022487640380859375,
-0.035247802734375,
-0.039764404296875,
0.01412200927734375,
0.030670166015625,
0.032318115234375,
0.02557373046875,
-0.03460693359375,
0.055908203125,
0.0494384765625,
0.0225982666015625,
0.007343292236328125,
0.035552978515625,
0.0169830322265625,
-0.03131103515625,
-0.022369384765625,
-0.07415771484375,
0.0367431640625,
0.0103912353515625,
0.0014476776123046875,
0.01806640625,
0.041168212890625,
0.0191650390625,
0.047271728515625,
0.00978851318359375,
0.0008702278137207031,
-0.0140228271484375,
0.0006356239318847656,
0.01708984375,
0.043212890625,
0.0361328125,
-0.025604248046875,
0.004291534423828125,
-0.006641387939453125,
-0.017303466796875,
0.048919677734375,
-0.028350830078125,
0.03265380859375,
0.006153106689453125,
-0.0237579345703125,
0.059967041015625,
0.05963134765625,
0.006214141845703125,
0.032684326171875,
0.0084991455078125,
0.015655517578125,
0.00032711029052734375,
0.01401519775390625,
-0.04498291015625,
-0.01776123046875,
0.044769287109375,
0.0016355514526367188,
-0.042938232421875,
0.0252685546875,
-0.02642822265625,
-0.0028533935546875,
0.0379638671875,
0.0250701904296875,
-0.057403564453125,
0.00878143310546875,
-0.01885986328125,
-0.0256805419921875,
-0.015045166015625,
-0.049957275390625,
0.02471923828125,
0.027557373046875,
0.05133056640625,
0.0276947021484375,
-0.0279541015625,
0.0270538330078125,
0.0045318603515625,
-0.03399658203125,
-0.028167724609375,
-0.0287017822265625,
0.02386474609375,
-0.014373779296875,
0.0472412109375,
0.01158905029296875,
0.016021728515625,
0.009857177734375,
0.02191162109375,
0.00666046142578125,
-0.00821685791015625,
-0.005664825439453125,
0.035308837890625,
-0.029693603515625,
-0.0090789794921875,
-0.0007610321044921875,
-0.0181732177734375,
0.032806396484375,
0.0509033203125,
-0.0299224853515625,
0.0189361572265625,
0.0232391357421875,
0.0079193115234375,
0.0244140625,
-0.0294036865234375,
0.00685882568359375,
0.0206146240234375,
-0.0460205078125,
0.01445770263671875,
-0.00910186767578125,
-0.00920867919921875,
-0.018096923828125,
-0.004150390625,
0.05078125,
-0.038726806640625,
-0.0031528472900390625,
0.0265655517578125,
0.0361328125,
-0.023681640625,
-0.00849151611328125,
-0.0256500244140625,
-0.05987548828125,
0.01290130615234375,
0.0011425018310546875,
-0.003398895263671875,
0.018035888671875,
-0.0029811859130859375,
-0.037506103515625,
0.11474609375,
-0.01432037353515625,
-0.016632080078125,
0.00850677490234375,
0.053802490234375,
-0.029571533203125,
0.039947509765625,
-0.0274658203125,
0.00753021240234375,
-0.03094482421875,
0.0211181640625,
-0.01088714599609375,
0.0165252685546875,
-0.003330230712890625,
-0.015838623046875,
-0.0302734375,
-0.01279449462890625,
0.0213165283203125,
-0.01456451416015625,
-0.009368896484375,
0.060943603515625,
0.015960693359375,
-0.0311279296875,
0.016448974609375,
-0.00005239248275756836,
-0.0300140380859375,
-0.006801605224609375,
0.0156097412109375,
-0.05084228515625,
-0.0101776123046875,
0.040985107421875,
-0.003902435302734375,
-0.018890380859375,
0.0171051025390625,
0.0002753734588623047,
-0.05120849609375,
0.03314208984375,
0.0004634857177734375,
0.0606689453125,
-0.020599365234375,
0.053619384765625,
0.0157928466796875,
0.0023593902587890625,
-0.0848388671875,
-0.004062652587890625,
0.01556396484375,
0.012359619140625,
-0.0234375,
0.0007987022399902344,
-0.002033233642578125,
-0.02655029296875,
0.007572174072265625,
-0.031829833984375,
0.014068603515625,
0.01065826416015625,
0.0157318115234375,
0.008544921875,
0.0192108154296875,
-0.05816650390625,
-0.04949951171875,
0.0504150390625,
0.04437255859375,
-0.0237884521484375,
-0.0156707763671875,
-0.01372528076171875,
-0.01078033447265625,
0.035980224609375,
-0.0384521484375,
0.00933837890625,
-0.0018033981323242188,
0.01012420654296875,
0.002819061279296875,
-0.004192352294921875,
0.0204925537109375,
-0.00868988037109375,
0.006679534912109375,
-0.0266265869140625,
0.0236053466796875,
0.0352783203125,
-0.0625,
0.036865234375,
0.01123809814453125,
0.06671142578125,
0.006755828857421875,
0.046051025390625,
-0.03680419921875,
-0.037567138671875,
0.0233612060546875,
0.029052734375,
-0.020050048828125,
-0.0218048095703125,
0.0015192031860351562,
-0.00919342041015625,
-0.0303802490234375,
0.0006852149963378906,
0.02752685546875,
0.0227203369140625,
0.045166015625,
0.0168914794921875,
-0.0340576171875,
0.0143585205078125,
0.0360107421875,
-0.0153045654296875,
0.0205230712890625,
0.01678466796875,
0.0252532958984375,
0.00893402099609375,
-0.00632476806640625,
-0.0270233154296875,
0.09466552734375,
0.00661468505859375,
-0.044158935546875,
0.04638671875,
-0.005107879638671875,
-0.0308685302734375,
0.036285400390625,
-0.0259246826171875,
0.10546875,
-0.020477294921875,
-0.021881103515625,
-0.0222015380859375,
-0.0014705657958984375,
-0.0146331787109375,
0.0265045166015625,
0.035919189453125,
-0.016754150390625,
0.04052734375,
0.045684814453125,
-0.0540771484375,
0.019134521484375,
0.031402587890625,
0.0162353515625,
-0.001094818115234375,
0.0189208984375,
0.0009398460388183594,
0.02264404296875,
0.014801025390625,
0.0178070068359375,
0.01776123046875,
0.0145416259765625,
0.004180908203125,
-0.014190673828125,
0.0092010498046875,
0.053741455078125,
-0.01036834716796875,
0.01806640625,
0.0208587646484375,
0.017913818359375,
-0.04559326171875,
0.00603485107421875,
-0.012451171875,
-0.04583740234375,
0.035858154296875,
-0.01146697998046875,
0.022003173828125,
0.031768798828125,
-0.033782958984375,
0.01061248779296875,
0.021636962890625,
0.046661376953125,
-0.0210723876953125,
-0.0193634033203125,
-0.037017822265625,
-0.02960205078125,
0.039703369140625,
0.03466796875,
0.02398681640625,
-0.00463104248046875,
-0.003170013427734375,
-0.04925537109375,
-0.00991058349609375,
-0.01471710205078125,
-0.0292510986328125,
0.02410888671875,
0.03802490234375,
-0.021759033203125,
-0.0063323974609375,
-0.0137481689453125,
0.01312255859375,
-0.01503753662109375,
0.0241546630859375,
-0.01256561279296875,
-0.032928466796875,
-0.01097869873046875,
-0.0025177001953125,
0.00579071044921875,
0.007556915283203125,
-0.0015954971313476562,
-0.0119476318359375,
-0.034088134765625,
-0.0261688232421875,
-0.03167724609375,
-0.0088653564453125,
-0.049560546875,
0.015869140625,
0.0167694091796875,
-0.0030364990234375,
0.0005393028259277344,
0.0005793571472167969,
-0.00872039794921875,
0.01477813720703125,
0.004364013671875,
-0.05694580078125,
0.0195770263671875,
-0.045501708984375,
0.042205810546875,
-0.03948974609375,
0.0220794677734375,
-0.024322509765625,
-0.0013875961303710938,
-0.0218963623046875,
-0.0302734375,
-0.05438232421875,
0.03692626953125,
-0.0160369873046875,
0.04351806640625,
0.03973388671875,
-0.038726806640625,
-0.01546478271484375,
0.06634521484375,
0.031707763671875,
0.1217041015625,
0.03106689453125,
-0.0204010009765625,
-0.008941650390625,
0.005443572998046875,
-0.0022525787353515625,
-0.018524169921875,
0.01036834716796875,
-0.028350830078125,
-0.02362060546875,
-0.029083251953125,
0.0218505859375,
0.0149993896484375,
-0.0309295654296875,
-0.1043701171875,
0.041534423828125,
-0.0291290283203125,
-0.0316162109375,
-0.0609130859375,
-0.016265869140625,
0.0234527587890625,
-0.021942138671875,
-0.028411865234375,
-0.02996826171875,
-0.07330322265625,
0.03533935546875,
0.02227783203125,
0.0209808349609375,
0.04327392578125,
-0.00665283203125,
-0.034759521484375,
0.0015316009521484375,
-0.005268096923828125,
0.01364898681640625,
-0.0310821533203125,
0.0078582763671875,
0.020477294921875,
0.035369873046875,
0.00887298583984375,
-0.0022792816162109375,
0.02435302734375,
-0.0206298828125,
0.0057525634765625,
0.002857208251953125,
-0.0238189697265625,
0.016204833984375,
0.03765869140625,
0.0009889602661132812,
0.01280975341796875,
-0.0295867919921875,
-0.0278778076171875,
-0.05413818359375,
-0.0035953521728515625,
-0.00402069091796875,
0.005741119384765625,
-0.034942626953125,
0.0419921875,
0.007488250732421875,
0.002391815185546875,
-0.0165557861328125,
-0.040313720703125,
-0.033447265625,
-0.017578125,
-0.00525665283203125,
0.012298583984375,
0.03289794921875,
-0.02069091796875,
0.106201171875,
-0.051116943359375,
0.0156707763671875,
0.0281982421875,
0.022308349609375,
0.06146240234375,
-0.005222320556640625,
0.01323699951171875,
0.033905029296875,
-0.0167236328125,
-0.0119171142578125,
0.0160980224609375,
0.00043463706970214844,
0.0009851455688476562,
-0.0205535888671875,
0.01267242431640625,
0.03363037109375,
-0.01390838623046875,
0.035552978515625,
0.01102447509765625,
0.02960205078125,
-0.0106048583984375,
-0.0015935897827148438,
-0.0528564453125,
-0.00817108154296875,
-0.0200958251953125,
-0.007534027099609375,
0.005023956298828125,
0.0306243896484375,
0.0792236328125,
-0.0268096923828125,
-0.0139923095703125,
0.0162506103515625,
-0.048675537109375,
-0.01824951171875,
-0.0018596649169921875,
-0.0226898193359375,
-0.0192718505859375,
-0.0016269683837890625
] |
9de741cfd621a22a9f4bfff6c2ed935dea1db07e
|
Wordpress Stackexchange
Q: Making Media Library "Alternative Text" Field Required I'm looking to make the "Alternative Text" field required in the Media Library, just like the "Title" field above it.
Screenshot:
A: I've managed to make it work of sorts...
The requirement is not checked in the Media Library upload /wp-admin/media-new.php, but instead in the Media Upload thickbox iframe /wp-admin/media-upload.php.
The following is the code that works in the thickbox and displays an alert box making mandatory filling the Alt text field.
IMO, it won't be easy, but it can be adapted to work in the Upload New Media page (/wp-admin/media-new.php)...
add_action('admin_head-media-upload-popup','wpse_55240_required_alt_text');
function wpse_55240_required_alt_text()
{
?>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function($) {
$(".submit .savesend input").live("click", validateAltText);
function validateAltText() {
var value = $(this).parent().parent().parent().find(".image_alt input").val();
if (value)
return true;
alert("Please fill the Alt text");
return false;
}
$('.image_alt th label').each(function(i,e) {
$('<span class="alignright"><abbr title="required" class="required">*</abbr></span>').prependTo(this);
});
});
</script>
<?php
}
|
Q: Making Media Library "Alternative Text" Field Required I'm looking to make the "Alternative Text" field required in the Media Library, just like the "Title" field above it.
Screenshot:
A: I've managed to make it work of sorts...
The requirement is not checked in the Media Library upload /wp-admin/media-new.php, but instead in the Media Upload thickbox iframe /wp-admin/media-upload.php.
The following is the code that works in the thickbox and displays an alert box making mandatory filling the Alt text field.
IMO, it won't be easy, but it can be adapted to work in the Upload New Media page (/wp-admin/media-new.php)...
add_action('admin_head-media-upload-popup','wpse_55240_required_alt_text');
function wpse_55240_required_alt_text()
{
?>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function($) {
$(".submit .savesend input").live("click", validateAltText);
function validateAltText() {
var value = $(this).parent().parent().parent().find(".image_alt input").val();
if (value)
return true;
alert("Please fill the Alt text");
return false;
}
$('.image_alt th label').each(function(i,e) {
$('<span class="alignright"><abbr title="required" class="required">*</abbr></span>').prependTo(this);
});
});
</script>
<?php
}
|
wordpress
|
{
"language": "en",
"length": 146,
"provenance": "stackexchange_00019.jsonl.gz:420840",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55240"
}
|
[
-0.00010752677917480469,
-0.0110626220703125,
-0.0260467529296875,
-0.017242431640625,
0.0009508132934570312,
-0.00934600830078125,
0.0014810562133789062,
-0.003787994384765625,
-0.0038509368896484375,
0.0010967254638671875,
-0.04498291015625,
-0.00003516674041748047,
-0.037933349609375,
-0.0272216796875,
-0.00263214111328125,
-0.062042236328125,
-0.01410675048828125,
0.02679443359375,
0.004291534423828125,
-0.02301025390625,
0.00879669189453125,
-0.0294647216796875,
-0.028717041015625,
0.003383636474609375,
-0.005146026611328125,
-0.00994110107421875,
0.09698486328125,
-0.0196685791015625,
-0.026031494140625,
-0.03564453125,
0.009185791015625,
0.0283660888671875,
0.024566650390625,
-0.0054473876953125,
0.005184173583984375,
-0.023895263671875,
0.0308074951171875,
-0.01403045654296875,
-0.016357421875,
0.034820556640625,
0.0238494873046875,
-0.00400543212890625,
0.00044417381286621094,
0.02313232421875,
-0.01551055908203125,
-0.039886474609375,
0.0182342529296875,
-0.023406982421875,
0.033172607421875,
0.06866455078125,
0.00689697265625,
-0.023529052734375,
0.0018463134765625,
-0.0135498046875,
-0.0182342529296875,
-0.03363037109375,
-0.049774169921875,
-0.01287841796875,
0.02447509765625,
0.07550048828125,
0.008758544921875,
-0.0172271728515625,
-0.0154876708984375,
-0.057708740234375,
0.0228729248046875,
-0.022613525390625,
-0.02874755859375,
0.045684814453125,
-0.035797119140625,
0.0061187744140625,
0.01971435546875,
-0.0311126708984375,
0.002147674560546875,
-0.0265045166015625,
-0.024627685546875,
0.03070068359375,
-0.026641845703125,
-0.0294647216796875,
0.0338134765625,
-0.01160430908203125,
0.035247802734375,
0.044952392578125,
0.0162506103515625,
-0.019866943359375,
0.021575927734375,
0.0026721954345703125,
-0.01235198974609375,
-0.031402587890625,
-0.033172607421875,
-0.0241546630859375,
-0.02752685546875,
-0.07244873046875,
-0.008880615234375,
-0.0182647705078125,
-0.0052490234375,
-0.0250701904296875,
0.060791015625,
0.09686279296875,
0.0043182373046875,
0.03704833984375,
-0.0207977294921875,
-0.030029296875,
0.0247039794921875,
-0.052978515625,
-0.0074310302734375,
-0.0231781005859375,
-0.03411865234375,
-0.0911865234375,
0.00470733642578125,
0.03387451171875,
-0.04150390625,
-0.018951416015625,
-0.0006589889526367188,
0.0281829833984375,
-0.050018310546875,
0.01544189453125,
-0.015106201171875,
-0.01103973388671875,
-0.042205810546875,
0.044647216796875,
-0.006710052490234375,
-0.0271759033203125,
0.049530029296875,
-0.042999267578125,
0.0252532958984375,
-0.016815185546875,
-0.067626953125,
0.0297698974609375,
0.01020050048828125,
0.020751953125,
-0.042694091796875,
-0.007659912109375,
0.038604736328125,
0.0343017578125,
0.03106689453125,
-0.0199737548828125,
0.00646209716796875,
0.00021755695343017578,
0.03326416015625,
-0.01336669921875,
0.033935546875,
-0.0178070068359375,
0.0102386474609375,
0.052337646484375,
0.028228759765625,
0.06475830078125,
0.031463623046875,
-0.0283355712890625,
-0.031982421875,
-0.06005859375,
0.03302001953125,
-0.06793212890625,
0.06781005859375,
-0.0028972625732421875,
-0.046478271484375,
-0.01038360595703125,
0.062347412109375,
-0.03863525390625,
-0.065185546875,
-0.076416015625,
0.013824462890625,
0.0166015625,
0.045806884765625,
-0.0860595703125,
-0.046661376953125,
-0.054107666015625,
-0.08587646484375,
-0.012847900390625,
0.024627685546875,
0.007358551025390625,
0.0075531005859375,
0.0140533447265625,
0.0229034423828125,
0.0167999267578125,
-0.0023136138916015625,
0.01128387451171875,
-0.010955810546875,
0.047943115234375,
0.0181884765625,
0.0262908935546875,
-0.01383209228515625,
-0.04339599609375,
0.09283447265625,
-0.040191650390625,
-0.04046630859375,
0.0147857666015625,
0.01959228515625,
0.045318603515625,
0.00759124755859375,
0.0194244384765625,
0.036102294921875,
0.011199951171875,
0.033843994140625,
-0.030303955078125,
-0.008148193359375,
-0.025054931640625,
-0.0025348663330078125,
0.01224517822265625,
-0.0236968994140625,
0.0304718017578125,
0.03704833984375,
0.00295257568359375,
-0.01397705078125,
0.01337432861328125,
-0.00426483154296875,
-0.037017822265625,
0.0018215179443359375,
-0.01372528076171875,
-0.0419921875,
0.001556396484375,
0.037384033203125,
0.01311492919921875,
-0.043365478515625,
0.0020580291748046875,
0.01517486572265625,
0.0155487060546875,
-0.033477783203125,
0.041595458984375,
-0.017669677734375,
0.042633056640625,
-0.034271240234375,
-0.0341796875,
-0.0164337158203125,
0.0001983642578125,
-0.00835418701171875,
0.00408172607421875,
-0.01849365234375,
0.006664276123046875,
-0.00832366943359375,
0.010711669921875,
0.0272674560546875,
0.0216217041015625,
0.052032470703125,
0.0173187255859375,
-0.053955078125,
-0.020965576171875,
-0.061187744140625,
-0.09033203125,
-0.009307861328125,
0.06634521484375,
0.0251617431640625,
0.0272064208984375,
0.0010404586791992188,
0.05438232421875,
0.0909423828125,
0.00537109375,
0.0002675056457519531,
0.023284912109375,
0.00777435302734375,
0.040863037109375,
-0.0574951171875,
-0.002422332763671875,
0.03515625,
-0.034149169921875,
0.0041046142578125,
0.042144775390625,
-0.0303497314453125,
-0.0129852294921875,
-0.039642333984375,
0.01029205322265625,
0.0233917236328125,
-0.007305145263671875,
-0.0140533447265625,
-0.006381988525390625,
0.056884765625,
-0.0029315948486328125,
0.047271728515625,
0.013824462890625,
-0.03118896484375,
0.0277252197265625,
0.00965118408203125,
-0.038970947265625,
-0.004665374755859375,
-0.0021648406982421875,
0.01200103759765625,
-0.01006317138671875,
-0.0172882080078125,
0.005207061767578125,
-0.00724029541015625,
-0.01226806640625,
-0.002471923828125,
0.0137786865234375,
-0.00707244873046875,
-0.01160430908203125,
0.0016326904296875,
-0.0275726318359375,
0.01512908935546875,
-0.0038318634033203125,
0.00794219970703125,
-0.01505279541015625,
0.027496337890625,
0.0215911865234375,
0.0012226104736328125,
0.02276611328125,
0.018798828125,
-0.027740478515625,
0.005573272705078125,
-0.016876220703125,
0.038360595703125,
-0.041748046875,
0.050872802734375,
0.055511474609375,
-0.053680419921875,
0.0288238525390625,
-0.0244598388671875,
-0.003101348876953125,
-0.07904052734375,
0.02252197265625,
-0.0181121826171875,
-0.052276611328125,
-0.039154052734375,
0.0016307830810546875,
0.04351806640625,
0.023651123046875,
0.003589630126953125,
-0.018280029296875,
-0.00945281982421875,
0.01507568359375,
-0.0635986328125,
-0.06292724609375,
-0.01837158203125,
-0.0572509765625,
-0.0010271072387695312,
0.00862884521484375,
-0.029876708984375,
-0.0147705078125,
0.040771484375,
0.005664825439453125,
-0.00402069091796875,
-0.01322174072265625,
-0.032958984375,
-0.044952392578125,
-0.050537109375,
-0.054229736328125,
-0.0058441162109375,
-0.003673553466796875,
-0.0018835067749023438,
0.0296783447265625,
0.00433349609375,
-0.045013427734375,
0.005523681640625,
0.01369476318359375,
0.03680419921875,
0.034820556640625,
-0.007518768310546875,
-0.041229248046875,
-0.015472412109375,
-0.0064849853515625,
0.0185089111328125,
-0.00624847412109375,
0.0204315185546875,
0.00974273681640625,
-0.0308685302734375,
-0.0374755859375,
0.0045013427734375,
0.0121612548828125,
0.00847625732421875,
-0.0295867919921875,
0.0218505859375,
-0.050811767578125,
-0.01142120361328125,
-0.0282135009765625,
-0.03680419921875,
0.06085205078125,
-0.0120391845703125,
0.0178680419921875,
0.02459716796875,
0.03631591796875,
-0.0211029052734375,
0.0079345703125,
0.03955078125,
-0.0229034423828125,
0.00258636474609375,
-0.016143798828125,
-0.023956298828125,
-0.0172576904296875,
0.0292205810546875,
-0.0249481201171875,
-0.050933837890625,
-0.01514434814453125,
-0.0105743408203125,
0.01110076904296875,
-0.0297393798828125,
0.0285186767578125,
-0.049713134765625,
0.04095458984375,
-0.03192138671875,
0.006221771240234375,
-0.044158935546875,
-0.01428985595703125,
-0.01190185546875,
0.062103271484375,
-0.024658203125,
-0.0191802978515625,
-0.039276123046875,
0.0124359130859375,
-0.0178070068359375,
-0.05279541015625,
0.01995849609375,
-0.001331329345703125,
-0.00560760498046875,
0.007671356201171875,
0.01336669921875,
-0.01508331298828125,
-0.01166534423828125,
-0.0404052734375,
-0.01221466064453125,
-0.0216827392578125,
0.03216552734375,
-0.040771484375,
0.0172576904296875,
0.039825439453125,
0.003414154052734375,
0.0005326271057128906,
-0.0367431640625,
-0.03509521484375,
-0.1103515625,
-0.005191802978515625,
-0.049163818359375,
0.059478759765625,
-0.01010894775390625,
0.0210723876953125,
-0.057586669921875,
0.0347900390625,
0.027740478515625,
-0.01288604736328125,
0.0255279541015625,
-0.01369476318359375,
0.038177490234375,
-0.0291900634765625,
-0.00543212890625,
-0.02392578125,
-0.0106201171875,
-0.03033447265625,
-0.07196044921875,
-0.0184173583984375,
-0.004108428955078125,
0.002750396728515625,
0.03131103515625,
-0.030426025390625,
-0.054779052734375,
-0.0230712890625,
-0.02410888671875,
-0.01371002197265625,
-0.007511138916015625,
-0.0205230712890625,
-0.0140533447265625,
-0.043487548828125,
-0.0128326416015625,
-0.0018014907836914062,
0.00020015239715576172,
0.0159454345703125,
0.025421142578125,
0.017822265625,
-0.0016641616821289062,
-0.040435791015625,
-0.0205078125,
0.04071044921875,
0.0330810546875,
0.003185272216796875,
0.00981903076171875,
-0.0301666259765625,
0.038787841796875,
0.023773193359375,
0.0101318359375,
-0.0132598876953125,
0.044830322265625,
0.00920867919921875,
-0.0189361572265625,
0.0110015869140625,
-0.0001785755157470703,
-0.012847900390625,
0.00389862060546875,
0.00795745849609375,
-0.004390716552734375,
-0.006561279296875,
-0.0023822784423828125,
0.00727081298828125,
0.0027523040771484375,
0.00311279296875,
-0.05029296875,
0.00720977783203125,
-0.0094757080078125,
0.0015850067138671875,
-0.00919342041015625,
0.00957489013671875,
-0.00643157958984375,
0.006168365478515625,
0.004489898681640625,
-0.0259552001953125,
0.01549530029296875,
-0.0274658203125,
0.021209716796875,
0.0017147064208984375,
-0.0112762451171875,
-0.0187225341796875,
-0.0030651092529296875,
0.01039886474609375,
-0.0147247314453125,
-0.04412841796875,
0.007198333740234375,
-0.01358795166015625,
0.070556640625,
0.01546478271484375,
0.039825439453125,
0.0026645660400390625,
0.0171356201171875,
-0.01763916015625,
0.00827789306640625,
0.060943603515625,
0.0062255859375,
-0.029693603515625,
0.01100921630859375,
0.038970947265625,
-0.0214691162109375,
0.0089263916015625,
0.0077972412109375,
0.0192413330078125,
-0.032989501953125,
-0.0038738250732421875,
0.056732177734375,
0.063720703125,
0.02789306640625,
0.040374755859375,
-0.043853759765625,
-0.020965576171875,
0.0004220008850097656,
-0.032989501953125,
-0.05914306640625,
-0.0211181640625,
0.04205322265625,
0.049530029296875,
-0.0306854248046875,
-0.03448486328125,
-0.00318145751953125,
-0.01200103759765625,
-0.03839111328125,
0.0089569091796875,
-0.0177764892578125,
-0.054351806640625,
-0.011322021484375,
0.0158538818359375,
0.0271759033203125,
0.00475311279296875,
-0.0154266357421875,
-0.01436614990234375,
-0.01024627685546875,
0.0086822509765625,
0.0178070068359375,
-0.0258941650390625,
0.03704833984375,
0.041534423828125,
-0.00897216796875,
-0.0165252685546875,
-0.0303192138671875,
-0.00424957275390625,
-0.019989013671875,
0.000013113021850585938,
-0.0016908645629882812,
0.0338134765625,
-0.0345458984375,
0.030303955078125,
-0.053314208984375,
0.0287628173828125,
-0.05743408203125,
0.006839752197265625,
0.047454833984375,
0.031280517578125,
0.037200927734375,
-0.016754150390625,
-0.0294647216796875,
-0.04827880859375,
-0.0408935546875,
-0.0150604248046875,
-0.018798828125,
0.0229949951171875,
-0.0282135009765625,
0.003261566162109375,
-0.036285400390625,
-0.007232666015625,
0.0015993118286132812,
0.062103271484375,
0.005046844482421875,
0.06964111328125,
-0.01194000244140625,
0.0443115234375,
0.0300750732421875,
0.039306640625,
0.038177490234375,
0.0288543701171875,
-0.012542724609375,
-0.036529541015625,
-0.01531219482421875,
-0.051025390625,
0.0267181396484375,
0.00899505615234375,
0.031768798828125,
0.00275421142578125,
-0.011505126953125,
0.018768310546875,
0.029815673828125,
0.0167999267578125,
0.002044677734375,
-0.005931854248046875,
0.01332855224609375,
0.0030078887939453125,
0.01580810546875,
0.03863525390625,
-0.0399169921875,
0.00524139404296875,
-0.0017900466918945312,
-0.0092010498046875,
0.0401611328125,
-0.045074462890625,
0.01441192626953125,
0.0545654296875,
-0.06964111328125,
0.0689697265625,
0.04241943359375,
-0.016937255859375,
0.00760650634765625,
-0.020599365234375,
-0.03594970703125,
0.01349639892578125,
0.0196380615234375,
-0.004184722900390625,
-0.047698974609375,
0.053009033203125,
0.017486572265625,
-0.0110626220703125,
0.065673828125,
-0.0152130126953125,
-0.00827789306640625,
0.0023860931396484375,
0.042755126953125,
0.01128387451171875,
-0.00823974609375,
0.015289306640625,
-0.028656005859375,
-0.0073394775390625,
-0.002796173095703125,
0.00214385986328125,
0.0018377304077148438,
-0.00933074951171875,
-0.0156402587890625,
-0.05047607421875,
-0.01303863525390625,
-0.01751708984375,
-0.02545166015625,
0.00325775146484375,
0.0157623291015625,
0.00041675567626953125,
-0.011260986328125,
-0.0213165283203125,
0.004261016845703125,
-0.0016355514526367188,
0.036163330078125,
0.0382080078125,
-0.031463623046875,
-0.020050048828125,
-0.039764404296875,
-0.03619384765625,
-0.02044677734375,
-0.0635986328125,
-0.0015840530395507812,
0.0222015380859375,
0.0477294921875,
0.0279388427734375,
0.01398468017578125,
-0.0247650146484375,
-0.00975799560546875,
0.028106689453125,
-0.03607177734375,
-0.034759521484375,
0.003429412841796875,
0.029022216796875,
-0.0457763671875,
0.042144775390625,
-0.0157623291015625,
-0.015838623046875,
0.0001773834228515625,
-0.049468994140625,
0.036468505859375,
-0.0052032470703125,
-0.02264404296875,
0.031341552734375,
-0.01328277587890625,
-0.011016845703125,
-0.01152801513671875,
0.0460205078125,
-0.06719970703125,
-0.06256103515625,
-0.0080718994140625,
-0.08404541015625,
-0.042236328125,
-0.0635986328125,
-0.0694580078125,
0.1527099609375,
-0.004055023193359375,
0.050140380859375,
0.01331329345703125,
0.0491943359375,
-0.027252197265625,
0.035186767578125,
-0.0260009765625,
-0.0010156631469726562,
0.002567291259765625,
-0.036102294921875,
-0.0311431884765625,
-0.0195465087890625,
-0.043914794921875,
0.0301666259765625,
-0.0293731689453125,
-0.006557464599609375,
-0.01058197021484375,
0.013916015625,
0.046295166015625,
0.00023794174194335938,
0.0102081298828125,
0.04486083984375,
0.0206451416015625,
0.04302978515625,
0.078857421875,
-0.039154052734375,
0.034515380859375,
-0.010284423828125,
0.00511932373046875,
0.03680419921875,
0.027801513671875,
0.0226898193359375,
0.03668212890625,
0.0168609619140625,
-0.014739990234375,
0.01125335693359375,
0.027008056640625,
-0.033538818359375,
0.0186309814453125,
0.0296630859375,
0.0027713775634765625,
0.0133209228515625,
-0.0086212158203125,
-0.0117340087890625,
0.0261688232421875,
-0.029632568359375,
-0.0016393661499023438,
0.03424072265625,
0.01013946533203125,
0.00738525390625,
0.01507568359375,
-0.0010442733764648438,
-0.00591278076171875,
0.032440185546875,
-0.02398681640625,
0.0032024383544921875,
0.00460052490234375,
-0.02044677734375,
0.047698974609375,
0.0450439453125,
-0.004726409912109375,
-0.02294921875,
-0.0116119384765625,
0.006534576416015625,
-0.0078582763671875,
-0.0203399658203125,
-0.0232391357421875,
0.005870819091796875,
-0.01219940185546875,
-0.006847381591796875,
-0.038787841796875,
0.01215362548828125,
0.022003173828125,
0.0171966552734375,
-0.0166168212890625,
-0.001537322998046875,
-0.013427734375,
0.017120361328125,
-0.0169525146484375,
-0.0204315185546875,
0.023193359375,
0.051849365234375,
0.01055908203125,
0.0394287109375,
-0.00716400146484375,
-0.023406982421875,
-0.03289794921875,
0.010040283203125,
0.024078369140625,
0.0190277099609375,
-0.0102386474609375,
0.0229339599609375,
0.0047149658203125,
0.01654052734375,
0.0168914794921875,
0.04180908203125,
0.041229248046875,
0.0322265625,
-0.00997161865234375,
0.00283050537109375,
0.01446533203125,
-0.0219879150390625,
-0.051605224609375,
-0.01175689697265625,
-0.01390838623046875,
0.04144287109375,
-0.0006971359252929688,
0.04827880859375,
-0.01520538330078125,
0.0396728515625,
-0.0094146728515625,
0.06854248046875,
-0.0016918182373046875,
0.0009045600891113281,
-0.0015277862548828125,
0.0094757080078125,
0.0462646484375,
0.035675048828125,
-0.08453369140625,
-0.035369873046875,
0.027557373046875,
-0.041717529296875,
0.02178955078125,
0.032867431640625,
-0.07281494140625,
0.06707763671875,
0.005100250244140625,
-0.001495361328125,
0.0142059326171875,
-0.01549530029296875,
0.0108184814453125,
-0.0056610107421875,
0.0152587890625,
-0.0009889602661132812,
0.0090789794921875,
0.026123046875,
0.029052734375,
-0.00902557373046875,
-0.0052032470703125,
0.0048065185546875,
-0.0033016204833984375,
0.00762176513671875,
0.0018291473388671875,
-0.0117340087890625,
-0.0107421875,
0.0031261444091796875,
-0.031951904296875,
-0.027801513671875,
0.004909515380859375,
0.014404296875,
0.01087188720703125,
0.0574951171875,
-0.0131683349609375,
0.00592041015625,
0.03143310546875,
-0.039306640625,
0.0006556510925292969,
0.032958984375,
0.046722412109375,
-0.0236968994140625,
-0.03594970703125,
-0.03497314453125,
-0.0153656005859375,
0.024658203125,
0.0235595703125,
-0.010650634765625,
0.02886962890625,
0.010284423828125,
-0.010467529296875,
0.02069091796875,
-0.0263824462890625,
0.0179290771484375,
0.034027099609375,
-0.0126495361328125,
0.01259613037109375,
0.0182952880859375,
-0.00714111328125,
0.01373291015625,
0.0240631103515625,
0.0020732879638671875,
0.0253143310546875,
-0.0345458984375,
0.036865234375,
0.01120758056640625,
0.002780914306640625,
-0.037200927734375,
-0.0227203369140625,
0.046966552734375,
-0.0297393798828125,
-0.0031566619873046875,
-0.03759765625,
-0.02978515625,
-0.06463623046875,
0.005748748779296875,
0.04144287109375,
-0.0290374755859375,
0.006412506103515625,
-0.034332275390625,
0.029144287109375,
0.02813720703125,
-0.010711669921875,
-0.031097412109375,
-0.0017604827880859375,
-0.023895263671875,
0.07110595703125,
-0.005649566650390625,
0.0239105224609375,
-0.0083770751953125,
-0.00014209747314453125,
-0.06024169921875,
-0.05072021484375,
-0.05084228515625,
0.01541900634765625,
-0.056243896484375,
0.0164642333984375,
0.0225372314453125,
-0.0196685791015625,
-0.0235137939453125,
-0.0070343017578125,
0.00608062744140625,
0.052215576171875,
0.039825439453125,
-0.03839111328125,
0.0101470947265625,
0.0101318359375,
0.0104217529296875,
-0.0156402587890625,
-0.0013895034790039062,
-0.0184326171875,
-0.004878997802734375,
-0.033660888671875,
-0.003818511962890625,
-0.01220703125,
-0.049163818359375,
-0.0748291015625,
0.040191650390625,
-0.00616455078125,
-0.02716064453125,
-0.0197601318359375,
0.023040771484375,
-0.031646728515625,
0.07879638671875,
0.018707275390625,
-0.03387451171875,
0.01519775390625,
0.0050048828125,
0.01073455810546875,
-0.020172119140625,
0.0156097412109375,
0.00969696044921875,
-0.10260009765625,
-0.01337432861328125,
-0.025543212890625,
0.00800323486328125,
0.01372528076171875,
-0.0099334716796875,
-0.016815185546875,
0.00659942626953125,
-0.07098388671875,
-0.08123779296875,
-0.0523681640625,
0.043853759765625,
-0.00469970703125,
-0.03656005859375,
-0.0163116455078125,
-0.0188751220703125,
0.043212890625,
0.044464111328125,
0.005321502685546875,
-0.0191497802734375,
0.007732391357421875,
-0.005992889404296875,
0.006683349609375,
-0.010467529296875,
-0.0011320114135742188,
-0.04486083984375,
-0.02276611328125,
0.0034923553466796875,
0.0126953125,
-0.03466796875,
0.00550079345703125,
-0.0019369125366210938,
-0.0394287109375,
0.024810791015625,
-0.007602691650390625,
-0.00972747802734375,
-0.00478363037109375,
0.09429931640625,
-0.045867919921875,
0.010162353515625,
-0.0016040802001953125,
0.0189208984375,
0.057464599609375,
-0.006191253662109375,
0.0111846923828125,
0.0026340484619140625,
-0.0308837890625,
0.0207061767578125,
0.00891876220703125,
0.040252685546875,
-0.036529541015625,
-0.01776123046875,
0.002933502197265625,
0.002353668212890625,
-0.002788543701171875,
0.0095977783203125,
-0.0206298828125,
0.007801055908203125,
-0.01326751708984375,
0.0182342529296875,
-0.06292724609375,
-0.029083251953125,
-0.02691650390625,
-0.0211334228515625,
-0.0010986328125,
0.036285400390625,
0.08465576171875,
-0.029266357421875,
0.01311492919921875,
0.00763702392578125,
-0.06402587890625,
0.008087158203125,
-0.004352569580078125,
-0.0113525390625,
-0.033782958984375,
-0.0120086669921875
] |
18c7eb75bc2270f3e1a6540bb2b324044dd7587c
|
Wordpress Stackexchange
Q: How do I make my wordpress page more friendly for mobile viewers? My basic question is How do I make my wordpress page more friendly for mobile viewers?
I have seen some answers such as wptouch, wordpress mobile pack, and mobilepress http ://wordpress.org/extend/plugins/mobilepress/ .
All great, however I enjoy my theme and was wondering if there is a way to not-autoload images, and if there are some more versatile themes which can scale to smaller screens.
Thank you in advance for your help.
A: You probably refer to Responsive themes that are appropriate for both desktops, tablets, mobile phones. This requires some CSS and markup alterations (actually a bit of work and testing) so that a theme looks good in any device including portrait or landscape view in mobile devices.
Unless you want to use a mobile plugin, there are lots of premium themes in markets such as ThemeForest or the Responsive free theme from WPORG repo.
|
Q: How do I make my wordpress page more friendly for mobile viewers? My basic question is How do I make my wordpress page more friendly for mobile viewers?
I have seen some answers such as wptouch, wordpress mobile pack, and mobilepress http ://wordpress.org/extend/plugins/mobilepress/ .
All great, however I enjoy my theme and was wondering if there is a way to not-autoload images, and if there are some more versatile themes which can scale to smaller screens.
Thank you in advance for your help.
A: You probably refer to Responsive themes that are appropriate for both desktops, tablets, mobile phones. This requires some CSS and markup alterations (actually a bit of work and testing) so that a theme looks good in any device including portrait or landscape view in mobile devices.
Unless you want to use a mobile plugin, there are lots of premium themes in markets such as ThemeForest or the Responsive free theme from WPORG repo.
A: I believe for the most part it is all theme related. The best one I've used is Weaver II which you can try out for free here: http://weavertheme.com/ comes with a mobile version with the theme download I believe. There is a Pro version as well that you can check out here: http://pro.weavertheme.com/
A: As far as the not autoloading images goes, there was some discussion on this topic over at http://reddit.com/r/wordpress a few weeks ago.
Check out the post here: http://www.reddit.com/r/Wordpress/comments/ucy8k/responsive_images_for_wordpress_opinions_ides/
|
wordpress
|
{
"language": "en",
"length": 241,
"provenance": "stackexchange_00019.jsonl.gz:420844",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55248"
}
|
[
0.020751953125,
0.0184478759765625,
0.0055084228515625,
0.02850341796875,
0.024169921875,
-0.029144287109375,
0.056549072265625,
-0.054595947265625,
-0.0129852294921875,
-0.002864837646484375,
-0.0638427734375,
0.026336669921875,
-0.0287322998046875,
-0.00455474853515625,
0.022064208984375,
-0.05340576171875,
0.01953125,
-0.052154541015625,
-0.0126953125,
-0.013214111328125,
0.007259368896484375,
-0.0202178955078125,
0.0479736328125,
0.03619384765625,
0.0150299072265625,
-0.03045654296875,
0.057647705078125,
-0.00818634033203125,
0.0034618377685546875,
-0.017303466796875,
0.0269927978515625,
-0.0026493072509765625,
0.0026493072509765625,
0.0299072265625,
-0.0226287841796875,
0.0006771087646484375,
0.0294952392578125,
-0.0009202957153320312,
0.01288604736328125,
0.04681396484375,
-0.019378662109375,
0.0185546875,
0.0198822021484375,
-0.0005788803100585938,
-0.009613037109375,
-0.04571533203125,
-0.00948333740234375,
-0.047088623046875,
-0.0167236328125,
-0.07061767578125,
0.0208892822265625,
0.01605224609375,
0.053009033203125,
-0.01204681396484375,
-0.0180511474609375,
0.0022525787353515625,
-0.0218505859375,
-0.02557373046875,
0.01947021484375,
-0.0186004638671875,
0.0059051513671875,
-0.01030731201171875,
0.0209503173828125,
0.0133056640625,
-0.051116943359375,
-0.016204833984375,
-0.0556640625,
0.0256805419921875,
-0.0269775390625,
-0.059173583984375,
0.004802703857421875,
-0.0277252197265625,
-0.005397796630859375,
-0.0163421630859375,
-0.035125732421875,
0.001049041748046875,
0.0210723876953125,
0.003292083740234375,
0.0215606689453125,
-0.00839996337890625,
-0.020355224609375,
-0.00893402099609375,
-0.01776123046875,
-0.047271728515625,
0.025665283203125,
-0.006313323974609375,
-0.00600433349609375,
0.0002567768096923828,
-0.031494140625,
0.0092315673828125,
-0.027191162109375,
-0.01407623291015625,
-0.046905517578125,
0.04302978515625,
0.0020465850830078125,
0.01094818115234375,
0.0005817413330078125,
-0.0013065338134765625,
0.00005918741226196289,
0.008087158203125,
-0.0014925003051757812,
-0.044647216796875,
0.0242919921875,
-0.0189971923828125,
0.0016107559204101562,
0.0797119140625,
0.0137176513671875,
0.06414794921875,
0.03863525390625,
0.0058746337890625,
0.04486083984375,
0.0259857177734375,
0.00771331787109375,
0.036376953125,
-0.035400390625,
-0.007091522216796875,
-0.0294647216796875,
0.013214111328125,
-0.035064697265625,
0.05059814453125,
-0.01123809814453125,
0.030364990234375,
-0.01491546630859375,
-0.006031036376953125,
0.024871826171875,
0.0169830322265625,
0.00917816162109375,
-0.039459228515625,
-0.040374755859375,
0.02294921875,
-0.00922393798828125,
0.00946807861328125,
-0.010467529296875,
0.0155792236328125,
-0.017852783203125,
-0.0233306884765625,
-0.006771087646484375,
-0.02093505859375,
-0.0298919677734375,
0.0272064208984375,
-0.01165008544921875,
-0.048828125,
0.0031585693359375,
-0.0167388916015625,
0.0616455078125,
-0.0022144317626953125,
0.0043792724609375,
0.042022705078125,
0.03912353515625,
-0.00634002685546875,
0.049041748046875,
-0.008056640625,
0.0242767333984375,
0.0177154541015625,
0.016082763671875,
-0.01389312744140625,
0.048858642578125,
-0.04144287109375,
-0.0055694580078125,
-0.048736572265625,
0.0144500732421875,
0.03302001953125,
0.080322265625,
0.0026416778564453125,
-0.01092529296875,
-0.038055419921875,
-0.05865478515625,
-0.0191497802734375,
0.02667236328125,
-0.014862060546875,
0.036895751953125,
-0.01018524169921875,
0.052398681640625,
0.00839996337890625,
-0.00565338134765625,
0.0213165283203125,
-0.0170135498046875,
0.024322509765625,
0.04595947265625,
-0.0026760101318359375,
-0.0025196075439453125,
-0.031463623046875,
0.0777587890625,
-0.0214385986328125,
-0.006282806396484375,
0.0137176513671875,
-0.003604888916015625,
0.01541900634765625,
-0.016693115234375,
0.02313232421875,
-0.0308380126953125,
0.04205322265625,
-0.042572021484375,
0.037078857421875,
0.001255035400390625,
-0.0264434814453125,
-0.0026397705078125,
-0.0017375946044921875,
-0.0118865966796875,
0.00040912628173828125,
-0.003520965576171875,
-0.024444580078125,
-0.007659912109375,
0.00787353515625,
-0.0253753662109375,
-0.033355712890625,
-0.01364898681640625,
0.0136871337890625,
0.061370849609375,
0.0458984375,
-0.02008056640625,
0.007228851318359375,
0.005397796630859375,
-0.038055419921875,
-0.034912109375,
0.0137786865234375,
0.01044464111328125,
0.04266357421875,
0.0059356689453125,
-0.00988006591796875,
0.029754638671875,
-0.04931640625,
0.0305023193359375,
0.04815673828125,
0.0261688232421875,
0.0004401206970214844,
-0.035614013671875,
-0.01552581787109375,
-0.0165557861328125,
0.001140594482421875,
-0.045440673828125,
0.083740234375,
-0.01290130615234375,
0.015380859375,
0.0250091552734375,
-0.003276824951171875,
0.0307159423828125,
-0.08050537109375,
0.0250091552734375,
0.0275421142578125,
0.0223236083984375,
0.034423828125,
-0.0198974609375,
0.0286407470703125,
0.053466796875,
-0.04949951171875,
-0.013671875,
0.038970947265625,
0.003826141357421875,
-0.0159759521484375,
0.00039386749267578125,
-0.060516357421875,
0.03558349609375,
-0.090087890625,
-0.0246429443359375,
0.034271240234375,
-0.00579071044921875,
0.049072265625,
-0.049224853515625,
0.0204620361328125,
-0.029815673828125,
-0.004093170166015625,
0.01198577880859375,
-0.0222320556640625,
0.0082550048828125,
-0.02984619140625,
0.0057830810546875,
-0.0114898681640625,
-0.01067352294921875,
-0.0085906982421875,
0.0222930908203125,
-0.0229949951171875,
0.0089874267578125,
0.02117919921875,
0.006458282470703125,
0.0251312255859375,
-0.006999969482421875,
-0.01275634765625,
0.0000928640365600586,
0.01727294921875,
-0.038818359375,
-0.0263671875,
-0.04071044921875,
0.0026226043701171875,
-0.00836944580078125,
-0.049041748046875,
0.03277587890625,
0.0221710205078125,
-0.0271453857421875,
0.0322265625,
0.036468505859375,
0.0687255859375,
0.00962066650390625,
0.015655517578125,
0.00556182861328125,
0.037750244140625,
0.017974853515625,
-0.04486083984375,
0.04888916015625,
-0.055328369140625,
0.042449951171875,
0.07000732421875,
-0.04327392578125,
0.035064697265625,
-0.0231170654296875,
0.055084228515625,
-0.00862884521484375,
-0.004070281982421875,
-0.0212860107421875,
-0.021514892578125,
-0.0374755859375,
-0.03448486328125,
0.01375579833984375,
0.0162506103515625,
-0.017852783203125,
-0.014495849609375,
-0.0187835693359375,
-0.0021762847900390625,
-0.04742431640625,
-0.033538818359375,
0.039886474609375,
-0.03509521484375,
-0.0236053466796875,
0.0296783447265625,
-0.0276336669921875,
-0.029296875,
0.06402587890625,
-0.0200347900390625,
-0.036346435546875,
-0.0270538330078125,
-0.057037353515625,
-0.061798095703125,
-0.0711669921875,
0.02874755859375,
-0.0131378173828125,
0.0240936279296875,
0.0022182464599609375,
0.0086822509765625,
0.0028438568115234375,
-0.0017290115356445312,
-0.002162933349609375,
0.0035152435302734375,
0.017578125,
-0.037017822265625,
0.026641845703125,
-0.047882080078125,
-0.0258636474609375,
0.0005426406860351562,
-0.01502227783203125,
0.006038665771484375,
-0.0044403076171875,
-0.004924774169921875,
-0.03497314453125,
-0.0191802978515625,
-0.02935791015625,
0.014739990234375,
0.042755126953125,
-0.01849365234375,
-0.02587890625,
-0.048675537109375,
-0.008575439453125,
0.0006327629089355469,
-0.041534423828125,
0.011016845703125,
0.00766754150390625,
-0.0279388427734375,
0.004344940185546875,
0.0023040771484375,
0.03192138671875,
0.0103607177734375,
-0.0168914794921875,
-0.009185791015625,
0.02764892578125,
0.0290069580078125,
0.059783935546875,
-0.0027713775634765625,
-0.0230560302734375,
-0.034088134765625,
0.021209716796875,
-0.042449951171875,
-0.00007259845733642578,
-0.0295867919921875,
0.03961181640625,
-0.05828857421875,
-0.03167724609375,
0.03875732421875,
-0.0173797607421875,
0.0418701171875,
-0.04315185546875,
-0.02398681640625,
-0.021087646484375,
0.0947265625,
-0.013153076171875,
-0.005306243896484375,
0.0187225341796875,
0.013702392578125,
-0.0223236083984375,
-0.00846099853515625,
-0.0574951171875,
-0.01751708984375,
-0.050079345703125,
-0.00852203369140625,
-0.0059661865234375,
-0.025390625,
-0.0272216796875,
0.02520751953125,
-0.0257568359375,
-0.028045654296875,
0.036407470703125,
-0.00467681884765625,
-0.04095458984375,
0.0195465087890625,
-0.02532958984375,
-0.034515380859375,
-0.0189056396484375,
0.005245208740234375,
-0.059906005859375,
-0.0240631103515625,
-0.005817413330078125,
0.07684326171875,
0.015655517578125,
-0.0133209228515625,
-0.0260772705078125,
0.0333251953125,
0.00521087646484375,
0.01611328125,
-0.007251739501953125,
-0.0214691162109375,
0.0115203857421875,
0.068115234375,
0.038238525390625,
0.0148468017578125,
0.019683837890625,
-0.004207611083984375,
-0.043670654296875,
0.00490570068359375,
-0.0239105224609375,
0.0159454345703125,
0.0058746337890625,
-0.02972412109375,
0.01387786865234375,
-0.038848876953125,
-0.029296875,
0.046630859375,
-0.00783538818359375,
0.008148193359375,
-0.072021484375,
-0.039154052734375,
0.02569580078125,
0.0220184326171875,
0.0045623779296875,
0.01092529296875,
0.0841064453125,
0.014434814453125,
-0.0220794677734375,
-0.03558349609375,
0.007114410400390625,
0.035675048828125,
0.04583740234375,
-0.00980377197265625,
0.006927490234375,
-0.0299835205078125,
0.024383544921875,
0.034332275390625,
-0.035064697265625,
0.01467132568359375,
0.0570068359375,
0.00283050537109375,
-0.033721923828125,
0.0201416015625,
-0.025115966796875,
-0.01256561279296875,
0.0030956268310546875,
0.0020465850830078125,
-0.01953125,
0.005084991455078125,
0.029998779296875,
-0.0005960464477539062,
0.0212249755859375,
-0.0137176513671875,
-0.0343017578125,
0.002685546875,
0.021087646484375,
0.0223388671875,
-0.0185699462890625,
0.018768310546875,
0.01038360595703125,
0.0307769775390625,
-0.0035190582275390625,
-0.020538330078125,
-0.0169525146484375,
-0.0195465087890625,
0.022125244140625,
0.0207366943359375,
0.004276275634765625,
-0.0031604766845703125,
-0.00432586669921875,
0.0134124755859375,
0.016387939453125,
-0.0311737060546875,
-0.0220794677734375,
0.00023055076599121094,
0.00830078125,
-0.003208160400390625,
-0.00499725341796875,
0.06927490234375,
0.03033447265625,
-0.0299072265625,
-0.0165863037109375,
-0.01551055908203125,
-0.0228118896484375,
-0.07550048828125,
-0.057098388671875,
-0.0278472900390625,
-0.0160675048828125,
0.0389404296875,
-0.01158905029296875,
-0.00331878662109375,
0.01397705078125,
-0.00982666015625,
0.0182647705078125,
0.037322998046875,
0.0222320556640625,
0.01507568359375,
-0.0010709762573242188,
-0.0175323486328125,
0.00957489013671875,
0.0091400146484375,
-0.005859375,
-0.025299072265625,
0.00896453857421875,
0.0081787109375,
-0.02685546875,
0.0098876953125,
0.02227783203125,
-0.007282257080078125,
-0.00832366943359375,
0.001476287841796875,
-0.058349609375,
-0.05975341796875,
-0.015869140625,
0.022430419921875,
0.033294677734375,
-0.0258331298828125,
-0.004608154296875,
0.03179931640625,
0.004734039306640625,
0.032562255859375,
0.029876708984375,
-0.0008673667907714844,
-0.0179290771484375,
-0.0206146240234375,
-0.007465362548828125,
0.0006451606750488281,
-0.029205322265625,
-0.053497314453125,
-0.0576171875,
0.01025390625,
0.022369384765625,
0.02679443359375,
-0.0075531005859375,
0.00019216537475585938,
-0.01418304443359375,
-0.00897216796875,
-0.02752685546875,
0.01189422607421875,
-0.006053924560546875,
-0.0242156982421875,
-0.039886474609375,
-0.012847900390625,
-0.08050537109375,
-0.03839111328125,
-0.1031494140625,
-0.061370849609375,
-0.063232421875,
0.01505279541015625,
0.0132598876953125,
0.00360870361328125,
-0.03948974609375,
-0.05316162109375,
-0.0176544189453125,
0.045013427734375,
0.047454833984375,
0.054534912109375,
-0.0154571533203125,
0.03314208984375,
0.032196044921875,
0.00811767578125,
0.027435302734375,
0.040435791015625,
0.0230865478515625,
-0.0440673828125,
0.00942230224609375,
-0.055206298828125,
-0.040374755859375,
0.01551055908203125,
-0.04364013671875,
0.0078125,
-0.007732391357421875,
0.000980377197265625,
0.0191650390625,
-0.05340576171875,
-0.0181427001953125,
-0.0301666259765625,
0.06494140625,
-0.07373046875,
0.052459716796875,
-0.029571533203125,
-0.025787353515625,
-0.025115966796875,
0.007381439208984375,
-0.005260467529296875,
-0.00982666015625,
0.016937255859375,
-0.0206298828125,
0.005859375,
-0.0357666015625,
0.06396484375,
0.08770751953125,
-0.0172119140625,
0.0360107421875,
0.03619384765625,
0.0057220458984375,
0.02178955078125,
0.0311279296875,
-0.007720947265625,
-0.01151275634765625,
0.0243682861328125,
-0.00373077392578125,
-0.026885986328125,
-0.0213623046875,
-0.03302001953125,
0.0033245086669921875,
0.0633544921875,
0.043670654296875,
-0.054595947265625,
-0.004047393798828125,
0.02001953125,
-0.00708770751953125,
-0.01617431640625,
-0.020477294921875,
0.0017366409301757812,
-0.0223388671875,
0.055084228515625,
-0.042266845703125,
-0.0210723876953125,
0.00806427001953125,
-0.030548095703125,
-0.01120758056640625,
0.01351165771484375,
0.06146240234375,
0.0265960693359375,
-0.044219970703125,
-0.00653839111328125,
0.0304107666015625,
-0.0127410888671875,
0.016510009765625,
-0.0018939971923828125,
-0.032745361328125,
-0.040283203125,
-0.055908203125,
-0.055389404296875,
-0.03570556640625,
-0.0236663818359375,
0.0240936279296875,
0.03460693359375,
-0.050018310546875,
0.036529541015625,
-0.021240234375,
0.03912353515625,
-0.01605224609375,
-0.032318115234375,
0.06915283203125,
0.00341796875,
0.0283050537109375,
-0.0018091201782226562,
-0.057098388671875,
-0.01065826416015625,
-0.034088134765625,
0.0230865478515625,
-0.014923095703125,
-0.05706787109375,
0.063232421875,
-0.00406646728515625,
-0.005954742431640625,
0.061065673828125,
-0.01261138916015625,
-0.0589599609375,
0.006122589111328125,
0.0321044921875,
0.0014743804931640625,
0.02301025390625,
0.011016845703125,
0.01348114013671875,
-0.00809478759765625,
0.008026123046875,
-0.06396484375,
-0.007598876953125,
-0.03857421875,
0.04071044921875,
0.02081298828125,
-0.01482391357421875,
0.004383087158203125,
-0.03460693359375,
-0.0098876953125,
0.0322265625,
0.0189208984375,
-0.01004791259765625,
-0.0199127197265625,
-0.0014095306396484375,
-0.01303863525390625,
0.0127105712890625,
-0.0243377685546875,
-0.0152587890625,
-0.036407470703125,
0.004550933837890625,
0.06390380859375,
0.07470703125,
0.0579833984375,
0.01413726806640625,
-0.0187530517578125,
-0.0283050537109375,
-0.0088653564453125,
-0.020751953125,
0.01342010498046875,
-0.005046844482421875,
-0.032135009765625,
0.005279541015625,
0.026336669921875,
0.01837158203125,
-0.0029735565185546875,
0.00228118896484375,
-0.0135345458984375,
-0.00738525390625,
0.025238037109375,
-0.02032470703125,
0.051788330078125,
-0.0094451904296875,
0.022216796875,
-0.05511474609375,
0.015594482421875,
-0.01910400390625,
0.042205810546875,
-0.029205322265625,
0.01482391357421875,
0.038116455078125,
0.015655517578125,
0.023590087890625,
0.03125,
0.0145721435546875,
0.025787353515625,
0.0008463859558105469,
0.0279693603515625,
-0.00199127197265625,
0.0212249755859375,
-0.09002685546875,
-0.05908203125,
0.0253448486328125,
0.06573486328125,
-0.0111846923828125,
-0.043701171875,
0.017425537109375,
0.006000518798828125,
0.002185821533203125,
-0.012908935546875,
0.0189361572265625,
-0.0755615234375,
-0.02545166015625,
0.0228424072265625,
-0.005802154541015625,
0.0372314453125,
-0.0179901123046875,
0.0178985595703125,
0.023223876953125,
0.004589080810546875,
0.03863525390625,
0.009368896484375,
-0.008026123046875,
0.0426025390625,
-0.038543701171875,
-0.038299560546875,
0.0237884521484375,
0.06683349609375,
0.034759521484375,
-0.0088043212890625,
0.037384033203125,
0.0147247314453125,
0.01155853271484375,
0.01276397705078125,
-0.00919342041015625,
0.01457977294921875,
0.01261138916015625,
-0.038299560546875,
0.00894927978515625,
0.032379150390625,
0.0592041015625,
-0.0170440673828125,
-0.024169921875,
0.039581298828125,
-0.013641357421875,
-0.0222625732421875,
-0.022125244140625,
0.007678985595703125,
0.04498291015625,
0.00106048583984375,
-0.0014390945434570312,
0.00557708740234375,
0.07177734375,
-0.021209716796875,
0.0243682861328125,
-0.003627777099609375,
-0.0273590087890625,
0.035888671875,
-0.038909912109375,
0.024200439453125,
-0.005245208740234375,
-0.0709228515625,
0.0004658699035644531,
-0.061126708984375,
-0.036041259765625,
0.0439453125,
0.0303802490234375,
-0.041839599609375,
0.03680419921875,
0.00998687744140625,
0.0250091552734375,
-0.01812744140625,
-0.007770538330078125,
-0.00018846988677978516,
-0.00981903076171875,
0.042236328125,
0.0087890625,
-0.042449951171875,
-0.034149169921875,
-0.033721923828125,
0.05584716796875,
-0.022796630859375,
0.140625,
-0.07232666015625,
0.00860595703125,
-0.0168609619140625,
-0.042877197265625,
0.0203094482421875,
-0.01496124267578125,
-0.00689697265625,
0.01837158203125,
-0.025054931640625,
-0.004199981689453125,
-0.01219940185546875,
0.02862548828125,
0.01468658447265625,
-0.035003662109375,
0.025665283203125,
-0.0136566162109375,
-0.00594329833984375,
-0.031951904296875,
-0.01430511474609375,
-0.046234130859375,
-0.051544189453125,
-0.03936767578125,
0.02203369140625,
-0.00968170166015625,
-0.0428466796875,
-0.046356201171875,
0.03125,
0.022918701171875,
-0.008331298828125,
0.017822265625,
-0.00962066650390625,
0.03143310546875,
0.035675048828125,
-0.006500244140625,
-0.0279083251953125,
0.0279541015625,
-0.01611328125,
0.0092010498046875,
0.003467559814453125,
0.032806396484375,
0.0214080810546875,
-0.049652099609375,
0.0158233642578125,
0.017730712890625,
0.03143310546875,
-0.034149169921875,
-0.006561279296875,
0.00839996337890625,
0.008026123046875,
0.0162353515625,
0.026031494140625,
-0.0099029541015625,
-0.0175018310546875,
-0.0343017578125,
0.00803375244140625,
-0.0251617431640625,
-0.0166473388671875,
-0.0248565673828125,
0.0186767578125,
0.0287322998046875,
0.01421356201171875,
-0.065673828125,
0.03363037109375,
-0.0135650634765625,
0.06121826171875,
-0.0163116455078125,
0.004718780517578125,
-0.012664794921875,
0.00507354736328125,
-0.02191162109375,
-0.01419830322265625,
-0.038848876953125,
0.02203369140625,
-0.0269927978515625,
0.0272979736328125,
0.033111572265625,
-0.045379638671875,
0.03082275390625,
0.046112060546875,
0.05084228515625,
0.10296630859375,
0.004352569580078125,
-0.01291656494140625,
0.01413726806640625,
0.004497528076171875,
0.0017900466918945312,
-0.026519775390625,
-0.0157012939453125,
0.0031528472900390625,
0.007793426513671875,
-0.021270751953125,
-0.01318359375,
-0.01100921630859375,
-0.04742431640625,
-0.06549072265625,
0.031707763671875,
-0.0003120899200439453,
-0.04388427734375,
-0.06103515625,
0.007678985595703125,
0.00782012939453125,
-0.0163116455078125,
-0.00911712646484375,
-0.053741455078125,
-0.037933349609375,
0.023468017578125,
0.019256591796875,
0.0159912109375,
0.007434844970703125,
0.04998779296875,
-0.0263824462890625,
0.046661376953125,
0.022857666015625,
-0.021209716796875,
-0.0011539459228515625,
-0.006237030029296875,
-0.01751708984375,
0.0301361083984375,
-0.058319091796875,
-0.08062744140625,
-0.025970458984375,
0.027191162109375,
-0.01531982421875,
-0.0176849365234375,
0.006591796875,
-0.01326751708984375,
0.043060302734375,
0.026580810546875,
0.001544952392578125,
-0.0176239013671875,
0.006805419921875,
-0.013702392578125,
-0.0185546875,
0.0166473388671875,
0.0094451904296875,
-0.019439697265625,
0.0299530029296875,
0.01209259033203125,
-0.004016876220703125,
0.0009717941284179688,
-0.009735107421875,
-0.02642822265625,
-0.01073455810546875,
0.002643585205078125,
0.024261474609375,
-0.0738525390625,
-0.004016876220703125,
0.060150146484375,
-0.0260772705078125,
0.033660888671875,
0.00569915771484375,
0.01369476318359375,
0.05401611328125,
0.03369140625,
0.0117340087890625,
0.041107177734375,
-0.038543701171875,
-0.0030231475830078125,
0.0120849609375,
0.031158447265625,
-0.0233001708984375,
-0.008026123046875,
-0.01605224609375,
0.036163330078125,
0.00766754150390625,
0.07373046875,
-0.00487518310546875,
0.0031375885009765625,
0.0244140625,
-0.01318359375,
0.0004036426544189453,
-0.024200439453125,
-0.006988525390625,
0.037139892578125,
-0.01617431640625,
-0.036376953125,
0.0330810546875,
-0.07177734375,
0.0016813278198242188,
-0.0007996559143066406,
-0.051361083984375,
-0.027069091796875,
-0.0086669921875,
-0.031951904296875,
-0.03277587890625,
0.005023956298828125
] |
0e548f7d63458a7cda4915da219108796836f1f5
|
Wordpress Stackexchange
Q: Is there a default template file for child pages / subpages? This seems like a very simple question. I'm looking for something like sub-page.php or page-child.php where I can do some different things on the child pages of my theme.
They are different enough in design and content that I'm having to use a lot of php or the CSS .page-child class to do all the dirty work. I'm looking for a simpler method.
One caveat - I would like this to happen automatically so I don't have to tell the client "make sure to always select the 'subpage' template when you create a subpage!" which is precarious..
A: There is no specifica template for child pages, but you can do this pretty easily with the get_template_part() function.
First create a file called "content-child.php".
Second create a file called "content.php".
Next, inside of page.php, place this:
if( $post->post_parent !== 0 ) {
get_template_part('content', 'child');
} else {
get_template_part('content');
}
Anything that you want displayed on a child page will be placed inside of content-child.php. Anything you want displayed on non-child pages will be placed in content.php.
|
Q: Is there a default template file for child pages / subpages? This seems like a very simple question. I'm looking for something like sub-page.php or page-child.php where I can do some different things on the child pages of my theme.
They are different enough in design and content that I'm having to use a lot of php or the CSS .page-child class to do all the dirty work. I'm looking for a simpler method.
One caveat - I would like this to happen automatically so I don't have to tell the client "make sure to always select the 'subpage' template when you create a subpage!" which is precarious..
A: There is no specifica template for child pages, but you can do this pretty easily with the get_template_part() function.
First create a file called "content-child.php".
Second create a file called "content.php".
Next, inside of page.php, place this:
if( $post->post_parent !== 0 ) {
get_template_part('content', 'child');
} else {
get_template_part('content');
}
Anything that you want displayed on a child page will be placed inside of content-child.php. Anything you want displayed on non-child pages will be placed in content.php.
A: It's actually very easy, add follow code to your functions.php
add_filter(
'page_template',
function ($template) {
global $post;
if ($post->post_parent) {
// get top level parent page
$parent = get_post(
reset(array_reverse(get_post_ancestors($post->ID)))
);
// or ...
// when you need closest parent post instead
// $parent = get_post($post->post_parent);
$child_template = locate_template(
[
$parent->post_name . '/page-' . $post->post_name . '.php',
$parent->post_name . '/page-' . $post->ID . '.php',
$parent->post_name . '/page.php',
]
);
if ($child_template) return $child_template;
}
return $template;
}
);
Then you can prepare templates with following patterns:
*
*[parent-page-slug]/page.php
*[parent-page-slug]/page-[child-page-slug].php
*[parent-page-slug]/page-[child-post-id].php
A: My modification of OzzyCzech's solution above. This function looks in the theme's root directory for files who's name contains the parent's slug or parent's ID.
*
*/theme_root/child-PARENT_SLUG.php
*/theme_root/child-PARENT_ID.php
function child_templates($template) {
global $post;
if ($post->post_parent) {
// get top level parent page
$parent = get_post(
reset(array_reverse(get_post_ancestors($post->ID)))
);
// find the child template based on parent's slug or ID
$child_template = locate_template(
[
'child-' . $parent->post_name . '.php',
'child-' . $parent->ID . '.php',
'child.php',
]
);
if ($child_template) return $child_template;
}
return $template;
}
add_filter( 'page_template', 'child_templates' );
|
wordpress
|
{
"language": "en",
"length": 366,
"provenance": "stackexchange_00019.jsonl.gz:420858",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55301"
}
|
[
-0.004009246826171875,
-0.0192413330078125,
0.0081329345703125,
-0.0279693603515625,
-0.00806427001953125,
0.002651214599609375,
0.0120086669921875,
-0.01261138916015625,
-0.027008056640625,
-0.0027599334716796875,
-0.052398681640625,
0.003307342529296875,
-0.0457763671875,
-0.0015726089477539062,
0.004169464111328125,
-0.07171630859375,
0.0372314453125,
-0.0200042724609375,
0.0291900634765625,
0.0010128021240234375,
0.003635406494140625,
0.0209808349609375,
0.034423828125,
0.051666259765625,
0.0196380615234375,
-0.0274505615234375,
0.0222625732421875,
0.0013589859008789062,
0.0047454833984375,
-0.026397705078125,
0.01387786865234375,
0.0196380615234375,
0.0255889892578125,
0.0029811859130859375,
-0.01441192626953125,
-0.00441741943359375,
-0.01056671142578125,
0.0026798248291015625,
-0.01215362548828125,
0.031158447265625,
-0.0016183853149414062,
0.00614166259765625,
0.032318115234375,
0.0187530517578125,
-0.01386260986328125,
-0.00966644287109375,
-0.0007643699645996094,
-0.0291748046875,
0.017608642578125,
-0.0096893310546875,
0.02459716796875,
0.0164947509765625,
0.018707275390625,
-0.01515960693359375,
-0.0106964111328125,
0.00415802001953125,
-0.006946563720703125,
0.005489349365234375,
0.035003662109375,
-0.0263824462890625,
-0.036895751953125,
-0.006244659423828125,
0.0211334228515625,
0.00049591064453125,
0.01128387451171875,
-0.00894927978515625,
-0.022705078125,
0.035125732421875,
-0.02801513671875,
0.0216522216796875,
0.0224761962890625,
-0.03118896484375,
0.0231781005859375,
-0.06982421875,
0.0030727386474609375,
0.041168212890625,
-0.0180511474609375,
-0.01715087890625,
0.0198974609375,
-0.0367431640625,
-0.0301055908203125,
-0.0147705078125,
-0.0200958251953125,
-0.07330322265625,
0.03631591796875,
-0.038665771484375,
-0.018707275390625,
0.011871337890625,
-0.047607421875,
-0.0038776397705078125,
-0.033905029296875,
-0.0160980224609375,
0.006221771240234375,
-0.0255584716796875,
-0.040618896484375,
0.005634307861328125,
0.00801849365234375,
0.0592041015625,
-0.04229736328125,
0.032989501953125,
-0.0153350830078125,
-0.019683837890625,
0.0692138671875,
-0.06597900390625,
0.01061248779296875,
0.049163818359375,
-0.013458251953125,
-0.0018587112426757812,
0.035919189453125,
0.034698486328125,
0.024871826171875,
0.0126953125,
-0.00496673583984375,
-0.0269012451171875,
-0.03564453125,
0.017913818359375,
-0.01220703125,
-0.026885986328125,
0.00600433349609375,
-0.035980224609375,
0.0050811767578125,
0.022552490234375,
0.00737762451171875,
-0.046905517578125,
0.0215911865234375,
-0.0002760887145996094,
-0.035919189453125,
-0.02667236328125,
-0.02825927734375,
-0.0020008087158203125,
-0.034698486328125,
0.005950927734375,
0.08319091796875,
0.044525146484375,
0.014617919921875,
-0.01422119140625,
0.003582000732421875,
-0.00858306884765625,
0.0213775634765625,
-0.00830078125,
-0.01480865478515625,
-0.021636962890625,
0.0281982421875,
0.006298065185546875,
-0.01861572265625,
0.01947021484375,
0.00799560546875,
0.031890869140625,
0.0035228729248046875,
-0.02276611328125,
0.0204315185546875,
-0.03680419921875,
0.02447509765625,
-0.0176849365234375,
-0.0017547607421875,
-0.057708740234375,
-0.047027587890625,
0.0010967254638671875,
0.0263214111328125,
-0.0121307373046875,
-0.0108642578125,
-0.0031642913818359375,
0.025299072265625,
-0.037353515625,
-0.045928955078125,
0.0080108642578125,
-0.031402587890625,
-0.0102081298828125,
0.0079345703125,
-0.052398681640625,
0.020477294921875,
-0.036590576171875,
-0.05841064453125,
-0.00848388671875,
0.016387939453125,
0.036956787109375,
-0.0240478515625,
0.0010423660278320312,
0.01091766357421875,
0.051483154296875,
0.0108642578125,
-0.0224151611328125,
0.0007128715515136719,
0.0245361328125,
-0.058349609375,
0.024200439453125,
-0.0119171142578125,
0.01544952392578125,
0.0285491943359375,
0.0021038055419921875,
0.0352783203125,
0.024658203125,
-0.1033935546875,
0.044189453125,
0.00965118408203125,
0.006378173828125,
-0.0303192138671875,
0.005237579345703125,
-0.0015621185302734375,
-0.04656982421875,
-0.039764404296875,
-0.03387451171875,
0.01308441162109375,
0.032958984375,
0.0086822509765625,
-0.035797119140625,
-0.00843048095703125,
0.00821685791015625,
0.005474090576171875,
0.01270294189453125,
-0.005725860595703125,
-0.023651123046875,
0.02001953125,
-0.06964111328125,
-0.04547119140625,
0.005466461181640625,
-0.0013513565063476562,
0.035491943359375,
0.0195770263671875,
0.01318359375,
0.02557373046875,
-0.0114288330078125,
0.0110626220703125,
0.00557708740234375,
0.07354736328125,
-0.0042724609375,
-0.0367431640625,
-0.024261474609375,
0.0260162353515625,
0.017578125,
-0.062744140625,
0.05462646484375,
0.015777587890625,
-0.0018529891967773438,
-0.0609130859375,
-0.0046234130859375,
-0.0310821533203125,
-0.0020160675048828125,
-0.01751708984375,
0.04296875,
0.0081787109375,
0.048919677734375,
-0.01271820068359375,
0.0203704833984375,
0.07080078125,
-0.0107879638671875,
0.007442474365234375,
0.01087188720703125,
0.0087738037109375,
0.027801513671875,
-0.0227203369140625,
-0.00759124755859375,
0.01306915283203125,
-0.054290771484375,
0.0016107559204101562,
0.0201416015625,
0.003856658935546875,
-0.0208740234375,
0.01139068603515625,
0.003894805908203125,
0.0247650146484375,
0.02935791015625,
-0.02752685546875,
0.0265350341796875,
0.033050537109375,
-0.0074462890625,
0.0313720703125,
0.004543304443359375,
-0.0025234222412109375,
-0.01446533203125,
-0.00543975830078125,
-0.035888671875,
0.005268096923828125,
0.022674560546875,
0.017669677734375,
-0.006366729736328125,
-0.0207672119140625,
-0.019927978515625,
-0.01180267333984375,
0.0024089813232421875,
-0.003993988037109375,
0.048736572265625,
-0.0428466796875,
-0.012847900390625,
-0.0165863037109375,
-0.0404052734375,
-0.0230712890625,
0.03155517578125,
0.0248870849609375,
0.00022268295288085938,
0.00597381591796875,
0.0660400390625,
-0.0077667236328125,
0.0574951171875,
-0.00634002685546875,
-0.00377655029296875,
0.038665771484375,
-0.034454345703125,
0.04852294921875,
-0.0430908203125,
0.0303192138671875,
0.05328369140625,
-0.04376220703125,
0.03204345703125,
0.008575439453125,
0.017791748046875,
0.035369873046875,
0.0010709762573242188,
-0.005645751953125,
-0.0233001708984375,
-0.00672149658203125,
-0.022705078125,
0.01459503173828125,
0.06500244140625,
-0.0256805419921875,
-0.046966552734375,
-0.0068817138671875,
0.020782470703125,
-0.043792724609375,
-0.0296783447265625,
0.00025773048400878906,
-0.053466796875,
-0.024444580078125,
-0.01009368896484375,
-0.0426025390625,
0.004085540771484375,
0.01306915283203125,
0.00717926025390625,
-0.01543426513671875,
-0.045989990234375,
-0.042449951171875,
-0.059844970703125,
-0.05145263671875,
0.016326904296875,
-0.004119873046875,
-0.0025653839111328125,
-0.0108489990234375,
0.073974609375,
-0.00479888916015625,
-0.062744140625,
-0.036773681640625,
0.0249176025390625,
-0.00988006591796875,
-0.01100921630859375,
0.0333251953125,
-0.06591796875,
0.022918701171875,
0.00830841064453125,
-0.018096923828125,
0.0239715576171875,
-0.005298614501953125,
-0.0300750732421875,
-0.04229736328125,
-0.017608642578125,
-0.033050537109375,
0.0245819091796875,
0.06671142578125,
-0.0126953125,
-0.00536346435546875,
-0.03692626953125,
-0.07916259765625,
-0.0135498046875,
-0.0726318359375,
0.0872802734375,
0.06060791015625,
-0.008331298828125,
-0.0038318634033203125,
0.04193115234375,
0.01432037353515625,
-0.01062774658203125,
0.0255889892578125,
-0.004207611083984375,
0.004329681396484375,
-0.01251220703125,
-0.01120758056640625,
-0.01617431640625,
0.0423583984375,
-0.00492095947265625,
0.0278167724609375,
0.0229644775390625,
0.0232696533203125,
0.01226043701171875,
0.007709503173828125,
-0.0305938720703125,
-0.07489013671875,
0.050811767578125,
-0.0157623291015625,
0.0208282470703125,
-0.07879638671875,
-0.01317596435546875,
-0.034820556640625,
0.084716796875,
-0.050262451171875,
-0.01543426513671875,
-0.00876617431640625,
0.002288818359375,
-0.006702423095703125,
-0.01421356201171875,
-0.03582763671875,
-0.00896453857421875,
-0.03131103515625,
0.02423095703125,
-0.00531005859375,
-0.0124969482421875,
-0.0131072998046875,
0.032867431640625,
-0.0175018310546875,
-0.023223876953125,
0.0162811279296875,
0.01690673828125,
-0.0306243896484375,
0.041412353515625,
-0.029693603515625,
0.0088958740234375,
0.0092620849609375,
-0.02264404296875,
-0.047088623046875,
-0.0274658203125,
-0.0130615234375,
0.042266845703125,
0.04473876953125,
-0.06378173828125,
0.0165863037109375,
0.0445556640625,
0.00460052490234375,
-0.00772857666015625,
0.023834228515625,
0.010894775390625,
0.006519317626953125,
-0.0040130615234375,
0.021636962890625,
-0.0225830078125,
-0.020721435546875,
-0.0110931396484375,
-0.016693115234375,
0.021820068359375,
-0.0235748291015625,
-0.00806427001953125,
0.012451171875,
-0.0033111572265625,
-0.019195556640625,
-0.037139892578125,
-0.0211181640625,
-0.0093841552734375,
-0.0070648193359375,
-0.00379180908203125,
-0.027435302734375,
-0.0307159423828125,
0.030181884765625,
0.0214385986328125,
-0.05120849609375,
0.00888824462890625,
0.0242767333984375,
0.0289154052734375,
-0.036834716796875,
-0.051177978515625,
0.0195465087890625,
0.02093505859375,
0.005321502685546875,
0.047119140625,
0.020233154296875,
0.01105499267578125,
0.0141448974609375,
0.0015172958374023438,
0.0267181396484375,
-0.0215911865234375,
0.0828857421875,
-0.01317596435546875,
-0.044158935546875,
0.059661865234375,
-0.00981903076171875,
-0.039154052734375,
-0.00634765625,
-0.031219482421875,
-0.00015437602996826172,
-0.023895263671875,
0.051483154296875,
0.006084442138671875,
0.02777099609375,
-0.06610107421875,
0.0167083740234375,
-0.01702880859375,
0.06719970703125,
0.003826141357421875,
0.03497314453125,
0.00643157958984375,
-0.01505279541015625,
0.00009208917617797852,
0.005840301513671875,
0.04266357421875,
0.051116943359375,
0.032623291015625,
0.0509033203125,
0.01226043701171875,
-0.0010690689086914062,
-0.01050567626953125,
0.0047454833984375,
0.0189208984375,
0.0309600830078125,
0.01412200927734375,
-0.0254974365234375,
0.00730133056640625,
-0.01111602783203125,
-0.0256805419921875,
-0.0029201507568359375,
0.02752685546875,
0.03070068359375,
0.0003116130828857422,
0.0029659271240234375,
-0.005977630615234375,
0.0168304443359375,
-0.03790283203125,
-0.01073455810546875,
0.005725860595703125,
-0.01322174072265625,
-0.0016155242919921875,
0.02850341796875,
-0.0219879150390625,
0.01242828369140625,
-0.005542755126953125,
-0.0117950439453125,
-0.01337432861328125,
0.0160980224609375,
0.02655029296875,
-0.004688262939453125,
0.01119232177734375,
-0.01332855224609375,
0.032501220703125,
-0.0267181396484375,
-0.031158447265625,
0.0179290771484375,
0.07843017578125,
-0.0241546630859375,
-0.00531768798828125,
0.000720977783203125,
-0.044403076171875,
-0.0033817291259765625,
-0.0011043548583984375,
-0.007732391357421875,
-0.0183868408203125,
-0.007610321044921875,
-0.00551605224609375,
0.006793975830078125,
-0.0015077590942382812,
-0.041961669921875,
0.02423095703125,
-0.05596923828125,
0.0081787109375,
0.00118255615234375,
-0.058319091796875,
0.0214385986328125,
0.0064544677734375,
-0.04461669921875,
0.01641845703125,
0.02667236328125,
-0.08807373046875,
-0.072998046875,
-0.004825592041015625,
-0.00677490234375,
0.046844482421875,
-0.044189453125,
0.0205230712890625,
-0.01165008544921875,
0.00095367431640625,
-0.046234130859375,
0.03033447265625,
0.0218658447265625,
0.035797119140625,
-0.041595458984375,
0.0162200927734375,
-0.053619384765625,
-0.03057861328125,
-0.06536865234375,
-0.05609130859375,
-0.056396484375,
0.006801605224609375,
-0.01120758056640625,
0.01302337646484375,
-0.01262664794921875,
-0.013458251953125,
-0.05096435546875,
0.0286865234375,
0.02191162109375,
0.0325927734375,
-0.016571044921875,
0.0906982421875,
-0.053466796875,
0.029754638671875,
-0.0025997161865234375,
0.04473876953125,
-0.0005745887756347656,
-0.0075225830078125,
0.00069427490234375,
-0.00908660888671875,
0.0144500732421875,
-0.00897216796875,
-0.018951416015625,
0.00785064697265625,
0.08538818359375,
0.0126800537109375,
0.0225982666015625,
-0.043609619140625,
0.00246429443359375,
-0.0199432373046875,
0.03887939453125,
-0.04815673828125,
-0.0220489501953125,
0.0184783935546875,
0.01177215576171875,
0.02093505859375,
-0.01306915283203125,
-0.0290069580078125,
0.00545501708984375,
0.00713348388671875,
-0.0038299560546875,
0.00273895263671875,
-0.052490234375,
0.086181640625,
0.060394287109375,
-0.01910400390625,
0.036895751953125,
-0.00737762451171875,
-0.0117645263671875,
0.0202484130859375,
0.0300445556640625,
-0.025177001953125,
-0.035736083984375,
0.0697021484375,
0.01544189453125,
-0.0171051025390625,
0.05322265625,
-0.0287628173828125,
-0.0154266357421875,
0.0587158203125,
0.0208587646484375,
-0.06689453125,
-0.0136871337890625,
-0.0301513671875,
-0.0114898681640625,
0.01409912109375,
-0.01593017578125,
-0.023345947265625,
-0.012176513671875,
0.02783203125,
0.0212860107421875,
-0.0297088623046875,
0.005382537841796875,
0.0167236328125,
-0.0159454345703125,
-0.0269012451171875,
0.0770263671875,
0.0244140625,
0.046356201171875,
0.01312255859375,
-0.04339599609375,
0.04376220703125,
-0.0256500244140625,
0.037384033203125,
-0.036956787109375,
0.00914764404296875,
-0.0004634857177734375,
0.0146331787109375,
0.006885528564453125,
0.0001399517059326172,
0.006969451904296875,
-0.0018911361694335938,
-0.029693603515625,
0.06011962890625,
-0.054779052734375,
0.053558349609375,
0.035797119140625,
-0.03564453125,
-0.0308685302734375,
-0.00495147705078125,
0.0291595458984375,
-0.021942138671875,
-0.06982421875,
0.009857177734375,
-0.068603515625,
-0.0037364959716796875,
0.0110015869140625,
-0.00818634033203125,
0.082763671875,
-0.05218505859375,
-0.012176513671875,
0.027557373046875,
-0.0301971435546875,
-0.0171051025390625,
-0.005390167236328125,
0.0238037109375,
-0.01139068603515625,
0.0024700164794921875,
-0.00209808349609375,
-0.0233612060546875,
-0.0215911865234375,
-0.022491455078125,
-0.0758056640625,
0.0958251953125,
-0.01244354248046875,
0.045257568359375,
0.0126800537109375,
0.032958984375,
-0.03985595703125,
-0.004558563232421875,
-0.01517486572265625,
0.03472900390625,
0.0836181640625,
0.041473388671875,
-0.006015777587890625,
-0.034942626953125,
0.0352783203125,
0.0712890625,
0.0227203369140625,
0.003238677978515625,
-0.0027828216552734375,
0.0037937164306640625,
0.05389404296875,
0.002925872802734375,
-0.01837158203125,
0.04052734375,
-0.0063629150390625,
-0.006748199462890625,
-0.006793975830078125,
-0.0299530029296875,
-0.00004929304122924805,
-0.00482940673828125,
-0.0002142190933227539,
0.0196990966796875,
0.0179595947265625,
0.0205230712890625,
-0.004596710205078125,
0.01702880859375,
-0.0538330078125,
-0.004299163818359375,
0.040985107421875,
-0.036895751953125,
0.018402099609375,
0.02313232421875,
0.03485107421875,
-0.05755615234375,
-0.033416748046875,
-0.0245819091796875,
0.040985107421875,
0.01399993896484375,
0.0015716552734375,
-0.0148468017578125,
0.006793975830078125,
-0.00817108154296875,
-0.00949859619140625,
-0.001903533935546875,
0.047210693359375,
-0.0423583984375,
0.0091552734375,
-0.00933074951171875,
0.00798797607421875,
-0.06329345703125,
0.007656097412109375,
0.032440185546875,
0.0169219970703125,
-0.026092529296875,
-0.0253753662109375,
0.01335906982421875,
-0.0014705657958984375,
-0.016143798828125,
-0.00994110107421875,
-0.012176513671875,
-0.032806396484375,
-0.0009946823120117188,
-0.0196380615234375,
-0.040374755859375,
0.01555633544921875,
-0.017364501953125,
0.0005164146423339844,
-0.0015935897827148438,
0.054595947265625,
-0.007354736328125,
-0.0031490325927734375,
-0.01020050048828125,
0.0095672607421875,
0.00830841064453125,
0.0164794921875,
0.0226593017578125,
-0.01345062255859375,
-0.001605987548828125,
-0.0024566650390625,
0.01007843017578125,
-0.0102996826171875,
-0.00254058837890625,
0.005096435546875,
-0.0020694732666015625,
-0.0023860931396484375,
0.017974853515625,
-0.001987457275390625,
-0.0002925395965576172,
0.056854248046875,
0.024658203125,
-0.07708740234375,
-0.024932861328125,
-0.0274200439453125,
-0.049102783203125,
0.01361083984375,
-0.0264129638671875,
-0.00989532470703125,
0.005443572998046875,
-0.0298004150390625,
-0.0077362060546875,
-0.0127105712890625,
0.059478759765625,
-0.02008056640625,
0.00955963134765625,
-0.006683349609375,
-0.0238800048828125,
0.0538330078125,
0.003559112548828125,
0.0439453125,
0.005809783935546875,
-0.0762939453125,
-0.007617950439453125,
-0.00926971435546875,
-0.052276611328125,
0.035491943359375,
0.05084228515625,
-0.010833740234375,
0.00742340087890625,
0.026397705078125,
0.02166748046875,
-0.0201568603515625,
-0.0260772705078125,
0.0193023681640625,
-0.005435943603515625,
0.0234375,
0.032867431640625,
-0.0276031494140625,
-0.0168304443359375,
-0.028656005859375,
0.032318115234375,
0.012176513671875,
0.099365234375,
-0.039276123046875,
0.0290374755859375,
-0.0184326171875,
0.0160980224609375,
-0.0114288330078125,
-0.024200439453125,
0.08203125,
0.0060882568359375,
-0.0258331298828125,
-0.034271240234375,
-0.0443115234375,
0.035614013671875,
0.0205230712890625,
-0.0161590576171875,
0.0241546630859375,
-0.01287078857421875,
0.0041046142578125,
-0.015350341796875,
0.0023860931396484375,
-0.011566162109375,
-0.00974273681640625,
-0.04656982421875,
0.0030364990234375,
0.042236328125,
0.036834716796875,
-0.029083251953125,
0.033416748046875,
-0.02496337890625,
-0.046722412109375,
0.028045654296875,
-0.049285888671875,
0.0266571044921875,
0.0285491943359375,
-0.0266265869140625,
-0.06121826171875,
0.036773681640625,
-0.0006160736083984375,
0.0215301513671875,
0.008148193359375,
0.0633544921875,
0.033233642578125,
-0.031280517578125,
0.0163726806640625,
-0.0045623779296875,
0.01074981689453125,
-0.069580078125,
-0.0087738037109375,
0.029510498046875,
0.006229400634765625,
0.042510986328125,
-0.035400390625,
-0.010162353515625,
-0.0284576416015625,
-0.00791168212890625,
0.0152587890625,
-0.0157470703125,
-0.03741455078125,
-0.019134521484375,
0.01485443115234375,
0.043853759765625,
0.0172119140625,
-0.050506591796875,
0.0142364501953125,
-0.0159149169921875,
0.0574951171875,
0.0185089111328125,
0.01329803466796875,
-0.0088043212890625,
-0.037322998046875,
-0.03607177734375,
0.04852294921875,
-0.050811767578125,
-0.03765869140625,
0.0230712890625,
0.0197601318359375,
0.05419921875,
-0.01343536376953125,
0.0204010009765625,
0.00994873046875,
0.009735107421875,
0.0828857421875,
-0.061920166015625,
-0.0293731689453125,
0.00684356689453125,
-0.0150909423828125,
-0.00024771690368652344,
-0.0021839141845703125,
0.01238250732421875,
-0.052825927734375,
-0.017913818359375,
0.00595855712890625,
0.0194854736328125,
0.051483154296875,
-0.03228759765625,
-0.1011962890625,
0.08056640625,
-0.041473388671875,
-0.047515869140625,
0.02313232421875,
0.0023021697998046875,
-0.026336669921875,
-0.0015544891357421875,
0.009307861328125,
0.0003273487091064453,
0.0168304443359375,
0.014984130859375,
0.0029735565185546875,
-0.01568603515625,
0.037384033203125,
-0.0192413330078125,
-0.041656494140625,
-0.007022857666015625,
-0.004238128662109375,
-0.0192413330078125,
0.01178741455078125,
-0.01377105712890625,
0.02825927734375,
0.04962158203125,
-0.03607177734375,
-0.0283355712890625,
0.00577545166015625,
-0.01491546630859375,
0.00673675537109375,
0.00402069091796875,
-0.01163482666015625,
0.0098724365234375,
0.0345458984375,
0.029754638671875,
0.00411224365234375,
-0.0276336669921875,
0.008758544921875,
-0.039154052734375,
-0.047821044921875,
-0.005153656005859375,
0.021759033203125,
-0.056854248046875,
-0.0017480850219726562,
0.0355224609375,
-0.0333251953125,
-0.0389404296875,
-0.005283355712890625,
-0.062103271484375,
0.0032253265380859375,
-0.00958251953125,
0.00592803955078125,
-0.027099609375,
-0.040008544921875,
0.048797607421875,
-0.0140228271484375,
0.03717041015625,
-0.0157470703125,
0.03424072265625,
0.0302734375,
0.0292816162109375,
0.002681732177734375,
0.06591796875,
-0.1019287109375,
-0.006336212158203125,
-0.004077911376953125,
0.022125244140625,
-0.06689453125,
0.00347900390625,
-0.0205841064453125,
0.0250701904296875,
-0.0001983642578125,
0.028076171875,
-0.004993438720703125,
0.05322265625,
0.0200958251953125,
0.05950927734375,
0.0023059844970703125,
0.0280303955078125,
-0.030975341796875,
0.065185546875,
-0.0171966552734375,
-0.019439697265625,
-0.01580810546875,
-0.0147857666015625,
-0.0023784637451171875,
-0.007732391357421875,
-0.031097412109375,
-0.036376953125,
-0.0101776123046875,
-0.02752685546875,
-0.0216064453125,
-0.0020904541015625
] |
5054979933bf9df4e15a3c20423d951e3ea56c2c
|
Wordpress Stackexchange
Q: Permalink rewrite with custom post type and custom taxonomy I think thats a quick one:
I've got:
*
*Custom post type: Food
*Custom taxonomy (Registered to Food): Fruits
*Terms in Fruits: Apple, Orange, Cherry
If I type in example.com/food?fruits=Apple,Cherry, I get all posts in Fruits with the terms Apple and Cherry, thats great!
But I would like to type in example.com/food/fruits/Apple,Cherry or example.com/food/Apple,Cherry to get the same result.
I´ve tried different permalink and rewrite plugins related to custom posts but nothing helped.
Thank you,
David
A: You have to build up the link structure by using filters post_link and post_type_link:
add_filter('post_link', 'territorio_permalink', 10, 3);
add_filter('post_type_link', 'territorio_permalink', 10, 3);
function territorio_permalink($permalink, $post_id, $leavename) {
if (strpos($permalink, '%territorio%') === FALSE) return $permalink;
// Get post
$post = get_post($post_id);
if (!$post) return $permalink;
// Get taxonomy terms
$terms = wp_get_object_terms($post->ID, 'territorio','orderby=term_order');
if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0]))
$taxonomy_slug = $terms[0]->slug.'/'.$terms[1]->slug; //build here
else $taxonomy_slug = 'not-yet';
return str_replace('%territorio%', $taxonomy_slug, $permalink);
}
Where hotel is the post type and territorio is a hierarchical taxonomy.
In post type creation use:
'rewrite' => array( 'slug' => 'anything-you-want/%territorio%','with_front' => false),
Note: if you want deeper links, your build should go deeper:
$taxonomy_slug = $terms[0]->slug.'/'.$terms[1]->slug.'/'.$terms[2]->slug;
|
Q: Permalink rewrite with custom post type and custom taxonomy I think thats a quick one:
I've got:
*
*Custom post type: Food
*Custom taxonomy (Registered to Food): Fruits
*Terms in Fruits: Apple, Orange, Cherry
If I type in example.com/food?fruits=Apple,Cherry, I get all posts in Fruits with the terms Apple and Cherry, thats great!
But I would like to type in example.com/food/fruits/Apple,Cherry or example.com/food/Apple,Cherry to get the same result.
I´ve tried different permalink and rewrite plugins related to custom posts but nothing helped.
Thank you,
David
A: You have to build up the link structure by using filters post_link and post_type_link:
add_filter('post_link', 'territorio_permalink', 10, 3);
add_filter('post_type_link', 'territorio_permalink', 10, 3);
function territorio_permalink($permalink, $post_id, $leavename) {
if (strpos($permalink, '%territorio%') === FALSE) return $permalink;
// Get post
$post = get_post($post_id);
if (!$post) return $permalink;
// Get taxonomy terms
$terms = wp_get_object_terms($post->ID, 'territorio','orderby=term_order');
if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0]))
$taxonomy_slug = $terms[0]->slug.'/'.$terms[1]->slug; //build here
else $taxonomy_slug = 'not-yet';
return str_replace('%territorio%', $taxonomy_slug, $permalink);
}
Where hotel is the post type and territorio is a hierarchical taxonomy.
In post type creation use:
'rewrite' => array( 'slug' => 'anything-you-want/%territorio%','with_front' => false),
Note: if you want deeper links, your build should go deeper:
$taxonomy_slug = $terms[0]->slug.'/'.$terms[1]->slug.'/'.$terms[2]->slug;
|
wordpress
|
{
"language": "en",
"length": 198,
"provenance": "stackexchange_00019.jsonl.gz:420863",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55351"
}
|
[
0.04583740234375,
0.021484375,
-0.01031494140625,
-0.060089111328125,
0.026824951171875,
-0.01338958740234375,
-0.00853729248046875,
-0.042236328125,
0.03021240234375,
-0.023223876953125,
-0.033721923828125,
0.0007987022399902344,
-0.046417236328125,
-0.045562744140625,
0.01380157470703125,
-0.0280914306640625,
0.004985809326171875,
-0.005023956298828125,
0.02423095703125,
-0.01195526123046875,
0.027313232421875,
-0.011077880859375,
0.0177001953125,
-0.0246124267578125,
0.03753662109375,
-0.02154541015625,
0.006988525390625,
-0.0570068359375,
0.0036678314208984375,
-0.037994384765625,
0.006591796875,
0.03741455078125,
0.01132965087890625,
0.0038433074951171875,
0.01171112060546875,
-0.035797119140625,
0.0242156982421875,
-0.0114288330078125,
-0.00002962350845336914,
0.0158843994140625,
0.0313720703125,
-0.0199432373046875,
0.011932373046875,
0.042999267578125,
0.00988006591796875,
-0.0777587890625,
0.042724609375,
-0.0762939453125,
0.0100250244140625,
-0.009124755859375,
0.0311431884765625,
0.005062103271484375,
0.037078857421875,
-0.01256561279296875,
-0.002796173095703125,
0.0229034423828125,
0.0234527587890625,
-0.05889892578125,
0.00830841064453125,
-0.0025501251220703125,
-0.0014638900756835938,
-0.0151519775390625,
0.031768798828125,
0.0173187255859375,
-0.036346435546875,
-0.00014078617095947266,
0.00659942626953125,
0.00270843505859375,
-0.054229736328125,
-0.052642822265625,
0.01849365234375,
-0.00783538818359375,
-0.010009765625,
0.003330230712890625,
-0.01503753662109375,
-0.0745849609375,
0.02032470703125,
-0.042144775390625,
-0.0010471343994140625,
0.036956787109375,
-0.0205841064453125,
-0.018798828125,
-0.01180267333984375,
-0.0379638671875,
0.022918701171875,
-0.00038051605224609375,
-0.0134735107421875,
-0.0093994140625,
-0.01303863525390625,
-0.01910400390625,
-0.01001739501953125,
-0.0252685546875,
-0.025909423828125,
-0.00981903076171875,
0.0018606185913085938,
-0.056640625,
0.0196533203125,
0.031768798828125,
-0.0257720947265625,
0.028533935546875,
0.00554656982421875,
-0.046783447265625,
0.050537109375,
-0.04437255859375,
0.0278167724609375,
0.04510498046875,
0.0013065338134765625,
0.056427001953125,
0.06768798828125,
0.001552581787109375,
0.021148681640625,
0.07647705078125,
-0.0085601806640625,
-0.019195556640625,
-0.0092010498046875,
0.041412353515625,
-0.025848388671875,
0.017242431640625,
0.00970458984375,
0.0404052734375,
-0.0264892578125,
0.007740020751953125,
0.0136260986328125,
0.015106201171875,
0.0293731689453125,
0.037506103515625,
0.0178375244140625,
-0.049835205078125,
-0.0162811279296875,
0.06658935546875,
-0.00426483154296875,
-0.01300811767578125,
0.006404876708984375,
0.029388427734375,
0.0009593963623046875,
-0.02899169921875,
0.00794219970703125,
-0.0187225341796875,
-0.033721923828125,
0.00865936279296875,
0.0295562744140625,
-0.00933837890625,
0.006076812744140625,
0.0007848739624023438,
0.0207366943359375,
0.0147552490234375,
0.01629638671875,
0.008544921875,
-0.0033321380615234375,
-0.04400634765625,
0.0103759765625,
-0.0257568359375,
0.093994140625,
-0.008636474609375,
-0.10467529296875,
-0.01070404052734375,
0.023468017578125,
-0.034332275390625,
-0.07281494140625,
-0.08984375,
-0.006732940673828125,
-0.0174560546875,
-0.0035190582275390625,
-0.00374603271484375,
-0.033843994140625,
0.036712646484375,
-0.011077880859375,
-0.0019464492797851562,
0.02099609375,
0.0279083251953125,
0.02191162109375,
0.0023632049560546875,
-0.00565338134765625,
-0.00811767578125,
-0.0030574798583984375,
-0.004383087158203125,
-0.0135040283203125,
0.01446533203125,
0.0283966064453125,
0.05108642578125,
0.018218994140625,
-0.01421356201171875,
0.047821044921875,
-0.004558563232421875,
-0.0560302734375,
0.062164306640625,
-0.020233154296875,
0.06256103515625,
0.034454345703125,
-0.00464630126953125,
0.000025510787963867188,
-0.0028247833251953125,
-0.08856201171875,
0.07061767578125,
-0.0073699951171875,
-0.01477813720703125,
-0.00893402099609375,
0.01023101806640625,
-0.01284027099609375,
-0.020538330078125,
-0.0462646484375,
0.0309906005859375,
-0.00942230224609375,
0.01568603515625,
-0.0665283203125,
0.04791259765625,
-0.044586181640625,
0.057952880859375,
-0.0305633544921875,
0.00751495361328125,
0.031951904296875,
0.0158538818359375,
-0.04278564453125,
-0.00945281982421875,
0.0101470947265625,
0.043426513671875,
0.0198211669921875,
0.0167083740234375,
-0.0274810791015625,
0.0032978057861328125,
-0.02154541015625,
-0.0411376953125,
-0.0180816650390625,
0.0333251953125,
0.01145172119140625,
0.046600341796875,
-0.03857421875,
0.02447509765625,
-0.0079803466796875,
0.052001953125,
-0.05999755859375,
0.00879669189453125,
0.03375244140625,
0.0019216537475585938,
-0.04718017578125,
0.020660400390625,
0.0091094970703125,
-0.00008994340896606445,
-0.018463134765625,
0.02947998046875,
0.0223846435546875,
0.072021484375,
-0.0268096923828125,
-0.028411865234375,
0.07073974609375,
-0.05047607421875,
-0.0227508544921875,
-0.0023593902587890625,
-0.0236663818359375,
0.0246124267578125,
0.0352783203125,
0.042755126953125,
0.0062103271484375,
0.04736328125,
0.0024662017822265625,
0.034027099609375,
-0.01421356201171875,
-0.02288818359375,
0.038116455078125,
-0.007076263427734375,
0.01221466064453125,
0.01277923583984375,
-0.0175933837890625,
0.0083160400390625,
0.004352569580078125,
0.05322265625,
0.0206298828125,
0.0251922607421875,
-0.047882080078125,
0.03448486328125,
0.01517486572265625,
0.0225372314453125,
-0.0114593505859375,
0.00536346435546875,
0.05169677734375,
-0.00437164306640625,
-0.00997161865234375,
-0.0043182373046875,
0.026397705078125,
0.01143646240234375,
-0.01580810546875,
0.0322265625,
-0.032562255859375,
-0.0130767822265625,
-0.0239715576171875,
-0.0718994140625,
-0.00412750244140625,
0.021820068359375,
-0.03985595703125,
0.003559112548828125,
-0.004322052001953125,
0.06463623046875,
-0.0030574798583984375,
0.017303466796875,
0.0121307373046875,
0.0187835693359375,
0.033203125,
0.004428863525390625,
0.02484130859375,
-0.0228271484375,
-0.00243377685546875,
0.03973388671875,
0.0234832763671875,
-0.03240966796875,
0.00205230712890625,
-0.0219879150390625,
-0.01055908203125,
0.0128326416015625,
-0.0203094482421875,
-0.04010009765625,
-0.01505279541015625,
0.009979248046875,
0.01439666748046875,
0.03350830078125,
-0.0177001953125,
-0.0517578125,
-0.01380157470703125,
0.0118865966796875,
-0.058197021484375,
-0.051239013671875,
0.0208892822265625,
0.00469970703125,
0.02215576171875,
0.008209228515625,
0.019989013671875,
-0.02239990234375,
-0.003360748291015625,
0.002857208251953125,
0.002193450927734375,
0.0023174285888671875,
-0.0379638671875,
-0.01776123046875,
-0.05328369140625,
-0.006153106689453125,
-0.00970458984375,
0.01168060302734375,
0.011993408203125,
0.0172882080078125,
0.005035400390625,
-0.0171356201171875,
0.03302001953125,
0.032928466796875,
-0.0215606689453125,
-0.003154754638671875,
-0.016754150390625,
-0.0310516357421875,
0.00795745849609375,
-0.01142120361328125,
0.06866455078125,
0.0272369384765625,
-0.01354217529296875,
0.017547607421875,
-0.0010080337524414062,
0.004840850830078125,
-0.002410888671875,
-0.00251007080078125,
0.005992889404296875,
0.01568603515625,
0.0067596435546875,
-0.030120849609375,
-0.033599853515625,
-0.02520751953125,
-0.0377197265625,
0.045318603515625,
0.032012939453125,
-0.015106201171875,
-0.00009632110595703125,
0.020294189453125,
0.017730712890625,
0.0216217041015625,
0.0112762451171875,
-0.0224456787109375,
0.01497650146484375,
-0.01119232177734375,
-0.0158538818359375,
-0.02386474609375,
0.0211029052734375,
-0.03131103515625,
0.0157470703125,
-0.00428009033203125,
-0.035247802734375,
-0.02435302734375,
0.0033245086669921875,
-0.054779052734375,
-0.03515625,
0.0245361328125,
-0.1014404296875,
-0.020843505859375,
-0.050811767578125,
0.0168609619140625,
-0.02227783203125,
0.03826904296875,
-0.012908935546875,
-0.0032501220703125,
-0.015533447265625,
-0.01544189453125,
0.00038504600524902344,
-0.02734375,
-0.0628662109375,
-0.0069580078125,
-0.09423828125,
-0.019317626953125,
-0.0157928466796875,
-0.04010009765625,
0.009368896484375,
0.00518798828125,
-0.028717041015625,
-0.04473876953125,
0.03411865234375,
-0.00665283203125,
-0.0205535888671875,
0.04925537109375,
-0.00882720947265625,
-0.006725311279296875,
-0.0200958251953125,
0.01153564453125,
-0.0333251953125,
-0.006275177001953125,
0.050811767578125,
-0.00539398193359375,
-0.04022216796875,
0.01116943359375,
-0.01470184326171875,
0.034515380859375,
0.00493621826171875,
-0.019744873046875,
0.0101776123046875,
0.01149749755859375,
0.00040984153747558594,
-0.0127410888671875,
-0.01465606689453125,
-0.01422119140625,
-0.01068878173828125,
0.00927734375,
-0.037567138671875,
0.0400390625,
0.0010805130004882812,
0.0229034423828125,
0.0198516845703125,
-0.0369873046875,
-0.081787109375,
-0.023162841796875,
-0.037017822265625,
-0.01407623291015625,
-0.0258636474609375,
-0.0137786865234375,
-0.0217437744140625,
-0.08343505859375,
0.01169586181640625,
-0.01959228515625,
-0.0231475830078125,
0.0241241455078125,
0.0567626953125,
0.01052093505859375,
-0.0008764266967773438,
-0.0455322265625,
0.01030731201171875,
0.0190887451171875,
0.0160369873046875,
0.0303802490234375,
0.01092529296875,
0.00258636474609375,
0.01482391357421875,
0.00238037109375,
-0.02215576171875,
0.00669097900390625,
0.016082763671875,
0.01241302490234375,
-0.0192718505859375,
0.0089569091796875,
-0.0281982421875,
0.0628662109375,
0.028106689453125,
-0.0255279541015625,
-0.0160675048828125,
-0.0400390625,
0.0635986328125,
-0.007022857666015625,
0.01050567626953125,
-0.061676025390625,
-0.0301361083984375,
0.0312042236328125,
0.00782012939453125,
0.0178070068359375,
0.0115203857421875,
-0.01232147216796875,
0.0220794677734375,
-0.02325439453125,
0.00007623434066772461,
0.0139923095703125,
0.03076171875,
-0.0189056396484375,
0.039093017578125,
-0.00939178466796875,
-0.00859832763671875,
-0.0037746429443359375,
0.003162384033203125,
0.035491943359375,
0.0185546875,
-0.00258636474609375,
-0.04132080078125,
-0.0120697021484375,
-0.01849365234375,
0.00003802776336669922,
0.0216064453125,
0.028289794921875,
0.01971435546875,
0.0218963623046875,
0.0130615234375,
-0.01447296142578125,
0.0270843505859375,
-0.0105438232421875,
0.00800323486328125,
0.0029392242431640625,
-0.017425537109375,
-0.0279388427734375,
0.044677734375,
0.00104522705078125,
0.0014314651489257812,
0.0115966796875,
0.01073455810546875,
0.0165252685546875,
0.013214111328125,
0.004886627197265625,
0.005046844482421875,
-0.01293182373046875,
0.0199127197265625,
0.023529052734375,
-0.0416259765625,
-0.01483917236328125,
0.0159454345703125,
0.049163818359375,
-0.052581787109375,
-0.03033447265625,
0.0256805419921875,
-0.003662109375,
-0.033203125,
-0.00403594970703125,
0.005886077880859375,
-0.0007815361022949219,
-0.0250091552734375,
0.0004711151123046875,
0.01043701171875,
0.0224609375,
-0.0112152099609375,
0.01953125,
-0.002315521240234375,
0.02630615234375,
-0.01934814453125,
-0.0030078887939453125,
0.00738525390625,
0.01519775390625,
-0.0270538330078125,
-0.0181427001953125,
0.0068359375,
-0.0156402587890625,
-0.02801513671875,
-0.005153656005859375,
-0.018310546875,
0.00969696044921875,
-0.01873779296875,
0.043212890625,
-0.0119476318359375,
-0.01861572265625,
0.02032470703125,
0.0028057098388671875,
0.051422119140625,
0.03070068359375,
-0.0036182403564453125,
0.01026153564453125,
-0.043670654296875,
0.01153564453125,
-0.0032558441162109375,
-0.0316162109375,
-0.003986358642578125,
-0.0286712646484375,
-0.0141754150390625,
0.0225067138671875,
0.0079193115234375,
0.029510498046875,
0.0211029052734375,
0.0006170272827148438,
-0.032501220703125,
-0.0038909912109375,
0.0162811279296875,
0.01494598388671875,
-0.0271453857421875,
0.031463623046875,
-0.002727508544921875,
-0.028564453125,
-0.054107666015625,
-0.01641845703125,
-0.0251007080078125,
-0.0809326171875,
-0.001049041748046875,
0.016876220703125,
-0.0019330978393554688,
0.07525634765625,
0.0640869140625,
0.02398681640625,
0.027587890625,
0.0047607421875,
0.0079193115234375,
-0.0215606689453125,
-0.04010009765625,
-0.039154052734375,
0.04058837890625,
-0.04351806640625,
-0.022613525390625,
0.0391845703125,
0.03839111328125,
0.046966552734375,
-0.0357666015625,
-0.0221099853515625,
-0.00150299072265625,
0.01203155517578125,
0.011749267578125,
-0.0291290283203125,
0.01934814453125,
0.03338623046875,
0.052154541015625,
-0.0094451904296875,
0.048736572265625,
0.0225372314453125,
-0.020294189453125,
0.04205322265625,
0.0253753662109375,
0.0609130859375,
-0.0202178955078125,
0.01262664794921875,
0.04791259765625,
-0.019927978515625,
-0.0228118896484375,
0.02899169921875,
0.01342010498046875,
-0.0377197265625,
-0.0241241455078125,
-0.0119781494140625,
-0.0234375,
-0.024810791015625,
0.024200439453125,
0.0018157958984375,
0.048919677734375,
-0.0462646484375,
-0.040985107421875,
-0.024383544921875,
-0.0201416015625,
0.0181427001953125,
0.01099395751953125,
0.005161285400390625,
0.04046630859375,
-0.0120849609375,
-0.039215087890625,
-0.0225372314453125,
0.00360870361328125,
-0.002635955810546875,
0.019561767578125,
0.0206756591796875,
-0.0031948089599609375,
0.0009393692016601562,
-0.0122222900390625,
0.027923583984375,
-0.048858642578125,
0.007755279541015625,
0.061309814453125,
-0.017822265625,
0.0020580291748046875,
-0.00609588623046875,
-0.004749298095703125,
0.003917694091796875,
-0.03265380859375,
-0.0560302734375,
0.0276947021484375,
-0.0115814208984375,
0.01309967041015625,
0.002346038818359375,
-0.03253173828125,
0.007740020751953125,
-0.0255279541015625,
0.004367828369140625,
-0.0181884765625,
-0.03948974609375,
0.0894775390625,
-0.01288604736328125,
-0.03277587890625,
0.01032257080078125,
0.0220184326171875,
-0.0046844482421875,
0.00586700439453125,
0.02490234375,
-0.0631103515625,
-0.058349609375,
0.0116424560546875,
-0.06805419921875,
-0.0031070709228515625,
-0.013031005859375,
-0.0986328125,
0.1083984375,
-0.0081787109375,
0.0987548828125,
-0.0110321044921875,
0.0246124267578125,
0.004825592041015625,
0.0196533203125,
-0.034332275390625,
0.031005859375,
0.0146026611328125,
0.046722412109375,
-0.039093017578125,
-0.0115966796875,
0.0166473388671875,
0.040924072265625,
0.0657958984375,
0.022247314453125,
-0.07379150390625,
-0.00531005859375,
0.046234130859375,
0.0301513671875,
0.01155853271484375,
0.054901123046875,
-0.0172576904296875,
0.050567626953125,
0.02490234375,
-0.0738525390625,
-0.00296783447265625,
0.01690673828125,
-0.023712158203125,
0.0271759033203125,
0.01824951171875,
0.0271759033203125,
0.0255584716796875,
0.03173828125,
-0.046112060546875,
0.01104736328125,
0.061065673828125,
-0.07232666015625,
0.01763916015625,
0.0101318359375,
0.037506103515625,
-0.0977783203125,
-0.00007468461990356445,
-0.037872314453125,
0.058319091796875,
-0.00521087646484375,
0.017120361328125,
0.036102294921875,
0.0158233642578125,
0.043426513671875,
-0.033905029296875,
0.004688262939453125,
-0.0032806396484375,
-0.00365447998046875,
0.027557373046875,
-0.013885498046875,
0.02252197265625,
-0.045745849609375,
0.004077911376953125,
0.03369140625,
0.03729248046875,
-0.03387451171875,
-0.01357269287109375,
0.0091705322265625,
0.00946044921875,
-0.00603485107421875,
-0.00324249267578125,
0.03887939453125,
0.043731689453125,
0.03338623046875,
-0.052825927734375,
0.0193634033203125,
0.018524169921875,
0.031982421875,
-0.0200042724609375,
-0.020904541015625,
-0.040313720703125,
0.01204681396484375,
-0.06964111328125,
0.046600341796875,
0.0282440185546875,
0.05865478515625,
-0.000667572021484375,
0.0672607421875,
-0.00711822509765625,
-0.01517486572265625,
0.01470184326171875,
0.013916015625,
0.0157318115234375,
-0.033050537109375,
0.02490234375,
-0.002315521240234375,
-0.002437591552734375,
0.0002741813659667969,
0.03948974609375,
0.0248870849609375,
0.036956787109375,
0.0277252197265625,
0.036102294921875,
-0.0021266937255859375,
0.003902435302734375,
-0.0074310302734375,
0.02685546875,
-0.0264739990234375,
0.02117919921875,
0.01549530029296875,
-0.0027179718017578125,
-0.04217529296875,
-0.0248870849609375,
0.052215576171875,
-0.0026798248291015625,
0.04400634765625,
0.00971221923828125,
0.0030918121337890625,
0.003025054931640625,
0.014556884765625,
0.020751953125,
0.032928466796875,
-0.08233642578125,
-0.026153564453125,
-0.03253173828125,
-0.072265625,
0.040435791015625,
0.06268310546875,
-0.0001760721206665039,
-0.020477294921875,
0.0421142578125,
-0.0283660888671875,
0.00783538818359375,
0.0199127197265625,
0.01055145263671875,
-0.002532958984375,
0.00823974609375,
0.00189208984375,
0.00005525350570678711,
0.023284912109375,
0.04962158203125,
-0.0259246826171875,
-0.025848388671875,
0.0892333984375,
-0.0155029296875,
-0.03167724609375,
-0.058868408203125,
0.01837158203125,
-0.047332763671875,
-0.042205810546875,
0.03228759765625,
-0.0216827392578125,
-0.024169921875,
0.015655517578125,
0.0018358230590820312,
0.0007796287536621094,
0.04937744140625,
-0.06488037109375,
-0.010467529296875,
0.00511932373046875,
0.0185699462890625,
-0.036224365234375,
0.06341552734375,
-0.0189361572265625,
-0.031768798828125,
-0.06280517578125,
-0.0287322998046875,
0.03179931640625,
0.0282745361328125,
-0.013519287109375,
0.042999267578125,
0.002895355224609375,
-0.0184326171875,
0.0012369155883789062,
-0.046966552734375,
0.01099395751953125,
0.049591064453125,
-0.0179443359375,
0.01258087158203125,
0.055694580078125,
-0.013275146484375,
0.0233154296875,
0.0263671875,
0.0140380859375,
0.0252838134765625,
-0.0592041015625,
0.006427764892578125,
-0.039764404296875,
0.0200958251953125,
-0.0081024169921875,
-0.001850128173828125,
-0.02435302734375,
0.03399658203125,
-0.0167694091796875,
0.006366729736328125,
-0.0201263427734375,
-0.0100555419921875,
-0.0229339599609375,
0.0186004638671875,
-0.023162841796875,
-0.0042724609375,
-0.06585693359375,
0.0195770263671875,
0.056640625,
-0.0027980804443359375,
-0.03472900390625,
0.0213470458984375,
-0.032440185546875,
0.0416259765625,
-0.0041046142578125,
-0.020416259765625,
0.005504608154296875,
0.02655029296875,
-0.0556640625,
0.0184783935546875,
-0.034332275390625,
-0.0452880859375,
-0.032867431640625,
0.0233001708984375,
0.053558349609375,
-0.035003662109375,
-0.0268096923828125,
-0.01546478271484375,
0.01497650146484375,
0.031341552734375,
0.017852783203125,
0.0023937225341796875,
0.024200439453125,
0.003204345703125,
-0.05279541015625,
-0.0797119140625,
0.02825927734375,
-0.0733642578125,
-0.01512908935546875,
0.027679443359375,
-0.037200927734375,
-0.013763427734375,
-0.03289794921875,
-0.05316162109375,
0.057281494140625,
0.012359619140625,
-0.0310821533203125,
-0.058319091796875,
-0.0166015625,
-0.00160980224609375,
0.039520263671875,
-0.0156097412109375,
-0.0270843505859375,
-0.050872802734375,
0.0360107421875,
-0.005496978759765625,
0.052154541015625,
-0.0185546875,
0.027740478515625,
-0.0020809173583984375,
0.052703857421875,
0.02655029296875,
0.0074462890625,
0.0231170654296875,
-0.0176849365234375,
0.04083251953125,
0.044189453125,
-0.028411865234375,
-0.0214996337890625,
-0.0171966552734375,
-0.040771484375,
0.0214385986328125,
-0.0333251953125,
-0.04217529296875,
-0.0287933349609375,
0.0997314453125,
-0.00867462158203125,
0.03155517578125,
-0.0180206298828125,
-0.0107879638671875,
-0.034393310546875,
-0.04815673828125,
0.00678253173828125,
0.037078857421875,
-0.060272216796875,
0.004703521728515625,
0.0189971923828125,
0.00012886524200439453,
-0.023101806640625,
0.0270538330078125,
-0.0120849609375,
-0.0199737548828125,
0.01788330078125,
-0.02301025390625,
-0.01324462890625,
0.0263214111328125,
0.055877685546875,
-0.0361328125,
-0.0163726806640625,
-0.0166168212890625,
0.00908660888671875,
0.018646240234375,
-0.055572509765625,
-0.03326416015625,
0.00437164306640625,
0.0304107666015625,
-0.01544952392578125,
0.025360107421875,
0.0168304443359375,
0.0450439453125,
0.0205078125,
-0.01280975341796875,
0.01294708251953125,
0.00328826904296875,
0.006435394287109375,
-0.029571533203125,
0.01119232177734375,
0.0012264251708984375,
0.0662841796875,
-0.023834228515625,
-0.00009495019912719727,
0.006378173828125,
-0.004741668701171875,
-0.0077972412109375,
0.019805908203125,
0.03955078125,
-0.021514892578125,
-0.003276824951171875,
-0.01303863525390625,
-0.037841796875,
-0.034942626953125,
0.0005025863647460938,
-0.016937255859375,
-0.0290985107421875,
0.01541900634765625
] |
be39ef7359da11b3f0b98f9165f4248a17890c6e
|
Wordpress Stackexchange
Q: Make 'Howdy, [name]' function as log out button I have been customising the admin bar in version 3.3 to only have certain custom links with the following added to functions.php:
function mytheme_admin_bar_render() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('site-name');
$wp_admin_bar->remove_menu('new-content');
$wp_admin_bar->remove_menu('updates');
$wp_admin_bar->remove_menu('comments');
$wp_admin_bar->remove_menu('edit-profile');
$wp_admin_bar->add_menu( array(
'id' => 'reports', 'title' => __( 'Reports'), 'href' => __('xyz.html'),
));
}
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
I'd now like to have the far right link that says Howdy, ..., function as a Logout button.
Does anyone have any suggestions on how achieve this?
A: Here is a simple solution I figured out by reverse engineering this plugin: http://wordpress.org/extend/plugins/dashboard-tweaks/
function custom_logout_link() {
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
'id' => 'wp-custom-logout',
'title' => 'Logout',
'parent'=> 'top-secondary',
'href' => wp_logout_url()
) );
$wp_admin_bar->remove_menu('my-account');
}
add_action( 'wp_before_admin_bar_render', 'custom_logout_link' );
|
Q: Make 'Howdy, [name]' function as log out button I have been customising the admin bar in version 3.3 to only have certain custom links with the following added to functions.php:
function mytheme_admin_bar_render() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('site-name');
$wp_admin_bar->remove_menu('new-content');
$wp_admin_bar->remove_menu('updates');
$wp_admin_bar->remove_menu('comments');
$wp_admin_bar->remove_menu('edit-profile');
$wp_admin_bar->add_menu( array(
'id' => 'reports', 'title' => __( 'Reports'), 'href' => __('xyz.html'),
));
}
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
I'd now like to have the far right link that says Howdy, ..., function as a Logout button.
Does anyone have any suggestions on how achieve this?
A: Here is a simple solution I figured out by reverse engineering this plugin: http://wordpress.org/extend/plugins/dashboard-tweaks/
function custom_logout_link() {
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
'id' => 'wp-custom-logout',
'title' => 'Logout',
'parent'=> 'top-secondary',
'href' => wp_logout_url()
) );
$wp_admin_bar->remove_menu('my-account');
}
add_action( 'wp_before_admin_bar_render', 'custom_logout_link' );
A: This should hit the spot:
function remove_old_logout() {
global $wp_admin_bar;
$wp_admin_bar->remove_node('my-account');
}
add_action( 'wp_before_admin_bar_render', 'remove_old_logout' );
function newlogout() {
?>
<style type="text/css">
table#one-click01 tr td a:link,
table#one-click01 tr td a:visited {
color:#CCCCCC;
text-decoration: none;
}
table#one-click01 tr td a:hover,
table#one-click01 tr td a:active,
table#one-click01 tr td a:focus {
color:#FAFAFA;
text-decoration: none;
}
table#one-click01 {
float:right;z-index:100000;position:fixed;right:0px;top:0px;background:#464646;padding-right:30px;padding-left:100px;border:0px;
}
body table#one-click01 tr td {
height:25px;
padding:3px 0 0 0;
font-size:13px;
font-family:sans-serif;
line-height:1.5;
color:#CCCCCC;
}
body.wp-admin table#one-click01 tr td {
height:28px;
padding-top:0px;
}
body.logged-in table#one-click01 tr td {
padding-right:30px;
border: 0px;
}
body.logged-in table#one-click01 {
margin:0;border-collapse:collapse;border-spacing:0;
}
body.logged-in table#one-click01 tr td {
vertical-align:middle;
border:0;
}
</style>
<table id="one-click01" style="" border="0" cellspacing="0" cellpadding="0"><tr><td align=center valign=center>
<?php
wp_get_current_user();
$current_user = wp_get_current_user();
if ( !($current_user instanceof WP_User) )
return;
$name = $current_user->display_name;
?>
<?php echo '
<a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">Howdy, ' . __($name) . '</a>'
; ?>
</td></tr></table>
<?php
}
add_action( 'admin_bar_menu', 'newlogout' );
?>
Modified version of:
http://wordpress.org/extend/plugins/one-click-logout/
A: EDIT: This is obviously not a good idea if you want to be able to update - see comments below
As this site explains, you need to replace <?php printf(__(‘Howdy, %2$s!’), ‘profile.php’, $user_identity) ?> in the wordpress admin with in your case the word 'logout.' Then make the url be echo wp_logout_url();
|
wordpress
|
{
"language": "en",
"length": 341,
"provenance": "stackexchange_00019.jsonl.gz:420870",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55373"
}
|
[
0.04791259765625,
0.014617919921875,
0.005764007568359375,
-0.0013570785522460938,
0.024383544921875,
-0.0296630859375,
0.038818359375,
-0.04443359375,
-0.0308380126953125,
0.01922607421875,
0.06500244140625,
-0.018035888671875,
-0.0201568603515625,
-0.0517578125,
0.007228851318359375,
-0.0058135986328125,
0.028411865234375,
0.0275421142578125,
0.04949951171875,
0.0005245208740234375,
-0.0011129379272460938,
0.0092010498046875,
-0.004467010498046875,
0.03204345703125,
0.01678466796875,
-0.0367431640625,
0.08673095703125,
0.0003674030303955078,
0.031524658203125,
-0.001068115234375,
0.026214599609375,
-0.045166015625,
0.0025081634521484375,
0.049835205078125,
-0.01445770263671875,
0.006549835205078125,
-0.0236968994140625,
0.049224853515625,
0.037139892578125,
-0.012664794921875,
0.023101806640625,
-0.00960540771484375,
-0.005001068115234375,
-0.004184722900390625,
-0.0308380126953125,
-0.019622802734375,
0.014923095703125,
-0.00027561187744140625,
0.03948974609375,
-0.00007861852645874023,
0.0199432373046875,
-0.0003306865692138672,
0.032928466796875,
-0.041259765625,
-0.0295257568359375,
0.0026073455810546875,
-0.0270233154296875,
-0.0257415771484375,
0.0211029052734375,
0.0848388671875,
0.0188751220703125,
-0.003139495849609375,
-0.019989013671875,
-0.0667724609375,
-0.034881591796875,
0.0099639892578125,
-0.024810791015625,
0.00433349609375,
0.00010591745376586914,
-0.043060302734375,
-0.01898193359375,
-0.004093170166015625,
0.0208892822265625,
0.0155487060546875,
-0.05133056640625,
-0.00952911376953125,
0.0124053955078125,
0.01456451416015625,
0.0303497314453125,
-0.029876708984375,
-0.00133514404296875,
0.01421356201171875,
-0.037689208984375,
0.0146942138671875,
0.0125579833984375,
0.03759765625,
-0.0201263427734375,
-0.0247650146484375,
-0.038116455078125,
0.0147857666015625,
-0.0307159423828125,
-0.0178985595703125,
0.007175445556640625,
0.00885009765625,
-0.01276397705078125,
-0.007793426513671875,
0.0097198486328125,
0.0177154541015625,
0.033477783203125,
0.018310546875,
-0.01119232177734375,
-0.0176849365234375,
-0.026580810546875,
-0.0281829833984375,
0.004123687744140625,
0.06365966796875,
-0.008941650390625,
0.0157623291015625,
0.035308837890625,
0.010101318359375,
0.01090240478515625,
-0.0352783203125,
-0.025390625,
-0.03533935546875,
-0.00383758544921875,
0.052581787109375,
-0.00524139404296875,
0.0184478759765625,
-0.00010418891906738281,
0.052398681640625,
-0.0352783203125,
-0.0301513671875,
0.00247955322265625,
0.032806396484375,
0.0189971923828125,
0.0238037109375,
-0.00789642333984375,
0.0008816719055175781,
0.03314208984375,
0.003978729248046875,
-0.0297088623046875,
0.0172882080078125,
0.04547119140625,
0.0014019012451171875,
0.0110931396484375,
-0.016204833984375,
0.061431884765625,
-0.015289306640625,
0.0164794921875,
0.0122528076171875,
-0.01140594482421875,
-0.024566650390625,
0.0004773139953613281,
-0.007556915283203125,
0.0079498291015625,
0.01302337646484375,
0.010040283203125,
0.005565643310546875,
0.00940704345703125,
-0.028656005859375,
-0.0183868408203125,
0.0120391845703125,
0.032257080078125,
0.01201629638671875,
-0.00945281982421875,
0.01306915283203125,
0.035003662109375,
-0.02044677734375,
-0.0433349609375,
-0.00914764404296875,
0.002017974853515625,
-0.011688232421875,
-0.0104522705078125,
-0.0313720703125,
-0.0225982666015625,
0.01258087158203125,
-0.026611328125,
0.00637054443359375,
0.03717041015625,
0.047027587890625,
0.0361328125,
-0.07977294921875,
-0.05303955078125,
0.0238800048828125,
-0.0004036426544189453,
0.047271728515625,
-0.0157928466796875,
0.062469482421875,
0.01271820068359375,
0.01708984375,
-0.00423431396484375,
-0.058624267578125,
0.040313720703125,
-0.0111236572265625,
-0.07379150390625,
0.007030487060546875,
0.0214996337890625,
0.06878662109375,
0.00884246826171875,
0.0132293701171875,
0.038604736328125,
-0.0011157989501953125,
0.006450653076171875,
-0.0201263427734375,
-0.022674560546875,
-0.0239715576171875,
0.0200347900390625,
0.00856781005859375,
-0.022552490234375,
0.039337158203125,
-0.01239776611328125,
0.03216552734375,
-0.01418304443359375,
0.01120758056640625,
-0.0791015625,
0.048736572265625,
-0.04254150390625,
0.05743408203125,
0.00791168212890625,
0.014892578125,
0.0147857666015625,
0.0264434814453125,
-0.0109405517578125,
-0.03289794921875,
-0.0254974365234375,
0.004848480224609375,
-0.0235748291015625,
0.054779052734375,
-0.0234375,
0.050323486328125,
-0.012847900390625,
-0.05078125,
0.00429534912109375,
-0.006526947021484375,
0.040679931640625,
-0.03564453125,
-0.0301055908203125,
-0.0286712646484375,
-0.00914764404296875,
-0.0213775634765625,
-0.0232391357421875,
0.08612060546875,
0.027496337890625,
0.0025348663330078125,
-0.0262603759765625,
-0.0044097900390625,
0.01377105712890625,
-0.055572509765625,
-0.00290679931640625,
0.039154052734375,
0.03729248046875,
0.0118255615234375,
0.0022983551025390625,
0.00804901123046875,
0.0196075439453125,
-0.0653076171875,
0.005985260009765625,
0.004192352294921875,
-0.00650787353515625,
-0.005870819091796875,
-0.0241241455078125,
-0.0111083984375,
0.060638427734375,
-0.003849029541015625,
0.0100555419921875,
0.041748046875,
-0.055389404296875,
-0.0604248046875,
0.0157012939453125,
-0.001312255859375,
0.0163116455078125,
-0.060302734375,
-0.005886077880859375,
-0.031463623046875,
-0.0004940032958984375,
-0.0156707763671875,
0.0267486572265625,
0.01183319091796875,
-0.045684814453125,
-0.035675048828125,
0.036407470703125,
0.06561279296875,
-0.0253448486328125,
0.03460693359375,
0.046234130859375,
-0.05126953125,
-0.056121826171875,
0.0194854736328125,
0.00461578369140625,
0.0008311271667480469,
-0.004093170166015625,
0.035919189453125,
-0.0020542144775390625,
-0.0146636962890625,
0.00025534629821777344,
-0.042083740234375,
-0.0185089111328125,
-0.01442718505859375,
0.00516510009765625,
0.0018568038940429688,
0.0133056640625,
0.040618896484375,
-0.00936126708984375,
0.031890869140625,
0.049285888671875,
-0.00015270709991455078,
0.0218505859375,
-0.00812530517578125,
0.0191650390625,
-0.019317626953125,
0.0263824462890625,
0.046630859375,
-0.0160980224609375,
0.012939453125,
-0.0010433197021484375,
0.00907135009765625,
-0.0162353515625,
0.0276947021484375,
0.00414276123046875,
-0.0299072265625,
-0.006557464599609375,
0.0269012451171875,
0.027191162109375,
0.037689208984375,
-0.01352691650390625,
-0.0509033203125,
-0.0135955810546875,
0.0284271240234375,
-0.04925537109375,
-0.0262603759765625,
0.0022754669189453125,
-0.05316162109375,
0.006256103515625,
-0.01442718505859375,
-0.02532958984375,
-0.00408935546875,
0.0221099853515625,
0.002269744873046875,
0.02508544921875,
0.00310516357421875,
0.006359100341796875,
0.00673675537109375,
-0.037261962890625,
-0.0672607421875,
0.01311492919921875,
-0.01971435546875,
-0.0006985664367675781,
0.0221405029296875,
-0.005527496337890625,
-0.04315185546875,
0.0017232894897460938,
0.005970001220703125,
0.00824737548828125,
-0.0041656494140625,
0.0196533203125,
-0.0049591064453125,
-0.02203369140625,
0.0187530517578125,
0.0247039794921875,
-0.004711151123046875,
-0.0023403167724609375,
-0.017303466796875,
-0.029388427734375,
-0.01055908203125,
0.0179595947265625,
-0.019927978515625,
0.01441192626953125,
0.005420684814453125,
0.0111846923828125,
-0.031829833984375,
-0.013092041015625,
0.0022258758544921875,
-0.034759521484375,
0.03045654296875,
0.00945281982421875,
-0.00611114501953125,
0.0093994140625,
0.00508880615234375,
0.02117919921875,
0.00635528564453125,
-0.0023860931396484375,
0.038299560546875,
-0.0162811279296875,
-0.0165863037109375,
0.01316070556640625,
-0.002399444580078125,
0.0217437744140625,
-0.0257720947265625,
0.0132904052734375,
-0.0030422210693359375,
0.0088958740234375,
0.0083770751953125,
-0.0037441253662109375,
-0.010162353515625,
0.00843048095703125,
0.048370361328125,
-0.036529541015625,
-0.00017154216766357422,
0.0041046142578125,
-0.0203857421875,
-0.0016508102416992188,
0.05712890625,
-0.0128021240234375,
0.005977630615234375,
-0.005413055419921875,
-0.0262298583984375,
0.000736236572265625,
0.01043701171875,
-0.062255859375,
0.004848480224609375,
-0.1292724609375,
0.06231689453125,
0.0175933837890625,
-0.01111602783203125,
-0.0218963623046875,
0.005390167236328125,
-0.05841064453125,
-0.04852294921875,
0.011383056640625,
-0.0014286041259765625,
-0.01143646240234375,
0.03131103515625,
-0.01157379150390625,
-0.00597381591796875,
-0.001918792724609375,
-0.01296234130859375,
-0.021575927734375,
0.00910186767578125,
-0.061126708984375,
0.048095703125,
0.05108642578125,
-0.0137939453125,
0.01363372802734375,
0.030731201171875,
0.0178680419921875,
-0.041412353515625,
0.03167724609375,
-0.01395416259765625,
0.047119140625,
0.01354217529296875,
-0.008575439453125,
-0.00852203369140625,
-0.01218414306640625,
0.0028896331787109375,
-0.048248291015625,
0.01548004150390625,
-0.0028858184814453125,
-0.0007739067077636719,
0.0413818359375,
-0.030029296875,
-0.062255859375,
-0.043212890625,
-0.02117919921875,
0.004180908203125,
-0.0010175704956054688,
-0.005611419677734375,
-0.035552978515625,
-0.077880859375,
0.004138946533203125,
-0.01126861572265625,
-0.05194091796875,
0.0237579345703125,
0.037322998046875,
0.025299072265625,
0.003887176513671875,
-0.043701171875,
0.010040283203125,
0.048248291015625,
-0.031768798828125,
0.0250091552734375,
-0.00010257959365844727,
-0.04833984375,
0.088134765625,
0.000514984130859375,
0.01180267333984375,
-0.03765869140625,
0.07012939453125,
0.00004547834396362305,
0.01358795166015625,
0.004528045654296875,
-0.01904296875,
-0.00701141357421875,
0.015716552734375,
-0.00150299072265625,
0.005672454833984375,
-0.036651611328125,
0.0169219970703125,
0.019683837890625,
-0.003223419189453125,
-0.042266845703125,
-0.007541656494140625,
0.00958251953125,
-0.0084686279296875,
0.041168212890625,
0.02557373046875,
-0.0155792236328125,
-0.0206146240234375,
-0.030792236328125,
0.00904083251953125,
-0.034576416015625,
-0.00885772705078125,
-0.05950927734375,
0.0185394287109375,
-0.011871337890625,
-0.0316162109375,
0.017791748046875,
-0.01058197021484375,
0.06884765625,
0.021942138671875,
-0.01256561279296875,
-0.0501708984375,
-0.002315521240234375,
0.039825439453125,
-0.041717529296875,
0.0240478515625,
0.039703369140625,
0.00489044189453125,
-0.0006356239318847656,
-0.0290374755859375,
-0.0066680908203125,
0.001140594482421875,
-0.0396728515625,
-0.0042877197265625,
-0.0226898193359375,
-0.00958251953125,
-0.0193023681640625,
0.04876708984375,
0.0014486312866210938,
0.019317626953125,
-0.0158538818359375,
0.02301025390625,
-0.003528594970703125,
0.048309326171875,
0.018341064453125,
0.003086090087890625,
-0.0265045166015625,
0.0307464599609375,
-0.01555633544921875,
-0.00714874267578125,
-0.0406494140625,
0.03057861328125,
0.029571533203125,
0.01258087158203125,
0.0246124267578125,
-0.024658203125,
-0.00511932373046875,
-0.024810791015625,
0.085205078125,
-0.0029582977294921875,
-0.1097412109375,
-0.01058197021484375,
0.04046630859375,
0.0037078857421875,
-0.055206298828125,
-0.007537841796875,
-0.011444091796875,
-0.048492431640625,
-0.00975799560546875,
-0.012420654296875,
-0.01073455810546875,
-0.0183258056640625,
-0.0251617431640625,
-0.039581298828125,
-0.0226593017578125,
0.008880615234375,
-0.041748046875,
-0.023681640625,
-0.0257415771484375,
-0.031219482421875,
0.045623779296875,
-0.039031982421875,
0.02215576171875,
-0.0142974853515625,
-0.004230499267578125,
0.0242767333984375,
0.005466461181640625,
0.07720947265625,
0.0273590087890625,
-0.030548095703125,
0.0293731689453125,
0.00212860107421875,
0.0054779052734375,
-0.0284271240234375,
-0.06646728515625,
-0.031494140625,
-0.0438232421875,
0.0087890625,
0.0048370361328125,
0.006305694580078125,
0.008056640625,
-0.031219482421875,
0.04705810546875,
0.0282440185546875,
0.048919677734375,
-0.004993438720703125,
0.0301513671875,
0.0076904296875,
0.022125244140625,
0.02044677734375,
0.03228759765625,
0.00612640380859375,
-0.033966064453125,
0.036041259765625,
0.0176849365234375,
-0.034576416015625,
-0.05419921875,
0.019439697265625,
-0.0172119140625,
0.049560546875,
-0.0297393798828125,
0.004299163818359375,
0.00732421875,
-0.01007080078125,
-0.0009198188781738281,
-0.0009784698486328125,
0.0288238525390625,
0.01641845703125,
-0.00688934326171875,
-0.02203369140625,
0.024444580078125,
-0.001018524169921875,
0.037506103515625,
-0.00984954833984375,
-0.0269927978515625,
0.004238128662109375,
0.0024166107177734375,
-0.125732421875,
0.05926513671875,
0.06201171875,
0.0012693405151367188,
0.0256195068359375,
-0.033935546875,
0.0058746337890625,
0.0178680419921875,
-0.040130615234375,
0.04638671875,
0.033477783203125,
0.04351806640625,
-0.0269317626953125,
-0.0066375732421875,
0.0103607177734375,
-0.028106689453125,
0.03125,
0.034332275390625,
0.0625,
-0.07958984375,
0.04156494140625,
0.021087646484375,
0.005970001220703125,
0.0797119140625,
-0.0036563873291015625,
0.0248870849609375,
-0.0310211181640625,
-0.0115203857421875,
-0.0001417398452758789,
-0.02978515625,
-0.02935791015625,
-0.02825927734375,
-0.01461029052734375,
0.00811004638671875,
0.041168212890625,
0.0272979736328125,
-0.04840087890625,
-0.0016908645629882812,
0.0152587890625,
-0.00821685791015625,
-0.0285186767578125,
-0.0093536376953125,
0.006931304931640625,
-0.0192108154296875,
-0.0731201171875,
-0.01094818115234375,
-0.03253173828125,
0.0117645263671875,
0.0361328125,
0.007717132568359375,
0.02655029296875,
0.0406494140625,
-0.017333984375,
0.03619384765625,
-0.01482391357421875,
0.00319671630859375,
0.005252838134765625,
-0.0182647705078125,
0.0016603469848632812,
0.0032291412353515625,
-0.0263519287109375,
0.020050048828125,
-0.01409149169921875,
-0.02862548828125,
-0.0154266357421875,
-0.01453399658203125,
0.08538818359375,
-0.0277557373046875,
-0.027252197265625,
-0.00998687744140625,
0.0181732177734375,
0.017242431640625,
-0.0195770263671875,
0.033905029296875,
-0.1219482421875,
-0.10076904296875,
0.00939178466796875,
-0.0877685546875,
-0.0156707763671875,
-0.01934814453125,
-0.059478759765625,
0.10589599609375,
-0.01403045654296875,
0.004669189453125,
-0.038238525390625,
0.06640625,
-0.00843048095703125,
0.032501220703125,
-0.0284576416015625,
0.02752685546875,
0.04278564453125,
0.01259613037109375,
-0.00445556640625,
-0.01143646240234375,
0.0164337158203125,
0.01349639892578125,
0.019927978515625,
0.0193023681640625,
-0.009613037109375,
-0.0286407470703125,
-0.02685546875,
0.031463623046875,
0.0028839111328125,
0.017303466796875,
-0.0030345916748046875,
-0.007556915283203125,
0.0216522216796875,
-0.01320648193359375,
0.03369140625,
-0.0033550262451171875,
-0.0262298583984375,
0.02447509765625,
0.0011568069458007812,
-0.030731201171875,
0.009246826171875,
0.0158843994140625,
-0.052734375,
0.0179595947265625,
0.016998291015625,
-0.00463104248046875,
-0.0139312744140625,
0.055450439453125,
0.031585693359375,
-0.0078887939453125,
0.01088714599609375,
-0.03814697265625,
0.04962158203125,
-0.0068359375,
-0.009796142578125,
0.0117340087890625,
0.029998779296875,
-0.048614501953125,
-0.06121826171875,
-0.004180908203125,
0.0162353515625,
-0.056304931640625,
0.0670166015625,
0.02703857421875,
0.038116455078125,
-0.023651123046875,
-0.01739501953125,
0.026519775390625,
0.0848388671875,
-0.0360107421875,
-0.027496337890625,
-0.003314971923828125,
0.0006093978881835938,
0.04644775390625,
0.00571441650390625,
0.0841064453125,
-0.02728271484375,
-0.027801513671875,
-0.0158233642578125,
0.018798828125,
0.040374755859375,
-0.004886627197265625,
0.008697509765625,
0.02313232421875,
-0.048004150390625,
0.05621337890625,
-0.005329132080078125,
-0.0164947509765625,
0.015228271484375,
0.038330078125,
0.02935791015625,
0.004917144775390625,
-0.021209716796875,
-0.01629638671875,
0.023040771484375,
-0.0094146728515625,
-0.04412841796875,
-0.009796142578125,
-0.0158538818359375,
-0.0472412109375,
-0.007373809814453125,
0.038787841796875,
-0.0013036727905273438,
-0.0049896240234375,
0.0350341796875,
0.0183868408203125,
-0.0102081298828125,
-0.01381683349609375,
0.041717529296875,
-0.0158538818359375,
-0.01250457763671875,
-0.00970458984375,
-0.0203094482421875,
0.00937652587890625,
0.00534820556640625,
0.006252288818359375,
0.0196075439453125,
0.01253509521484375,
-0.011016845703125,
0.028472900390625,
0.0118255615234375,
-0.023193359375,
0.033203125,
-0.00167083740234375,
0.08209228515625,
0.032073974609375,
-0.08148193359375,
-0.026947021484375,
0.028350830078125,
-0.0291595458984375,
0.01495361328125,
0.03253173828125,
-0.0301361083984375,
0.0311431884765625,
-0.030670166015625,
0.01361083984375,
-0.01456451416015625,
-0.005207061767578125,
0.00916290283203125,
-0.0181732177734375,
0.01091766357421875,
-0.0125274658203125,
-0.0303497314453125,
-0.0157623291015625,
-0.0183563232421875,
0.004039764404296875,
0.019378662109375,
0.01329803466796875,
0.02392578125,
0.021728515625,
-0.03485107421875,
0.033599853515625,
-0.051422119140625,
-0.00902557373046875,
-0.045257568359375,
0.020355224609375,
0.023468017578125,
-0.006153106689453125,
-0.06201171875,
0.023406982421875,
0.018951416015625,
-0.015472412109375,
0.0292205810546875,
0.0025844573974609375,
0.00399017333984375,
-0.016876220703125,
0.010406494140625,
-0.018951416015625,
-0.017791748046875,
-0.0218048095703125,
-0.0284576416015625,
0.034149169921875,
0.0224609375,
-0.000995635986328125,
0.0501708984375,
0.0265350341796875,
-0.0024623870849609375,
0.0272369384765625,
-0.046783447265625,
0.053924560546875,
0.032806396484375,
0.01032257080078125,
0.0274200439453125,
-0.029693603515625,
-0.023712158203125,
0.01519012451171875,
-0.0089111328125,
-0.01476287841796875,
-0.004734039306640625,
-0.00492095947265625,
0.0941162109375,
0.02020263671875,
0.060791015625,
-0.02288818359375,
0.0132904052734375,
0.0140838623046875,
0.041351318359375,
0.0117950439453125,
-0.0226898193359375,
-0.03594970703125,
-0.06903076171875,
-0.01456451416015625,
0.01442718505859375,
-0.04669189453125,
-0.06536865234375,
-0.08734130859375,
0.014068603515625,
0.0294189453125,
0.0200958251953125,
-0.0665283203125,
0.03326416015625,
-0.0080413818359375,
0.024322509765625,
0.0191192626953125,
0.0264892578125,
-0.0205841064453125,
-0.01229095458984375,
-0.01497650146484375,
-0.033935546875,
-0.0286407470703125,
0.0611572265625,
-0.00803375244140625,
-0.03826904296875,
-0.0097808837890625,
0.01325225830078125,
-0.004718780517578125,
-0.059356689453125,
-0.03509521484375,
-0.01104736328125,
-0.006664276123046875,
-0.016143798828125,
0.01715087890625,
-0.006816864013671875,
-0.0186920166015625,
-0.016693115234375,
-0.01172637939453125,
-0.0097503662109375,
-0.0254669189453125,
0.0255126953125,
-0.0345458984375,
-0.02410888671875,
-0.042938232421875,
-0.03302001953125,
0.01486968994140625,
0.0185699462890625,
-0.0369873046875,
0.0170440673828125,
0.03240966796875,
-0.01763916015625,
0.0251922607421875,
0.0274810791015625,
-0.0180511474609375,
0.01168060302734375,
-0.034088134765625,
0.02984619140625,
0.031829833984375,
-0.0123748779296875,
0.066650390625,
-0.0286102294921875,
0.047210693359375,
0.024658203125,
-0.006893157958984375,
-0.0218353271484375,
0.021392822265625,
0.00926971435546875,
0.038238525390625,
-0.00890350341796875,
-0.032867431640625,
0.005741119384765625,
-0.0305023193359375,
0.0021305084228515625,
-0.0121002197265625,
-0.00426483154296875,
0.005725860595703125,
0.016845703125,
0.02069091796875,
0.0108184814453125,
-0.02508544921875,
-0.04376220703125,
-0.061370849609375,
0.0129852294921875,
-0.05621337890625,
0.0075836181640625,
-0.10980224609375,
-0.042236328125,
0.01250457763671875,
-0.0259246826171875,
-0.001251220703125,
0.023712158203125,
-0.0234527587890625,
0.0144500732421875,
0.054534912109375,
-0.009857177734375,
-0.00823974609375,
0.00954437255859375,
0.08251953125,
-0.048095703125,
0.00055694580078125,
-0.0017061233520507812,
0.0084075927734375,
0.03240966796875,
-0.037750244140625,
0.003414154052734375,
-0.01080322265625,
-0.03460693359375,
0.0249481201171875,
-0.01070404052734375,
0.04644775390625,
-0.04168701171875,
-0.045623779296875,
-0.01354217529296875,
0.01125335693359375,
-0.0024051666259765625,
-0.00787353515625,
-0.044158935546875,
0.057830810546875,
0.01561737060546875,
0.05621337890625,
-0.0209197998046875,
-0.0006785392761230469,
-0.01377105712890625,
0.024169921875,
0.01241302490234375,
-0.000934600830078125,
0.059234619140625,
-0.03814697265625,
0.00833892822265625,
-0.023590087890625,
0.0567626953125,
-0.05340576171875,
0.057769775390625,
-0.00463104248046875,
0.024749755859375,
0.0355224609375
] |
3b1a927122d6c31a57af48df428ac20e8dafaa14
|
Wordpress Stackexchange
Q: How to order posts tag by tag? I want to order my posts by tags with only one WP_Query()
In my WP_Query I would like to display
2 posts with tags portrait
2 posts with tags paysage
2 posts with tags portrait
2 posts with tags paysage
2 posts with tags portrait
2 posts with tags paysage
Etc...
And I need to order these posts by recents.
What is the query to do that ?
Thanks
PS : Sorry I cannot use code because I'm with my iPhone.
A: Like Eugene mentioned in his answer you need to run a query for each tag. I would create a foreach loop that went through each tag then queried the latest 2 posts from each.
$tags = get_tags();
foreach ( $tags as $tag ) {
echo '<h3>' .$tag->name. '</h3>';
$tag_query = new WP_Query( array(
'tag_id' => $tag->term_id,
'posts_per_page' => 2,
'no_found_rows' => true,
) );
while ( $tag_query->have_posts() ) : $tag_query->the_post();
// Do stuff
endwhile; wp_reset_postdata();
}
|
Q: How to order posts tag by tag? I want to order my posts by tags with only one WP_Query()
In my WP_Query I would like to display
2 posts with tags portrait
2 posts with tags paysage
2 posts with tags portrait
2 posts with tags paysage
2 posts with tags portrait
2 posts with tags paysage
Etc...
And I need to order these posts by recents.
What is the query to do that ?
Thanks
PS : Sorry I cannot use code because I'm with my iPhone.
A: Like Eugene mentioned in his answer you need to run a query for each tag. I would create a foreach loop that went through each tag then queried the latest 2 posts from each.
$tags = get_tags();
foreach ( $tags as $tag ) {
echo '<h3>' .$tag->name. '</h3>';
$tag_query = new WP_Query( array(
'tag_id' => $tag->term_id,
'posts_per_page' => 2,
'no_found_rows' => true,
) );
while ( $tag_query->have_posts() ) : $tag_query->the_post();
// Do stuff
endwhile; wp_reset_postdata();
}
A: It's impossible to do with one query, even from database point of view (without unions).
I would recommend you to use separate queries for each term. Don't invent a wheal, don't over complicate your code.
|
wordpress
|
{
"language": "en",
"length": 202,
"provenance": "stackexchange_00019.jsonl.gz:420871",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/55375"
}
|
[
0.0869140625,
0.00823974609375,
0.005382537841796875,
-0.01263427734375,
0.04766845703125,
-0.047332763671875,
0.10040283203125,
-0.0152130126953125,
0.00009584426879882812,
0.03955078125,
-0.032379150390625,
0.01314544677734375,
-0.0147552490234375,
-0.0084686279296875,
-0.039794921875,
-0.034149169921875,
0.048309326171875,
-0.057464599609375,
0.0152130126953125,
0.0034656524658203125,
0.01067352294921875,
0.033477783203125,
0.0345458984375,
0.0190582275390625,
0.025909423828125,
0.0171661376953125,
0.04608154296875,
-0.03460693359375,
0.04278564453125,
-0.01050567626953125,
0.0247802734375,
-0.051300048828125,
0.0289306640625,
-0.017669677734375,
-0.0011301040649414062,
-0.034149169921875,
0.00907135009765625,
-0.02154541015625,
-0.01105499267578125,
0.022552490234375,
0.039337158203125,
-0.01263427734375,
-0.0186920166015625,
0.0211334228515625,
-0.015899658203125,
-0.01959228515625,
0.04156494140625,
-0.0294036865234375,
0.021820068359375,
-0.016937255859375,
0.0302276611328125,
-0.00022900104522705078,
0.04156494140625,
-0.022430419921875,
-0.0528564453125,
-0.025390625,
-0.01129913330078125,
-0.0151214599609375,
0.015594482421875,
-0.00921630859375,
-0.01085662841796875,
0.0008406639099121094,
0.019683837890625,
0.003963470458984375,
-0.016448974609375,
0.0026187896728515625,
0.07110595703125,
-0.0008664131164550781,
-0.04937744140625,
-0.03009033203125,
0.0396728515625,
-0.017242431640625,
-0.005519866943359375,
-0.0219573974609375,
0.00453948974609375,
-0.007595062255859375,
-0.0115509033203125,
-0.0240325927734375,
0.01361083984375,
0.00804901123046875,
0.0005097389221191406,
-0.01690673828125,
-0.047576904296875,
0.00563812255859375,
-0.04278564453125,
-0.021697998046875,
-0.006744384765625,
0.0173187255859375,
-0.0178375244140625,
-0.0400390625,
-0.0191650390625,
-0.014373779296875,
-0.038543701171875,
0.0281829833984375,
-0.01284027099609375,
-0.01384735107421875,
0.01202392578125,
0.03326416015625,
0.007354736328125,
0.00885009765625,
-0.01435089111328125,
-0.043609619140625,
0.01140594482421875,
-0.0232391357421875,
0.019378662109375,
-0.00830841064453125,
-0.0115203857421875,
0.015869140625,
0.06884765625,
0.059600830078125,
-0.01123809814453125,
0.0307159423828125,
-0.00394439697265625,
-0.01087188720703125,
-0.027801513671875,
-0.0123748779296875,
-0.033477783203125,
-0.0006051063537597656,
-0.000659942626953125,
-0.032012939453125,
-0.01232147216796875,
0.00380706787109375,
-0.0027828216552734375,
0.01020050048828125,
-0.0001844167709350586,
0.004974365234375,
-0.018341064453125,
-0.0164947509765625,
-0.03350830078125,
-0.00064849853515625,
-0.018646240234375,
0.037017822265625,
0.058990478515625,
0.0213775634765625,
-0.0240631103515625,
-0.0034313201904296875,
0.005001068115234375,
-0.055694580078125,
0.00162506103515625,
0.00833892822265625,
0.01342010498046875,
-0.028900146484375,
0.0068817138671875,
0.00864410400390625,
0.01788330078125,
0.01186370849609375,
0.028594970703125,
0.007843017578125,
-0.01384735107421875,
-0.01216888427734375,
0.0217742919921875,
0.00075531005859375,
0.020263671875,
-0.0181884765625,
-0.0265960693359375,
-0.0205230712890625,
-0.013214111328125,
0.0009436607360839844,
0.002239227294921875,
-0.0168304443359375,
-0.0201568603515625,
-0.000698089599609375,
0.03851318359375,
-0.0357666015625,
-0.0404052734375,
0.0166168212890625,
-0.036651611328125,
-0.01314544677734375,
0.040069580078125,
-0.0184783935546875,
0.00531005859375,
-0.01526641845703125,
0.122314453125,
0.0258941650390625,
-0.01690673828125,
0.042938232421875,
-0.005130767822265625,
-0.026885986328125,
0.0301361083984375,
0.0167388916015625,
-0.0310211181640625,
-0.0281982421875,
0.0013246536254882812,
-0.00930023193359375,
-0.06060791015625,
0.04290771484375,
0.01435089111328125,
0.05157470703125,
-0.0125579833984375,
0.022369384765625,
0.052520751953125,
0.02569580078125,
-0.029510498046875,
0.04669189453125,
0.0155029296875,
-0.0243072509765625,
-0.0275726318359375,
0.01142120361328125,
0.00434112548828125,
-0.06280517578125,
-0.01058197021484375,
0.040924072265625,
-0.04638671875,
0.01438140869140625,
-0.038970947265625,
-0.0042877197265625,
-0.002414703369140625,
0.03228759765625,
-0.0126800537109375,
-0.00617218017578125,
0.0265655517578125,
-0.01184844970703125,
-0.0254364013671875,
-0.0169525146484375,
-0.0360107421875,
0.00720977783203125,
-0.0171356201171875,
-0.0215301513671875,
-0.01137542724609375,
-0.008819580078125,
-0.003337860107421875,
-0.002124786376953125,
-0.0188140869140625,
0.0309295654296875,
0.06439208984375,
0.003688812255859375,
-0.011260986328125,
-0.00841522216796875,
0.038055419921875,
0.032684326171875,
-0.059722900390625,
-0.00704193115234375,
0.031494140625,
0.05963134765625,
-0.018402099609375,
-0.006839752197265625,
0.027313232421875,
-0.00562286376953125,
0.017822265625,
0.027313232421875,
0.0201416015625,
0.017425537109375,
0.0016908645629882812,
0.0369873046875,
0.060028076171875,
-0.026275634765625,
-0.006195068359375,
0.025115966796875,
0.0163421630859375,
0.0307464599609375,
0.0032672882080078125,
-0.0011529922485351562,
0.030609130859375,
-0.0016155242919921875,
0.0287322998046875,
0.023895263671875,
0.0156707763671875,
0.06365966796875,
0.0068511962890625,
-0.0347900390625,
-0.01502227783203125,
-0.019989013671875,
-0.0054473876953125,
-0.029541015625,
-0.005329132080078125,
0.0178985595703125,
0.006954193115234375,
0.009368896484375,
-0.0207061767578125,
0.006671905517578125,
0.01435089111328125,
0.0037097930908203125,
0.0153045654296875,
0.0003330707550048828,
-0.094970703125,
0.00443267822265625,
-0.0112457275390625,
0.0250244140625,
0.00920867919921875,
-0.0246429443359375,
0.02447509765625,
0.07177734375,
-0.0093994140625,
0.0017843246459960938,
-0.031494140625,
-0.030853271484375,
-0.00693511962890625,
0.06060791015625,
-0.04156494140625,
0.0005083084106445312,
0.01110076904296875,
0.062255859375,
-0.021331787109375,
0.03045654296875,
-0.01528167724609375,
0.0235595703125,
-0.0191497802734375,
-0.040008544921875,
0.0298309326171875,
-0.0280609130859375,
0.06805419921875,
0.087158203125,
0.0027942657470703125,
0.032684326171875,
0.00524139404296875,
0.0335693359375,
0.0123138427734375,
-0.00846099853515625,
-0.01061248779296875,
0.0002655982971191406,
-0.0421142578125,
0.020782470703125,
0.031646728515625,
0.036529541015625,
0.0015392303466796875,
-0.045654296875,
-0.007221221923828125,
0.030670166015625,
-0.0946044921875,
-0.09521484375,
0.011474609375,
-0.0460205078125,
-0.00005412101745605469,
0.00568389892578125,
-0.0283355712890625,
-0.0174713134765625,
0.032867431640625,
-0.0032806396484375,
-0.041168212890625,
-0.0121917724609375,
-0.06707763671875,
-0.050323486328125,
-0.048309326171875,
0.0775146484375,
0.003459930419921875,
0.0230560302734375,
0.025115966796875,
0.07977294921875,
0.02496337890625,
-0.04901123046875,
0.0467529296875,
-0.05322265625,
-0.052490234375,
0.037445068359375,
0.0081787109375,
-0.0287628173828125,
0.00469970703125,
0.0011644363403320312,
0.0169219970703125,
0.00960540771484375,
-0.00151824951171875,
0.0075225830078125,
-0.00685882568359375,
-0.00991058349609375,
0.022125244140625,
-0.002521514892578125,
-0.007366180419921875,
0.0215301513671875,
0.01873779296875,
-0.0292205810546875,
-0.004329681396484375,
-0.02606201171875,
-0.0281829833984375,
-0.00785064697265625,
-0.0162811279296875,
0.0235748291015625,
-0.0345458984375,
0.0194244384765625,
-0.006954193115234375,
0.00007385015487670898,
-0.00472259521484375,
-0.025238037109375,
0.00836944580078125,
0.020263671875,
0.005970001220703125,
0.01959228515625,
-0.01302337646484375,
-0.03582763671875,
0.0177154541015625,
-0.033050537109375,
-0.014556884765625,
-0.05352783203125,
0.012420654296875,
-0.07940673828125,
-0.032623291015625,
0.0182342529296875,
-0.013458251953125,
-0.0019397735595703125,
-0.0009083747863769531,
-0.0209808349609375,
0.003604888916015625,
0.0577392578125,
-0.027679443359375,
0.0023040771484375,
-0.0214691162109375,
-0.016693115234375,
-0.0037288665771484375,
-0.00910186767578125,
-0.0567626953125,
0.0055999755859375,
-0.06805419921875,
-0.021484375,
-0.0171356201171875,
-0.040802001953125,
-0.01384735107421875,
-0.03497314453125,
-0.041656494140625,
-0.03729248046875,
0.051300048828125,
-0.04443359375,
-0.0018224716186523438,
-0.007289886474609375,
-0.01007843017578125,
-0.015777587890625,
-0.0445556640625,
0.00832366943359375,
-0.03546142578125,
-0.0003604888916015625,
-0.002552032470703125,
-0.0039520263671875,
-0.00930023193359375,
0.01119232177734375,
0.0030040740966796875,
0.0273590087890625,
-0.0009279251098632812,
0.0506591796875,
-0.0069122314453125,
0.0266265869140625,
0.0028667449951171875,
-0.03472900390625,
-0.0019817352294921875,
-0.044342041015625,
-0.0260467529296875,
-0.043670654296875,
0.0254974365234375,
0.02801513671875,
-0.038787841796875,
0.032135009765625,
-0.059417724609375,
0.0202178955078125,
-0.06005859375,
-0.0323486328125,
-0.03265380859375,
-0.029937744140625,
-0.0147857666015625,
-0.00551605224609375,
-0.0016422271728515625,
-0.058013916015625,
0.034393310546875,
0.0217742919921875,
-0.01377105712890625,
0.0118560791015625,
0.07916259765625,
0.0138397216796875,
-0.0156402587890625,
-0.0853271484375,
0.00641632080078125,
0.045928955078125,
0.00037741661071777344,
0.01910400390625,
0.01995849609375,
-0.042755126953125,
0.058685302734375,
0.025665283203125,
-0.03619384765625,
0.00894927978515625,
0.049102783203125,
-0.0203399658203125,
-0.048004150390625,
0.0124053955078125,
-0.038482666015625,
0.01337432861328125,
0.039520263671875,
0.0005674362182617188,
-0.055450439453125,
0.0021152496337890625,
0.06109619140625,
0.0023517608642578125,
-0.00246429443359375,
-0.03662109375,
-0.04364013671875,
0.0233001708984375,
0.056427001953125,
-0.01548004150390625,
-0.0007429122924804688,
-0.004024505615234375,
-0.0006952285766601562,
0.0016965866088867188,
0.002044677734375,
-0.00351715087890625,
0.0211029052734375,
-0.0242919921875,
0.038848876953125,
-0.0186004638671875,
-0.015228271484375,
0.002307891845703125,
-0.005153656005859375,
0.03955078125,
0.020294189453125,
-0.0303955078125,
0.0070037841796875,
-0.00554656982421875,
0.01215362548828125,
-0.0049285888671875,
-0.0196990966796875,
0.0099334716796875,
0.002094268798828125,
0.0080718994140625,
0.0313720703125,
-0.05633544921875,
0.0018129348754882812,
-0.0185699462890625,
-0.0062255859375,
-0.0009860992431640625,
-0.016143798828125,
-0.0177764892578125,
0.02069091796875,
-0.0293426513671875,
0.00901031494140625,
0.0022716522216796875,
-0.0196075439453125,
-0.04913330078125,
-0.00037288665771484375,
0.027557373046875,
0.009552001953125,
0.01885986328125,
-0.02471923828125,
0.04986572265625,
-0.033172607421875,
0.011749267578125,
-0.0009312629699707031,
0.034912109375,
-0.00797271728515625,
-0.03997802734375,
0.04052734375,
-0.0146331787109375,
-0.01477813720703125,
0.00899505615234375,
0.033538818359375,
0.0175933837890625,
-0.040313720703125,
-0.0271759033203125,
0.032958984375,
0.03729248046875,
-0.015533447265625,
0.05865478515625,
-0.034027099609375,
0.0404052734375,
-0.00302886962890625,
0.0238037109375,
-0.01027679443359375,
-0.00909423828125,
0.00806427001953125,
-0.026885986328125,
-0.041717529296875,
0.020477294921875,
-0.005191802978515625,
-0.003063201904296875,
-0.0084991455078125,
0.00653839111328125,
-0.01471710205078125,
0.04144287109375,
-0.0298919677734375,
-0.0277099609375,
-0.0305023193359375,
-0.004444122314453125,
0.07452392578125,
0.047119140625,
-0.005889892578125,
-0.004215240478515625,
-0.036468505859375,
-0.0251922607421875,
0.03253173828125,
-0.0185089111328125,
-0.039093017578125,
-0.0286865234375,
0.0292816162109375,
0.03717041015625,
-0.008697509765625,
-0.0556640625,
-0.033172607421875,
-0.0243682861328125,
0.0251922607421875,
0.0151214599609375,
-0.002994537353515625,
0.060455322265625,
-0.0090484619140625,
0.037689208984375,
0.0077362060546875,
0.0250091552734375,
-0.0156402587890625,
-0.021942138671875,
0.0193939208984375,
-0.06658935546875,
-0.039337158203125,
-0.0012426376342773438,
-0.03369140625,
-0.002651214599609375,
0.005580902099609375,
-0.01158905029296875,
0.02716064453125,
-0.021148681640625,
0.0164794921875,
0.0034351348876953125,
-0.027313232421875,
-0.0198211669921875,
-0.0285797119140625,
0.0780029296875,
-0.00893402099609375,
-0.0121307373046875,
-0.0023136138916015625,
0.0162506103515625,
0.0025081634521484375,
0.007511138916015625,
-0.0005249977111816406,
-0.014434814453125,
-0.0002684593200683594,
-0.0247039794921875,
0.011077880859375,
0.0254669189453125,
0.0272369384765625,
-0.032440185546875,
0.023284912109375,
0.01242828369140625,
-0.01218414306640625,
-0.0216217041015625,
0.0285186767578125,
0.058685302734375,
-0.0008292198181152344,
-0.0110321044921875,
0.032928466796875,
-0.036163330078125,
-0.012786865234375,
0.002197265625,
0.01495361328125,
-0.005062103271484375,
0.0008993148803710938,
-0.007579803466796875,
-0.0114898681640625,
0.01824951171875,
0.0208892822265625,
-0.020721435546875,
-0.0638427734375,
0.04144287109375,
-0.01073455810546875,
0.00972747802734375,
0.0193328857421875,
-0.01390838623046875,
0.0038051605224609375,
0.0024585723876953125,
0.056549072265625,
0.001850128173828125,
-0.06591796875,
-0.005615234375,
0.029022216796875,
-0.0155792236328125,
0.00045752525329589844,
-0.0004131793975830078,
-0.00019884109497070312,
-0.0223236083984375,
-0.0799560546875,
-0.024871826171875,
-0.0159912109375,
-0.02197265625,
-0.0005903244018554688,
-0.053955078125,
0.007495880126953125,
0.0008559226989746094,
-0.0208282470703125,
-0.0205078125,
-0.015625,
-0.079345703125,
-0.037139892578125,
-0.0174407958984375,
0.0019855499267578125,
0.0179901123046875,
-0.014251708984375,
0.01314544677734375,
-0.00970458984375,
-0.01486968994140625,
-0.0079345703125,
-0.03631591796875,
0.004199981689453125,
-0.0126190185546875,
0.0035495758056640625,
0.03204345703125,
0.048309326171875,
0.01007080078125,
0.0109100341796875,
0.0263671875,
-0.044097900390625,
-0.04840087890625,
0.021636962890625,
-0.0318603515625,
-0.009307861328125,
-0.000682830810546875,
-0.08251953125,
0.1312255859375,
0.001018524169921875,
0.047882080078125,
-0.0034618377685546875,
0.065185546875,
-0.040313720703125,
0.0203704833984375,
-0.0274658203125,
0.048126220703125,
-0.053741455078125,
0.05169677734375,
-0.053253173828125,
0.0109100341796875,
0.0201416015625,
0.039093017578125,
0.05108642578125,
-0.000007331371307373047,
-0.047271728515625,
-0.01519012451171875,
0.06494140625,
0.046295166015625,
0.01413726806640625,
0.04803466796875,
-0.0008997917175292969,
0.006389617919921875,
0.00652313232421875,
-0.029327392578125,
0.0380859375,
-0.026336669921875,
-0.01506805419921875,
0.038726806640625,
0.0224761962890625,
0.017059326171875,
-0.03955078125,
-0.020721435546875,
-0.033203125,
-0.00537109375,
0.035491943359375,
0.0005521774291992188,
0.041107177734375,
-0.004489898681640625,
0.061981201171875,
-0.0889892578125,
-0.07470703125,
-0.004131317138671875,
0.037139892578125,
0.0293121337890625,
0.046112060546875,
0.0162353515625,
0.040771484375,
0.01430511474609375,
-0.02752685546875,
0.0372314453125,
0.00530242919921875,
-0.0804443359375,
0.0762939453125,
0.01476287841796875,
0.03759765625,
-0.05841064453125,
-0.0352783203125,
0.035675048828125,
0.0860595703125,
-0.0423583984375,
0.019439697265625,
0.00905609130859375,
-0.0203399658203125,
-0.01593017578125,
-0.057281494140625,
-0.0169219970703125,
0.020050048828125,
-0.004608154296875,
-0.03704833984375,
-0.016815185546875,
0.0098876953125,
0.010345458984375,
-0.0023174285888671875,
0.007526397705078125,
0.01146697998046875,
-0.0252838134765625,
-0.0380859375,
0.0251007080078125,
0.03680419921875,
0.01291656494140625,
-0.032135009765625,
0.051971435546875,
0.01023101806640625,
0.00867462158203125,
-0.00827789306640625,
0.035858154296875,
0.00018417835235595703,
0.017486572265625,
-0.033843994140625,
-0.054718017578125,
0.01525115966796875,
0.043243408203125,
0.004207611083984375,
-0.0030307769775390625,
0.020294189453125,
0.06439208984375,
0.00510406494140625,
-0.0295867919921875,
0.07012939453125,
0.005401611328125,
-0.06610107421875,
-0.0084991455078125,
-0.0438232421875,
0.0272979736328125,
-0.0152130126953125,
0.0576171875,
0.0136566162109375,
0.01104736328125,
-0.0194244384765625,
0.02435302734375,
0.0005054473876953125,
0.0069580078125,
0.0135040283203125,
0.0005888938903808594,
-0.00629425048828125,
0.015777587890625,
-0.08447265625,
-0.0011625289916992188,
-0.07623291015625,
-0.0189056396484375,
0.03192138671875,
0.031829833984375,
-0.0062255859375,
0.02423095703125,
0.0263214111328125,
-0.0546875,
0.0179595947265625,
0.0205078125,
0.039947509765625,
0.0987548828125,
-0.0079345703125,
0.041046142578125,
-0.08721923828125,
-0.048980712890625,
-0.00489044189453125,
0.021240234375,
0.01898193359375,
-0.00574493408203125,
0.052734375,
0.016998291015625,
-0.038299560546875,
0.0119171142578125,
-0.040924072265625,
-0.044708251953125,
0.060821533203125,
-0.01812744140625,
-0.033447265625,
0.006092071533203125,
0.050262451171875,
0.0163421630859375,
0.03741455078125,
-0.032867431640625,
-0.01088714599609375,
-0.038055419921875,
0.01629638671875,
0.00033736228942871094,
0.0657958984375,
-0.0155029296875,
-0.02587890625,
-0.0540771484375,
-0.0273590087890625,
0.0262603759765625,
0.05194091796875,
0.0231170654296875,
0.0390625,
-0.0035247802734375,
-0.0169219970703125,
0.02105712890625,
-0.036468505859375,
0.032257080078125,
0.0264434814453125,
-0.0276947021484375,
-0.0190582275390625,
0.004085540771484375,
-0.0194091796875,
-0.0015859603881835938,
0.0199432373046875,
0.002330780029296875,
0.0140533447265625,
-0.0119781494140625,
0.0165252685546875,
0.020477294921875,
0.07171630859375,
0.01971435546875,
0.035980224609375,
-0.03179931640625,
0.003978729248046875,
0.0028133392333984375,
0.0281829833984375,
-0.0372314453125,
-0.013336181640625,
0.01470184326171875,
0.00896453857421875,
0.019195556640625,
-0.0167694091796875,
-0.047088623046875,
-0.0207061767578125,
0.00882720947265625,
-0.014984130859375,
0.029083251953125,
-0.03961181640625,
-0.006107330322265625,
-0.011077880859375,
-0.0036411285400390625,
-0.051361083984375,
0.015838623046875,
0.00022840499877929688,
-0.0305023193359375,
-0.005680084228515625,
-0.036895751953125,
-0.0150299072265625,
-0.017791748046875,
0.0188446044921875,
0.00942230224609375,
-0.03143310546875,
0.017669677734375,
0.037841796875,
0.037017822265625,
0.0638427734375,
0.029876708984375,
0.012908935546875,
0.01345062255859375,
0.021759033203125,
-0.04986572265625,
-0.07275390625,
0.0202789306640625,
-0.0236358642578125,
0.00089263916015625,
-0.0207672119140625,
0.02325439453125,
0.039947509765625,
-0.033935546875,
-0.09100341796875,
0.095947265625,
-0.043701171875,
-0.0311737060546875,
-0.01140594482421875,
0.026214599609375,
-0.00017774105072021484,
-0.0101776123046875,
0.006496429443359375,
-0.02178955078125,
0.0033130645751953125,
0.0059967041015625,
0.00891876220703125,
0.052459716796875,
0.00420379638671875,
0.00594329833984375,
-0.031036376953125,
0.0183868408203125,
-0.0126495361328125,
0.021240234375,
-0.01062774658203125,
-0.00848388671875,
0.009307861328125,
0.0220489501953125,
-0.04864501953125,
0.001983642578125,
0.0081939697265625,
0.0294036865234375,
0.0033359527587890625,
-0.0123291015625,
-0.032684326171875,
-0.0254058837890625,
0.02374267578125,
0.04522705078125,
0.010955810546875,
-0.00907135009765625,
-0.00730133056640625,
-0.018280029296875,
-0.0159149169921875,
0.00118255615234375,
0.0123138427734375,
-0.038177490234375,
-0.00617218017578125,
0.0208587646484375,
0.00551605224609375,
0.0025959014892578125,
-0.039215087890625,
-0.0428466796875,
-0.01262664794921875,
-0.052703857421875,
0.021697998046875,
-0.09112548828125,
0.039031982421875,
-0.000637054443359375,
-0.0228729248046875,
-0.03656005859375,
-0.01557159423828125,
-0.01031494140625,
-0.031951904296875,
-0.026031494140625,
0.00533294677734375,
-0.010040283203125,
0.02252197265625,
0.014190673828125,
0.0382080078125,
-0.005237579345703125,
0.037841796875,
-0.00252532958984375,
-0.03179931640625,
-0.0022125244140625,
0.015380859375,
-0.00725555419921875,
-0.00574493408203125,
0.005275726318359375,
0.0307769775390625,
0.004547119140625,
-0.003917694091796875,
0.0711669921875,
0.002902984619140625,
0.044708251953125,
-0.02978515625,
-0.004772186279296875,
0.00806427001953125,
-0.023956298828125,
-0.00597381591796875,
0.01235198974609375,
0.00673675537109375,
-0.01477813720703125,
0.0022182464599609375,
0.01568603515625,
0.00954437255859375,
0.01007843017578125
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.