不幸的是,当用户从WordPress 3更新到4.4时,我的插件现在停止工作,该插件帮助将JWplayer HTML5播放器嵌入带有短代码的帖子中,因此在进行新的更新时,短代码不会输出视频播放器,而只会输出短代码
[jwplayer7sc file=”https://www.youtube.com/watch?v=c74KCFIaRIw” title=”efzef” description=”zef” image=”zefzef”]
Run Code Online (Sandbox Code Playgroud)
你可以在这里看到问题
这是我的代码:
function jw7sc_video_shortcode($atts) {
// extract all video shortcode parameters and pass them to @VARS
extract( shortcode_atts( array(
'id' => generateRandomString(),
'file' => '',
'title' => '',
'description' => '',
'image' => '',
'width' => '',
'height' => '',
'autostart' => '',
'mute' => '',
'controls' => '',
'repeat' => '' ,
'displaytitle' => '',
'displaydescription' => '',
'androidhls' => '',
'stretching' => '',
'skin' => ''
), $atts ) );
// check …Run Code Online (Sandbox Code Playgroud) 我使用的是 Laravel 5.7,当使用 Mail 接口发送电子邮件时,会触发Mail\Events\MessageSending和两个事件Mail\Events\MessageSent,因此我的目标是捕获 MessageSending 事件并获取用于发送电子邮件的可邮寄类(示例mail\Ordershipped)并停止它。
<?php
namespace App\Listeners;
use Illuminate\Mail\Events\MessageSending;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class LogSendingMessage
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param MessageSending $event
* @return void
*/
public function handle(MessageSending $event)
{
//here i want to check what mailable class used and stop it.
if ($mailable == 'Ordershipped')
return false;
// …Run Code Online (Sandbox Code Playgroud) 制作自定义服务提供者或简单地在 AppServiceProvider 注册方法中注册它有什么区别?
谢谢。