| 1 | <?php |
||
| 17 | class Wordlift_Post_Adapter { |
||
| 18 | |||
| 19 | /** |
||
| 20 | * The post id to which the adopter relates. |
||
| 21 | * |
||
| 22 | * @since 3.14.0 |
||
| 23 | * |
||
| 24 | * @var integer $post_id . |
||
| 25 | */ |
||
| 26 | private $post_id; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Create the {@link Wordlift_Post_Adatpter} instance. |
||
| 30 | * |
||
| 31 | * @since 3.14.0 |
||
| 32 | * |
||
| 33 | * @param integer $post_id the post ID of the post the adopter relates to. |
||
| 34 | */ |
||
| 35 | function __construct( $post_id ) { |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Get the word count of the post content. |
||
| 43 | * |
||
| 44 | * The count is calculated over the post content after stripping shortcodes and html tags. |
||
| 45 | * |
||
| 46 | * @since 3.14.0 |
||
| 47 | * |
||
| 48 | * @return integer the number of words in the content after stripping shortcodes and html tags.. |
||
| 49 | */ |
||
| 50 | public function word_count() { |
||
| 56 | |||
| 57 | } |
||
| 58 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.