diff --git a/docs/index.rst b/docs/index.rst index f9a9989d..4d4c128d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -246,3 +246,14 @@ There are different types of documentation available to help you navigate your w users_roles/managing_users users_roles/managing_roles + +.. toctree:: + :maxdepth: 2 + :caption: WordPress Plugin + :hidden: + + wordpress/installation + wordpress/shortcodes + wordpress/tracking + wordpress/settings + wordpress/developers \ No newline at end of file diff --git a/docs/wordpress/developers.rst b/docs/wordpress/developers.rst new file mode 100644 index 00000000..9829ddf1 --- /dev/null +++ b/docs/wordpress/developers.rst @@ -0,0 +1,10 @@ +Developers +========== + +This section covers everything you need to know about setting up your environment and integrating with WordPress. + +.. toctree:: + :maxdepth: 2 + + environment + hooks-and-functions diff --git a/docs/wordpress/environment.rst b/docs/wordpress/environment.rst new file mode 100644 index 00000000..aff3d9d8 --- /dev/null +++ b/docs/wordpress/environment.rst @@ -0,0 +1,49 @@ +Environment +=============== + +Before you begin developing, ensure you have **Docker** running on your system. + +Getting Started +--------------- + +First, clone the WordPress development repository: + +:: + + git clone https://github.com/WordPress/wordpress-develop.git + +Change into the cloned directory: + +:: + + cd wordpress-develop + +Initial Setup +--------------- + +Run the following commands to set up your environment: + +:: + + npm install + npm run build:dev + npm run env:start + npm run env:install + +These commands will: + +- Install all Node.js dependencies. +- Build development versions of WordPress assets. +- Start the local Docker containers for WordPress. +- Install WordPress into the Docker environment. + +Useful Commands +--------------- + +After setup, you can use these commands to control your environment: + +- ``npm run env:start`` — Start Docker containers. +- ``npm run env:stop`` — Stop Docker containers. +- ``npm run env:restart`` — Restart Docker containers. + +Visit your local WordPress install at **http://localhost:8889**. \ No newline at end of file diff --git a/docs/wordpress/hooks-and-functions.rst b/docs/wordpress/hooks-and-functions.rst new file mode 100644 index 00000000..bac19e44 --- /dev/null +++ b/docs/wordpress/hooks-and-functions.rst @@ -0,0 +1,23 @@ +Hooks & Functions +=============== + +Useful Functions +--------------- + +- ``wpmautic_option( $option, $default )`` — Retrieve plugin settings safely. +- ``wpmautic_base_script()`` — Get full URL of ``mtc.js`` script. +- ``wpmautic_get_tracking_attributes()`` — Get custom tracking data array. + +Filters +--------------- + +Extend the plugin using: + +:: + + apply_filters('wpmautic_tracking_attributes', $attrs) + +Actions +--------------- + +- ``wp_head`` or ``wp_footer`` — Automatically injects Mautic script depending on settings. \ No newline at end of file diff --git a/docs/wordpress/installation.rst b/docs/wordpress/installation.rst new file mode 100644 index 00000000..b68b1548 --- /dev/null +++ b/docs/wordpress/installation.rst @@ -0,0 +1,16 @@ +Installation & Activation +========================= + +Requirements +------------ + +- WordPress 4.6 or later +- PHP 5.6 or later + +Steps +----- + +1. Download the WP Mautic plugin. +2. Go to your WordPress Admin Dashboard → Plugins → Add New. +3. Click "Upload Plugin" and choose the downloaded ZIP file. +4. Click "Install Now" and then "Activate". diff --git a/docs/wordpress/settings.rst b/docs/wordpress/settings.rst new file mode 100644 index 00000000..cafaece2 --- /dev/null +++ b/docs/wordpress/settings.rst @@ -0,0 +1,15 @@ +Plugin Settings +=============== + +Accessing the Settings +----------------------- + +Navigate to **Settings → WPMautic** from your WordPress dashboard. + +Available Options +----------------- + +- **Base URL:** The URL where your Mautic instance is installed (e.g., ``https://your-mautic.com``). +- **Script Location:** Choose whether to inject tracking code in the header, footer, or disable it. +- **Track Logged In Users:** Enable tracking details like email, username for logged-in users. +- **Fallback Activation:** Adds a ``