duanbei2914 2014-09-09 16:43
浏览 43

Wordpress表情符号适用于某些级别的成员

Hello, I am trying to setup my wordpress website with a membership plugin (right now trying Paid Membership Pro), and I am trying to make it where certain membership levels are either are granted access to the wordpress smilies (emoticons). To a further extent I would love to have certain membership levels have access to different smilies.

Paid Membership Pro gives an example of code to grant access to things in your theme based on membership level, but the code for the smilies are not in that folder.

Example Code:

<?php
    if(pmpro_hasMembershipLevel('Gold'))
    {
    ?>
        //Place your HTML or PHP code here if the user is in the required membership level
        ...
    <?php
    }
?>

I have tried to add this code (without the PHP breaking for html) into the function.php in the wp-includes/ folder.

So my code in wordpress's (NOT the theme's) function.php looks like:

function smilies_init() {
    global $wpsmiliestrans, $wp_smiliessearch;

    // don't bother setting up smilies if they are disabled
    if ( !get_option( 'use_smilies' ) )
        return;
    if(pmpro_hasMembershipLevel('Platinum'))
    { 
        if ( !isset( $wpsmiliestrans ) ) {
            $wpsmiliestrans = array(
            //The list of smilies are here and very long so this is a placeholder
            );
        }
    }
    //And the rest of the code in this function I have not modified

With that method nothing is changed when someone comments a smilies and is not 'Platinum' and that membership level does exist. I am not sure if I need to link the Paid Membership Pro code (which I have not tried or looked for yet) or something else. Any help would be greatly appreciated.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计