PluginProbe
Assistant – Every Day Productivity Apps / 0.3.1
Assistant – Every Day Productivity Apps v0.3.1
1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 1.0 All 71 releases
assistant / backend / src / System / Integrations / BeaverBuilder.php

BeaverBuilder.php in Assistant – Every Day Productivity Apps 0.3.1, at backend/src/System/Integrations/BeaverBuilder.php

40 lines 924 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 namespace FL\Assistant\System\Integrations;
5
6
7 /**
8 * Class BeaverBuilder
9 *
10 * @package FL\Assistant\System\Integrations
11 */
12 class BeaverBuilder {
13
14
15 /**
16 * Checks to see if beaver builder is installed
17 * @return bool
18 */
19 public function is_installed() {
20 return class_exists( '\FLBuilderModel' ) && class_exists( '\FLBuilderUserAccess' );
21 }
22
23 /**
24 * Checks to see if Beaver Builder can be uses to edit a post.
25 */
26 public function can_edit_post( $post_id ) {
27 $editable = false;
28 $post = get_post( $post_id );
29 $post_types = \FLBuilderModel::get_post_types();
30 $user_can = current_user_can( 'edit_post', $post->ID );
31 $user_access = \FLBuilderUserAccess::current_user_can( 'builder_access' );
32
33 if ( in_array( $post->post_type, $post_types, true ) && $user_can && $user_access ) {
34 $editable = true;
35 }
36
37 return (bool) apply_filters( 'fl_builder_is_post_editable', $editable );
38 }
39 }
40