e( 'You can get permission to publish information to user\'s Facebook wall.' ); ?>
e( 'For example, display link to post action "read an article" to Facebook wall.' ); ?>
10), //%s ); ?> Publish to Facebook EOS; echo esc_html( sprintf( $code, $this->_( 'URL which user will be redirected' ), $this->_( 'Action name fired after authentication' ), $this->_( 'Additional arguments passed to hook function' ) ) ); ?>
e( 'If user click this link, he will be redirected to Facebook and see permission dialog. After authentication, the aciton you registered will be fired. Now hook on it and execute publication.' ); ?>
post("/me/feed", [
"message" => "%s",
"link" => get_permalink($post->ID),
"name" => get_the_title($post->ID),
"description" => strip_tags($post->post_content),
"action" => json_encode( [
"name" => get_bloginfo( 'name' ),
"link" => home_url( '/' )
] )
], $token);
} catch ( FacebookApiException \$e ) {
// %s
}
}
// %s
}
EOS;
echo esc_html(
sprintf(
$code,
$this->_( 'Register action hook which you registered above.' ),
$this->_( 'This funciton will be executed after authentication' ),
$this->_( 'Check if argument is propery passed and if post exists.' ),
$this->_( 'Read an artcile.' ),
$this->_( 'Do error handling if you wish.' ),
$this->_( 'This funcion been executed, user will be redirected.' )
)
);
?>
Note: $facebook object is instance of Facebook class which is part of Facebook PHP SDK. To know what you can do with it, read the documentation.', 'wp-gianism' ),
'https://developers.facebook.com/docs/reference/php/'
)
);
?>
e( 'You can make tweet by registered application\'s account.' ); ?>
_( 'Hello, my followers. I updated new post.' ) ) ); ?>
e( 'This function itself makes no sense, but you can use some hook to make auto post.' ); ?>
post->type){
switch(\$old_status){
case 'draft':
case 'pending':
case 'auto-draft':
case 'future':
\$url = wp_get_shortlink(\$post->ID);
\$author = get_the_author_meta('display_name', \$post->post_author);
\$string = sprintf('%s',
\$author, \$post->post_title, \$url);
break;
}
}
}
// Hook on post status transition
add_action('transition_post_status', '_my_gianism_publish_tweet', 10, 3);
EOS;
echo esc_html( sprintf( $code, $this->_( '%1$s pulbished %2$s. Please visit %3$s' ) ) );
?>
e( 'Note: Currently, only twitter application\'s account(thus, admin\'s twitter account) can tweet.' ); ?>
_( 'You can do many things with SNS API. But every solution is very specific and little bit difficult. If you need more, please visit our support site.' ), gianism_utm_link( 'https://gianism.info/', [ 'utm_medium' => 'advanced', ] ) ); ?>