• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
    • Help
      • Online help
      • Learn Git
      • Welcome to Bitbucket
      • Keyboard shortcuts
    • Log In
    Blackrock
    1. Blackrock

    main

    Public
    Actions
    • Clone

    Learn more about cloning repositories

    You have read-only access

    Navigation
    • Source
    • Commits
    • Branches
    • All Branches Graph
    • Graphs
    • Forks
    1. Blackrock
    2. main

    Source

    main/wp-content/plugins/sitepress-multilingual-cms/classes/translation-feedback/hooks/wpml-tf-frontend-hooks.php
    Артем ШиряевАртем Ширяев committed 554847ddcb906 Apr 2021
    Raw file
    Source viewDiff to previous
     
    1
    <?php
    2
    ​
    3
    /**
    4
     * Class WPML_TF_Frontend_Hooks
    5
     *
    6
     * @author OnTheGoSystems
    7
     */
    8
    class WPML_TF_Frontend_Hooks implements IWPML_Action {
    9
    ​
    10
        /** @var WPML_TF_Frontend_Feedback_View $feedback_view */
    11
        private $feedback_view;
    12
    ​
    13
        /** @var WPML_TF_Frontend_Scripts $scripts */
    14
        private $scripts;
    15
    ​
    16
        /** @var WPML_TF_Frontend_Styles $styles */
    17
        private $styles;
    18
    ​
    19
        /**
    20
         * WPML_TF_Frontend_Hooks constructor.
    21
         *
    22
         * @param WPML_TF_Frontend_Feedback_View $feedback_view
    23
         * @param WPML_TF_Frontend_Scripts       $scripts
    24
         * @param WPML_TF_Frontend_Styles        $styles
    25
         */
    26
        public function __construct(
    27
            WPML_TF_Frontend_Feedback_View $feedback_view,
    28
            WPML_TF_Frontend_Scripts $scripts,
    29
            WPML_TF_Frontend_Styles $styles
    30
        ) {
    31
            $this->feedback_view = $feedback_view;
    32
            $this->scripts       = $scripts;
    33
            $this->styles        = $styles;
    34
        }
    35
    ​
    36
        /**
    37
         * method init
    38
         */
    39
        public function add_hooks() {
    40
            add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_action' ) );
    41
            add_action( 'wp_footer', array( $this, 'render_feedback_form' ) );
    42
            add_action( 'wpml_tf_feedback_open_link', array( $this, 'render_custom_form_open_link' ) );
    43
        }
    44
    ​
    45
        /**
    46
         * method enqueue_scripts_action
    47
         */
    48
        public function enqueue_scripts_action() {
    49
            $this->scripts->enqueue();
    50
            $this->styles->enqueue();
    51
        }
    52
    ​
    53
        /**
    54
         * method render_feedback_form
    55
         */
    56
        public function render_feedback_form() {
    57
            echo $this->feedback_view->render_open_button();
    58
            echo $this->feedback_view->render_form();
    59
        }
    60
    ​
    61
        /** @param string|array $args */
    62
        public function render_custom_form_open_link( $args ) {
    63
            echo $this->feedback_view->render_custom_open_link( $args );
    • Git repository management for enterprise teams powered by Atlassian Bitbucket
    • Atlassian Bitbucket v5.10.1
    • Documentation
    • Contact Support
    • Request a feature
    • About
    • Contact Atlassian
    Atlassian

    Everything looks good. Well let you know here if theres anything you should know about.