如何调用第三方插件的过滤器并将其分配给短代码
我对整个WordPress世界的新手很陌生,因此我可以需要一些帮助。我有一个第三方插件,可提供许多操作,过滤器和功能。如何在我的function.php
文件中调用它们并为其分配一个短代码,以便在这种情况下我可以在单个页面模板上使用它?
这是一个示例:
这就是我到目前为止尝试的,但它在前端没有任何操作:
function wpc_elementor_shortcode( $atts ) {
echo apply_filters( 'sensei_lesson_count', $post_args );
}
add_shortcode( 'my_elementor_php_output', 'wpc_elementor_shortcode');
I'm pretty new to the whole WordPress world so I could need some help. I have a 3rd party plugin that provides a bunch of actions, filters, and functions. How can I call them in my functions.php
file and assign a shortcode to it, so I can use it on a single page template in this case?
Here is an example:
That's what I tried so far, but it doesn't do anything on the front-end:
function wpc_elementor_shortcode( $atts ) {
echo apply_filters( 'sensei_lesson_count', $post_args );
}
add_shortcode( 'my_elementor_php_output', 'wpc_elementor_shortcode');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论