0
所以,这里是一个没有任何参数(WordPress的)原始功能添加PHP参数
public static function getCurrent() {
$post = get_post();
$profiles = new MY_images($post->ID);
return $profiles;
}
这是在下面的变量中:
$my_site_images = MY_images::getCurrent();
因此,它得到了$post->ID
从getCurrent()
现在,我想定制它,以便我可以在其中添加任何id
或将其保留为空,以用于默认功能,例如followin g:
$my_site_images = MY_images::getCurrent(343); (where the "post id" is 343)
我需要对原始函数做些什么修改才能添加任何ID?
谢谢一堆!
谢谢。欣赏它!得到它的工作。 –