我已經爲首頁項目操作構建了多個動態側欄。每個側欄包含一個Text小部件,並且我想從wp_options中檢索每個小部件的內容(根據小部件ID)。在WordPress中使用MySQL查詢檢索小部件數據
基本上,該結構是dbName -> wp_options -> option_id #92
包含以下內容:
a:9:{i:2;a:0:{}i:3;a:3: {s:5:"title";s:0:"";s:4:"text";s:2:"mainItem";s:6:"filter";b:0;}i:4;a:3: {s:5:"title";s:0:"";s:4:"text";s:9:"leftThree";s:6:"filter";b:0;}i:5;a:3: {s:5:"title";s:0:"";s:4:"text";s:10:"rightThree";s:6:"filter";b:0;}i:6;a:3: {s:5:"title";s:0:"";s:4:"text";s:8:"rightTwo";s:6:"filter";b:0;}i:7;a:3: {s:5:"title";s:0:"";s:4:"text";s:8:"rightOne";s:6:"filter";b:0;}i:8;a:3: {s:5:"title";s:0:"";s:4:"text";s:7:"leftOne";s:6:"filter";b:0;}i:9;a:3: {s:5:"title";s:0:"";s:4:"text";s:7:"leftTwo";s:6:"filter";b:0;} s:12:"_multiwidget";i:1;}
[實際上所有在一行上。]
我想要檢索以下字符串:
- mainItem
- leftOne/leftTwo/leftThree
- rightOne/rightTwo/rightThree
有什麼語法這樣的查詢?我如何將它添加到PHP模板?