0

我为 youtube 视频滑块创建了一个新插件。我使用下面的代码来创建插件。激活此插件后,帖子和页面更新不起作用。我收到的错误是“更新失败”

我在我的帖子中使用了这样的短代码 [az_youtube_slider]。

你能请任何人帮我解决这个错误吗?

提前致谢。

<?php
/*
Plugin Name: Assistanz youtube slider
Plugin URI: https://www.assistanz.com/
Description: Get videos from youtube assistanz channel and slider
Version: 1.0
Author: Safia
Author URI: https://assistanz.com/
License: GPLv2 or later
Text Domain: assistanz
*/
if(!defined('ABSPATH')) exit;
function az_youtube_slider($atts, $content = null) {
  return "<p>Youtube video will come here</p>";
}

add_shortcode("az_youtube_slider", "az_youtube_slider");
?>
4

1 回答 1

0

使用“经典编辑器”插件来解决您的问题,您的功能也将不起作用,请使用以下更新您的功能。

function displayDate($atts, $content = null) {
  return "<p>Youtube video will come here</p>";
}

add_shortcode("az_youtube_slider", "displayDate");
于 2019-09-07T11:24:03.887 回答