Jump to content

changing urls of the Recent News


ps4player

Recommended Posts

10 hours ago, ps4player said:

I want to remove or change URLs of the Recent News in clientarea home,
So i need hook to do that, is this possible?

you can change the URL - but if it's a recent version, the URLs are changed by the Friendly URLs setting... are you running into an issue with that?

which WHMCS version are you using and what do you want to change the URL to??

Link to comment
Share on other sites

5 hours ago, brian! said:

you can change the URL - but if it's a recent version, the URLs are changed by the Friendly URLs setting... are you running into an issue with that?

which WHMCS version are you using and what do you want to change the URL to??

Its version 7.2

I want to point all Recent News to announcements.php if possible

Link to comment
Share on other sites

6 hours ago, ps4player said:

Its version 7.2

I want to point all Recent News to announcements.php if possible

quickly tested on v7.4, but can see no reason why it wouldn't work on v7.2... :idea:

<?php

# Modify Recent News Links Hook
# Written by brian!

use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomepagePanels', 1, function(Item $homePagePanels) {

	$recentnews = $homePagePanels->getChild("Recent News");
	if (empty($recentnews)) {
		return;
	}

	$recentchildren = $recentnews->getChildren();
	foreach($recentchildren as $key => $child) {
		$recentnews->getChild($key)
			->setURI('announcements.php');
	}
});

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated