本文整理汇总了PHP中BP_Activity_Activity::get_id方法的典型用法代码示例。如果您正苦于以下问题:PHP BP_Activity_Activity::get_id方法的具体用法?PHP BP_Activity_Activity::get_id怎么用?PHP BP_Activity_Activity::get_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BP_Activity_Activity
的用法示例。
在下文中一共展示了BP_Activity_Activity::get_id方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_activity_get_activity_id
/**
* Fetch the activity_id for an existing activity entry in the DB.
*
* @since BuddyPress (1.2.0)
*
* @see BP_Activity_Activity::get() For more information on accepted arguments.
* @uses wp_parse_args()
* @uses apply_filters() To call the 'bp_activity_get_activity_id' hook.
* @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
*
* @param array $args See BP_Activity_Activity::get() for description.
* @return int $activity_id The ID of the activity item found.
*/
function bp_activity_get_activity_id($args = '')
{
$r = bp_parse_args($args, array('user_id' => false, 'component' => false, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'action' => false, 'content' => false, 'date_recorded' => false));
return apply_filters('bp_activity_get_activity_id', BP_Activity_Activity::get_id($r['user_id'], $r['component'], $r['type'], $r['item_id'], $r['secondary_item_id'], $r['action'], $r['content'], $r['date_recorded']));
}
示例2: test_get_id_with_secondary_item_id
/**
* @group get_id
*/
public function test_get_id_with_secondary_item_id()
{
$a1 = $this->factory->activity->create(array('secondary_item_id' => 523));
$a2 = $this->factory->activity->create(array('secondary_content' => 1888));
$activity = BP_Activity_Activity::get_id(false, false, false, false, 523, false, false, false);
$this->assertEquals($a1, $activity);
}
示例3: bp_activity_get_activity_id
/**
* Fetch the activity_id for an existing activity entry in the DB.
*
* @since 1.2.0
*
* @see BP_Activity_Activity::get() For more information on accepted arguments.
* @uses wp_parse_args()
* @uses apply_filters() To call the 'bp_activity_get_activity_id' hook.
* @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
*
* @param array|string $args See BP_Activity_Activity::get() for description.
* @return int $activity_id The ID of the activity item found.
*/
function bp_activity_get_activity_id($args = '')
{
$r = bp_parse_args($args, array('user_id' => false, 'component' => false, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'action' => false, 'content' => false, 'date_recorded' => false));
/**
* Filters the activity ID being requested.
*
* @since 1.2.0
* @since 2.5.0 Added the `$r` and `$args` parameters.
*
* @param BP_Activity_Activity $value ID returned by BP_Activity_Activity get_id() method with provided arguments.
* @param array $r Parsed function arguments.
* @param array $args Arguments passed to the function.
*/
return apply_filters('bp_activity_get_activity_id', BP_Activity_Activity::get_id($r['user_id'], $r['component'], $r['type'], $r['item_id'], $r['secondary_item_id'], $r['action'], $r['content'], $r['date_recorded']), $r, $args);
}
示例4: bp_activity_get_activity_id
/**
* Fetch the activity_id for an existing activity entry in the DB.
*
* @since 1.2.0
*
* @param array $args See docs for $defaults for details
*
* @uses nxt_parse_args()
* @uses apply_filters() To call the 'bp_activity_get_activity_id' hook
* @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
*
* @return int $activity_id The activity id
*/
function bp_activity_get_activity_id($args = '')
{
$defaults = array('user_id' => false, 'component' => false, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'action' => false, 'content' => false, 'date_recorded' => false);
$r = nxt_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
return apply_filters('bp_activity_get_activity_id', BP_Activity_Activity::get_id($user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded));
}
示例5: bp_activity_get_activity_id
/**
* Fetch the activity_id for an existing activity entry in the DB.
*
* @since BuddyPress (1.2.0)
*
* @see BP_Activity_Activity::get() For more information on accepted arguments.
* @uses wp_parse_args()
* @uses apply_filters() To call the 'bp_activity_get_activity_id' hook.
* @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
*
* @param array $args See BP_Activity_Activity::get() for description.
* @return int $activity_id The ID of the activity item found.
*/
function bp_activity_get_activity_id( $args = '' ) {
$r = bp_parse_args( $args, array(
'user_id' => false,
'component' => false,
'type' => false,
'item_id' => false,
'secondary_item_id' => false,
'action' => false,
'content' => false,
'date_recorded' => false,
) );
/**
* Filters the activity ID being requested.
*
* @since BuddyPress (1.2.0)
*
* @param BP_Activity_Activity ID returned by BP_Activity_Activity get_id() method with provided arguments.
*/
return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id(
$r['user_id'],
$r['component'],
$r['type'],
$r['item_id'],
$r['secondary_item_id'],
$r['action'],
$r['content'],
$r['date_recorded']
) );
}