Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wpct ERP Forms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
codeccoop
WordPress
plugins
Wpct ERP Forms
Commits
9dcc8a6e
Commit
9dcc8a6e
authored
10 months ago
by
Lucas García
Browse files
Options
Downloads
Plain Diff
Merge branch 'feat/wpct-dc' into 'main'
Update Wpct DC API See merge request
!1
parents
04f6b6a9
cdf5354b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Update Wpct DC API
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
abstract/class-plugin.php
+1
-1
1 addition, 1 deletion
abstract/class-plugin.php
includes/class-settings.php
+3
-3
3 additions, 3 deletions
includes/class-settings.php
wpct-erp-forms.php
+22
-5
22 additions, 5 deletions
wpct-erp-forms.php
with
26 additions
and
9 deletions
abstract/class-plugin.php
+
1
−
1
View file @
9dcc8a6e
...
...
@@ -51,7 +51,7 @@ abstract class Plugin extends Singleton
private
function
check_dependencies
()
{
add_filter
(
'wpct_dependencies
_check
'
,
function
(
$dependencies
)
{
add_filter
(
'wpct_
dc_
dependencies'
,
function
(
$dependencies
)
{
foreach
(
$this
->
dependencies
as
$label
=>
$url
)
{
$dependencies
[
$label
]
=
$url
;
}
...
...
This diff is collapsed.
Click to expand it.
includes/class-settings.php
+
3
−
3
View file @
9dcc8a6e
...
...
@@ -38,9 +38,9 @@ class Settings extends Abstract\Settings
private
function
get_forms
()
{
global
$wpdb
;
if
(
apply_filters
(
'wpct_dc_is_
plugin_active'
,
false
,
'contact-form-7/wp-contact-form-7.php'
))
{
return
$wpdb
->
get_results
(
"SELECT id, post_title title FROM wp_posts WHERE post_status = 'publish'"
);
}
elseif
(
apply_filters
(
'wpct_dc_is_
plugin_active'
,
false
,
'gravityforms/gravityforms.php'
))
{
if
(
apply_filters
(
'wpct_dc_is_
active'
,
'contact-form-7/wp-contact-form-7.php'
))
{
return
$wpdb
->
get_results
(
"SELECT id, post_title title FROM wp_posts WHERE
post_type = 'wpcf7_contact_form' AND
post_status = 'publish'"
);
}
elseif
(
apply_filters
(
'wpct_dc_is_
active'
,
'gravityforms/gravityforms.php'
))
{
return
$wpdb
->
get_results
(
"SELECT id, title FROM wp_gf_form WHERE is_active = TRUE"
);
}
...
...
This diff is collapsed.
Click to expand it.
wpct-erp-forms.php
+
22
−
5
View file @
9dcc8a6e
...
...
@@ -9,7 +9,7 @@ use WPCT_ERP_FORMS\GF\Integration as GFIntegration;
* Plugin Name: Wpct ERP Forms
* Plugin URI: https://git.coopdevs.org/codeccoop/wp/wpct-erp-forms
* Description: Plugin to bridge WP forms submissions to a ERP backend
* Author: Còdec
Cooperativa
* Author: Còdec
* Author URI: https://www.codeccoop.org
* Text Domain: wpct-erp-forms
* Domain Path: languages
...
...
@@ -42,20 +42,37 @@ class Wpct_Erp_Forms extends Abstract\Plugin
protected
$name
=
'Wpct ERP Forms'
;
protected
$textdomain
=
'wpct-erp-forms'
;
protected
$dependencies
=
[
'Wpct Http Bridge'
=>
'<a href="https://git.coopdevs.org/codeccoop/wp/wpct-http-bridge/">Wpct Http Bridge</a>'
'wpct-http-bridge/wpct-http-bridge.php'
=>
[
'name'
=>
'Wpct Http Bridge'
,
'url'
=>
'https://git.coopdevs.org/codeccoop/wp/plugins/wpct-http-bridge/'
,
'download'
=>
'https://git.coopdevs.org/codeccoop/wp/plugins/wpct-http-bridge/-/releases/permalink/latest/downloads/plugins/wpct-http-bridge.zip'
]
];
protected
function
__construct
()
{
parent
::
__construct
();
if
(
apply_filters
(
'wpct_dc_is_
plugin_
active'
,
false
,
'contact-form-7/wp-contact-form-7.php'
))
{
if
(
apply_filters
(
'wpct_dc_is_active'
,
false
,
'contact-form-7/wp-contact-form-7.php'
))
{
require_once
'includes/integrations/wpcf7/class-integration.php'
;
$this
->
_integrations
[
'wpcf7'
]
=
Wpcf7Integration
::
get_instance
();
}
elseif
(
apply_filters
(
'wpct_dc_is_
plugin_
active'
,
false
,
'gravityforms/gravityforms.php'
))
{
}
elseif
(
apply_filters
(
'wpct_dc_is_active'
,
false
,
'gravityforms/gravityforms.php'
))
{
require_once
'includes/integrations/gf/class-integration.php'
;
$this
->
_integrations
[
'gf'
]
=
GFIntegration
::
get_instance
();
}
add_filter
(
'plugin_action_links'
,
function
(
$links
,
$file
)
{
if
(
$file
!==
plugin_basename
(
__FILE__
))
{
return
$links
;
}
$url
=
admin_url
(
'options-general.php?page=wpct-erp-forms'
);
$label
=
__
(
'Settings'
,
'wpct-erp-forms'
);
$link
=
"<a href='
{
$url
}
'>
{
$label
}
</a>"
;
array_unshift
(
$links
,
$link
);
return
$links
;
},
5
,
2
);
}
public
function
init
()
...
...
@@ -73,4 +90,4 @@ class Wpct_Erp_Forms extends Abstract\Plugin
add_action
(
'plugins_loaded'
,
function
()
{
$plugin
=
Wpct_Erp_Forms
::
get_instance
();
},
5
);
},
9
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment