Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
civicrm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
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
plugins
civicrm
Commits
104bea16
Verified
Commit
104bea16
authored
3 years ago
by
Kevin Cristiano
Browse files
Options
Downloads
Patches
Plain Diff
Conditionally set menu position as integer depending on WordPress version - Christian Wach
parent
6150fb10
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/civicrm.admin.php
+14
-4
14 additions, 4 deletions
includes/civicrm.admin.php
with
14 additions
and
4 deletions
includes/civicrm.admin.php
+
14
−
4
View file @
104bea16
...
...
@@ -587,17 +587,27 @@ class CiviCRM_For_WordPress_Admin {
$civilogo
=
file_get_contents
(
CIVICRM_PLUGIN_DIR
.
'assets/images/civilogo.svg.b64'
);
global
$wp_version
;
if
(
version_compare
(
$wp_version
,
'5.9.9999'
,
'>'
))
{
$menu_position
=
3
;
}
else
{
$menu_position
=
'3.904981'
;
}
/**
* Filter the position of the CiviCRM menu item.
*
* Currently set to 3.9 + some random digits to reduce risk of conflict.
* As per the code above, the position was previously set to '3.904981' to
* reduce risk of conflicts. The position is now conditionally set depending
* on the version of WordPress.
*
* @since
4.4
* @since
5.47 Conditionally set because WordPress 6.0 enforces integers. Backport to 5.45+
*
* @param str The default menu position
expressed as a float
.
* @param str
|int $menu_position
The default menu position.
* @return str The modified menu position expressed as a float.
*/
$position
=
apply_filters
(
'civicrm_menu_item_position'
,
'3.904981'
);
$position
=
apply_filters
(
'civicrm_menu_item_position'
,
$menu_position
);
// Try and initialize CiviCRM.
$success
=
$this
->
initialize
();
...
...
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