我正在阅读插件的源代码(gallery to slideshow插件),以使其表现得像我想要的一样,并且它正在使用一个动作
add_action( \'the_posts\', array( &$this, \'have_gallery\' ), 10, 1 );
我想知道这些额外的参数(10,1)意味着什么,但我找不到该操作的文档。请帮忙我正在阅读插件的源代码(gallery to slideshow插件),以使其表现得像我想要的一样,并且它正在使用一个动作
add_action( \'the_posts\', array( &$this, \'have_gallery\' ), 10, 1 );
我想知道这些额外的参数(10,1)意味着什么,但我找不到该操作的文档。请帮忙这些参数不是\\u post所独有的,它们是add\\u action()函数的参数
add_action( $tag, $function_to_add, $priority, $accepted_args );
10只是默认优先级,1是默认接受的参数数。因为它们都是默认值,所以您实际上不需要任何一个。这是相当add_action() 相关的
add_action(
\'the_posts\', //$tag
array( &$this, \'have_gallery\' ), //$function_to_add
10, //$priority - run priority, when to execute given action
1 //$accepted_args - number of accepted arguments, one in this case
);
10表示默认运行优先级,1表示此函数采用的一个参数。我偶然发现this question 在写这个问题的时候。我有一个问题是关于这个问题的。我发现你用的是get_delete_post_link 筛选为我的操作创建一个新的url(或一个类似的函数——在任何情况下,我都会将该函数与布尔值一起使用)。唯一的问题是,I don\'t know how to capture the event now. 考虑到我在谷歌上找不到很多关于行后操作的例子,我将不胜感激-/public function _wp_filter_get_delete_post_link( $