Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename module classes with QTX_Module prefix #1187

Merged
merged 2 commits into from
Jun 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/acf/acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
define( 'ACF_QTRANSLATE_PLUGIN_DIR', plugin_dir_path( ACF_QTRANSLATE_PLUGIN ) );

require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/plugin.php';
new acf_qtranslate_plugin;
new QTX_Module_Acf_Plugin;
20 changes: 10 additions & 10 deletions modules/acf/src/acf_5/acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_interface.php';

class acf_qtranslate_acf_5 implements acf_qtranslate_acf_interface {
class QTX_Module_Acf_V5 implements QTX_Module_Acf_Interface {

/**
* The plugin instance
* @var acf_qtranslate_plugin
* @var QTX_Module_Acf_Plugin
*/
protected $plugin;

/**
* Constructor
*
* @param acf_qtranslate_plugin $plugin
* @param QTX_Module_Acf_Plugin $plugin
*/
public function __construct( $plugin ) {
$this->plugin = $plugin;
Expand All @@ -35,13 +35,13 @@ public function include_fields() {
require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/fields/url.php';
require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/fields/wysiwyg.php';

acf()->fields->register_field_type( new acf_qtranslate_acf_5_file( $this->plugin ) );
acf()->fields->register_field_type( new acf_qtranslate_acf_5_image( $this->plugin ) );
acf()->fields->register_field_type( new acf_qtranslate_acf_5_post_object( $this->plugin ) );
acf()->fields->register_field_type( new acf_qtranslate_acf_5_text( $this->plugin ) );
acf()->fields->register_field_type( new acf_qtranslate_acf_5_textarea( $this->plugin ) );
acf()->fields->register_field_type( new acf_qtranslate_acf_5_url( $this->plugin ) );
acf()->fields->register_field_type( new acf_qtranslate_acf_5_wysiwyg( $this->plugin ) );
acf()->fields->register_field_type( new QTX_Module_Acf_V5_File( $this->plugin ) );
acf()->fields->register_field_type( new QTX_Module_Acf_V5_Image( $this->plugin ) );
acf()->fields->register_field_type( new QTX_Module_Acf_V5_Post_Object( $this->plugin ) );
acf()->fields->register_field_type( new QTX_Module_Acf_V5_Text( $this->plugin ) );
acf()->fields->register_field_type( new QTX_Module_Acf_V5_Textarea( $this->plugin ) );
acf()->fields->register_field_type( new QTX_Module_Acf_V5_Url( $this->plugin ) );
acf()->fields->register_field_type( new QTX_Module_Acf_V5_Wysiwyg( $this->plugin ) );
}

/**
Expand Down
6 changes: 3 additions & 3 deletions modules/acf/src/acf_5/fields/file.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

class acf_qtranslate_acf_5_file extends acf_field_file {
class QTX_Module_Acf_V5_File extends acf_field_file {

/**
* The plugin instance
* @var acf_qtranslate_plugin
* @var QTX_Module_Acf_Plugin
*/
protected $plugin;

/**
* Constructor
*
* @param acf_qtranslate_plugin $plugin
* @param QTX_Module_Acf_Plugin $plugin
*/
function __construct( $plugin ) {
$this->plugin = $plugin;
Expand Down
6 changes: 3 additions & 3 deletions modules/acf/src/acf_5/fields/image.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

class acf_qtranslate_acf_5_image extends acf_field_image {
class QTX_Module_Acf_V5_Image extends acf_field_image {

/**
* The plugin instance
* @var acf_qtranslate_plugin
* @var QTX_Module_Acf_Plugin
*/
protected $plugin;

/**
* Constructor
*
* @param acf_qtranslate_plugin $plugin
* @param QTX_Module_Acf_Plugin $plugin
*/
function __construct( $plugin ) {
$this->plugin = $plugin;
Expand Down
6 changes: 3 additions & 3 deletions modules/acf/src/acf_5/fields/post_object.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

class acf_qtranslate_acf_5_post_object extends acf_field_post_object {
class QTX_Module_Acf_V5_Post_Object extends acf_field_post_object {

/**
* The plugin instance
* @var acf_qtranslate_plugin
* @var QTX_Module_Acf_Plugin
*/
protected $plugin;

/**
* Constructor
*
* @param acf_qtranslate_plugin $plugin
* @param QTX_Module_Acf_Plugin $plugin
*/
function __construct( $plugin ) {
$this->plugin = $plugin;
Expand Down
6 changes: 3 additions & 3 deletions modules/acf/src/acf_5/fields/text.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

class acf_qtranslate_acf_5_text extends acf_field_text {
class QTX_Module_Acf_V5_Text extends acf_field_text {

/**
* The plugin instance
* @var acf_qtranslate_plugin
* @var QTX_Module_Acf_Plugin
*/
protected $plugin;

/**
* Constructor
*
* @param acf_qtranslate_plugin $plugin
* @param QTX_Module_Acf_Plugin $plugin
*/
function __construct( $plugin ) {
$this->plugin = $plugin;
Expand Down
6 changes: 3 additions & 3 deletions modules/acf/src/acf_5/fields/textarea.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

class acf_qtranslate_acf_5_textarea extends acf_field_textarea {
class QTX_Module_Acf_V5_Textarea extends acf_field_textarea {

/**
* The plugin instance
* @var acf_qtranslate_plugin
* @var QTX_Module_Acf_Plugin
*/
protected $plugin;

/**
* Constructor
*
* @param acf_qtranslate_plugin $plugin
* @param QTX_Module_Acf_Plugin $plugin
*/
function __construct( $plugin ) {
$this->plugin = $plugin;
Expand Down
6 changes: 3 additions & 3 deletions modules/acf/src/acf_5/fields/url.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

class acf_qtranslate_acf_5_url extends acf_field_url {
class QTX_Module_Acf_V5_Url extends acf_field_url {

/**
* The plugin instance
* @var acf_qtranslate_plugin
* @var QTX_Module_Acf_Plugin
*/
protected $plugin;

/**
* Constructor
*
* @param acf_qtranslate_plugin $plugin
* @param QTX_Module_Acf_Plugin $plugin
*/
function __construct( $plugin ) {
$this->plugin = $plugin;
Expand Down
6 changes: 3 additions & 3 deletions modules/acf/src/acf_5/fields/wysiwyg.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

class acf_qtranslate_acf_5_wysiwyg extends acf_field_wysiwyg {
class QTX_Module_Acf_V5_Wysiwyg extends acf_field_wysiwyg {

/**
* The plugin instance
* @var acf_qtranslate_plugin
* @var QTX_Module_Acf_Plugin
*/
protected $plugin;

/**
* Constructor
*
* @param acf_qtranslate_plugin $plugin
* @param QTX_Module_Acf_Plugin $plugin
*/
function __construct( $plugin ) {
$this->plugin = $plugin;
Expand Down
2 changes: 1 addition & 1 deletion modules/acf/src/acf_interface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

interface acf_qtranslate_acf_interface {
interface QTX_Module_Acf_Interface {

/**
* Get the visible ACF fields
Expand Down
6 changes: 3 additions & 3 deletions modules/acf/src/plugin.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

class acf_qtranslate_plugin {
class QTX_Module_Acf_Plugin {

/**
* An ACF instance
* @var acf_qtranslate_acf_interface
* @var QTX_Module_Acf_Interface
*/
protected $acf;

Expand Down Expand Up @@ -34,7 +34,7 @@ public function init() {
if ( ! $plugin_loaded && $this->acf_enabled() ) {
if ( $this->acf_major_version() === 5 ) {
require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/acf.php';
$this->acf = new acf_qtranslate_acf_5( $this );
$this->acf = new QTX_Module_Acf_V5( $this );
}
$plugin_loaded = true;
}
Expand Down
4 changes: 2 additions & 2 deletions modules/gravity-forms/gravity-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @link https://michel.weimerskirch.net
*/

class qTranslateSupportForGravityforms {
class QTX_Module_Gravity_Forms {
public function __construct() {
add_filter( 'gform_pre_render', array( $this, 'gform_pre_render' ) );
add_filter( 'gform_pre_submission_filter', array( $this, 'gform_pre_render' ) );
Expand Down Expand Up @@ -156,4 +156,4 @@ private function convertURL( $url, $lang ) {
}
}

new qTranslateSupportForGravityforms();
new QTX_Module_Gravity_Forms();
4 changes: 2 additions & 2 deletions modules/jetpack/jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
exit;
}

class QTX_Jetpack {
class QTX_Module_Jetpack {
public function __construct() {
add_filter( 'jetpack_relatedposts_returned_results', array( $this, 'translate_related_posts' ) );
}
Expand All @@ -30,4 +30,4 @@ function translate_related_posts( $results ) {

}

new QTX_Jetpack();
new QTX_Module_Jetpack();
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Main class for translation of slugs, setting up hooks for front-side.
*/
class QTX_Slugs {
class QTX_Module_Slugs {
/**
* Stores options slugs from database.
* @var array
Expand Down
4 changes: 2 additions & 2 deletions modules/slugs/slugs.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
const QTX_SLUGS_META_PREFIX = 'qtranslate_slug_'; // The language code is appended.

include_once( dirname( __FILE__ ) . '/src/slugs-class-slugs.php' );
include_once( dirname( __FILE__ ) . '/qtx_module_slugs.php' );
include_once( dirname( __FILE__ ) . '/src/slugs-utils.php' );

global $qtranslate_slugs;
$qtranslate_slugs = new QTX_Slugs();
$qtranslate_slugs = new QTX_Module_Slugs();

if ( is_admin() ) {
include_once( dirname( __FILE__ ) . '/admin/slugs-admin.php' );
Expand Down