日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > php >内容正文

php

python 类似wordpress_python,_python 有没有类似WordPress的这种库?,python - phpStudy

發(fā)布時間:2024/7/5 php 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python 类似wordpress_python,_python 有没有类似WordPress的这种库?,python - phpStudy 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

python 有沒有類似WordPress的這種庫?

例如:WordPress博客這種插件Eyes Only: User Access Shortcode

https://www.wpdaxue.com/eyes-...

/**

* WordPress 根據(jù)用戶名/用戶角色/能力/是否登錄等隱藏部分文章內(nèi)容

* https://www.wpdaxue.com/eyes-only-user-access-shortcode.html

*/

add_shortcode('eyesonly', 'sc_eyesonly');

function sc_eyesonly($atts, $content = null) {

extract(shortcode_atts(array('username' => null, 'level' => null, 'logged' => null,'hide' => null,),$atts));

if (!$hide || $hide === 'no' || $hide === 'false'){$pre = null; $thecontent = do_shortcode($content);}

if ($hide && $hide !== 'no' && $hide !== 'false'){$pre = do_shortcode($content); $thecontent = null;}

$showcontent = $pre;

$current_user = wp_get_current_user();

$users = preg_split("/[\s,]+/",$username);

$levels = preg_split("/[\s,]+/",$level);

foreach($users as $name){if($username && $current_user->user_login === $name){$showcontent = $thecontent;}}

foreach($levels as $value){if($level && current_user_can($value)){$showcontent = $thecontent;}}

if($logged && is_user_logged_in() && $logged === 'in'){$showcontent = $thecontent;}

if($logged && !is_user_logged_in() && $logged === 'out'){$showcontent = $thecontent;}

return $showcontent;

}

python 中怎樣實現(xiàn)

相關(guān)閱讀:

symfony項目如果不用composer安裝第三方庫,而是手動安裝,需要改哪些文件呢?

騰訊云 小程序解決方案 有個問題

salt cp.push提示false異常

javascript中數(shù)組索引為負(fù)值,數(shù)組長度為 結(jié)束索引-開始索引(區(qū)間長度)

pyspider一下生成幾千條鏈接爬取是否合適

大家中午好,xcode 中如何查看一個對象是在堆區(qū)還是在棧區(qū)?

[微信小程序] 為什么點(diǎn)擊手機(jī)設(shè)備上的back按鍵會導(dǎo)致小程序關(guān)閉?

求一個可以上傳zip文件的jq插件,zip里是excel文件

微信開發(fā)工具登陸問題

關(guān)于Python的問題

關(guān)于Python的問題

java jdbc addBatch()提交mysql速度過慢

如何選擇一個容器下的第幾到第幾個元素

hexo博客在本地查看為啥是localhost :4000,4000是什么意思

jquery如何解析這樣的json字符串的鍵,值,謝謝

下面代碼,flex自適應(yīng)布局,但是圖片寬度變窄了而不是文字的寬度變窄,我測試過是文字影響了導(dǎo)致沒法自適應(yīng),為什么,應(yīng)該怎么改?

Android用XUtils下載apk文件被運(yùn)營商劫持,如何處理.

nodejs如何提供本地文件的http訪問路徑?

seajs.use會在seajs.cache里面生產(chǎn)臟數(shù)據(jù) 急!在線等!!

canvas繪制出的三角形,如何設(shè)置旋轉(zhuǎn)角度呢?

關(guān)于python beautifullsoup解析網(wǎng)頁內(nèi)容丟失的問題?

總結(jié)

以上是生活随笔為你收集整理的python 类似wordpress_python,_python 有没有类似WordPress的这种库?,python - phpStudy的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。