@charset "UTF-8";

/*!
Theme Name: Cocoon Child
Description: Cocoon専用の子テーマ
Theme URI: https://wp-cocoon.com/
Author: わいひら
Author URI: https://nelog.jp/
Template:   cocoon-master
Version:    1.1.3
*/

/************************************
** 子テーマ用のスタイルを書く
************************************/
/*必要ならばここにコードを書く*/

/************************************
** レスポンシブデザイン用のメディアクエリ
************************************/
/*1023px以下*/
@media screen and (max-width: 1023px){
  /*必要ならばここにコードを書く*/
}

/*834px以下*/
@media screen and (max-width: 834px){
  /*必要ならばここにコードを書く*/
}

/*480px以下*/
@media screen and (max-width: 480px){
  /*必要ならばここにコードを書く*/
}

function bp_force_post_to_activity( $post_id, $post ) {
    if ( $post->post_type !== 'post' || $post->post_status !== 'publish' ) {
        return;
    }

    bp_activity_add( array(
        'user_id'   => $post->post_author,
        'action'    => sprintf( '%s さんが新しい投稿を公開しました', get_the_author_meta( 'display_name', $post->post_author ) ),
        'content'   => $post->post_title,
        'component' => 'activity',
        'type'      => 'activity_update',
        'item_id'   => $post_id,
    ) );
}
add_action( 'publish_post', 'bp_force_post_to_activity', 10, 2 );
