PHPackages                             ed-itsolutions/wordpress-fns - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ed-itsolutions/wordpress-fns

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ed-itsolutions/wordpress-fns
============================

Functions that make working with WordPress easier.

v0.0.6(1y ago)159MITPHPPHP &gt;5.3.3

Since Feb 7Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Ed-ITSolutions/wordpress-fns)[ Packagist](https://packagist.org/packages/ed-itsolutions/wordpress-fns)[ RSS](/packages/ed-itsolutions-wordpress-fns/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

WordPress Fns
=============

[](#wordpress-fns)

A collection of functions to help with WordPress theme &amp; plugin development.

Install
=======

[](#install)

Install from Composer:

```
composer require ed-itsolutions/wordpress-fns
```

Then add `require('vendor/autoload.php');` to the top of your `functions.php`.

Functions
=========

[](#functions)

wordpress\_fns\_as\_filter($functionName, $priority = 10, $args = 1)
--------------------------------------------------------------------

[](#wordpress_fns_as_filterfunctionname-priority--10-args--1)

Adds the named function `$functionName` as a filter with the same name.

wordpress\_fns\_featured\_image\_at\_size($postId, $imageSize)
--------------------------------------------------------------

[](#wordpress_fns_featured_image_at_sizepostid-imagesize)

Returns the given posts `$postId` featured image at size `$imageSize`.

Returns `false` if the post does not have a featured image.

wordpress\_fns\_format\_as\_date($date)
---------------------------------------

[](#wordpress_fns_format_as_datedate)

Returns the given date using the WordPress sites date formatting.

`$date` can either be a timestamp or anything that [strtotime](https://www.php.net/manual/en/function.strtotime.php) can handle.

wordpress\_fns\_get\_attachment\_id\_from\_url($url)
----------------------------------------------------

[](#wordpress_fns_get_attachment_id_from_urlurl)

Returns the id of the attachment from the url. Extremely useful when working with meta boxes etc... that store an images URL instead of its attachment id.

Returns `false` if no attachment could be found.

wordpress\_fns\_get\_page\_sub\_menu\_items($pageId, $menuName)
---------------------------------------------------------------

[](#wordpress_fns_get_page_sub_menu_itemspageid-menuname)

Returns an array of menu items that are the direct desendants of the supplied page `$pageId` on the menu `$menuName`.

Returns an empty array if it couldn't find the menu item for the supplied page.

wordpress\_fns\_header\_or\_featured\_image($imageSize, $postId = 0)
--------------------------------------------------------------------

[](#wordpress_fns_header_or_featured_imageimagesize-postid--0)

If the page has a featured image that image at the given size `$imageSize` will be returned, otherwise it returns the header image set in the customizer.

Supplying `$postId` will return the given posts image.

Contributing
============

[](#contributing)

We welcome PRs to this project. If you have a function or improvement feel free to add them.

We ask that:

- All functions be prefixed with `wordpress_fns_`.
- All functions return `false` instead of throwing an error or null.
- Don't add actions or filters, if users want to use a function as a filter they can do it themselves.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~395 days

Recently: every ~494 days

Total

6

Last Release

677d ago

PHP version history (2 changes)v0.0.1PHP ^5.3.3 || ^7.0

v0.0.5PHP &gt;5.3.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/930b97839168b9f3710451fa89ba02c5f5642d9c33efc77f4d9f5b621a9941be?d=identicon)[Arcath](/maintainers/Arcath)

---

Top Contributors

[![Arcath](https://avatars.githubusercontent.com/u/19609?v=4)](https://github.com/Arcath "Arcath (7 commits)")

---

Tags

wordpresswordpress-development

### Embed Badge

![Health badge](/badges/ed-itsolutions-wordpress-fns/health.svg)

```
[![Health](https://phpackages.com/badges/ed-itsolutions-wordpress-fns/health.svg)](https://phpackages.com/packages/ed-itsolutions-wordpress-fns)
```

###  Alternatives

[carrooi/nette-menu

Menu control for Nette framework

2950.0k1](/packages/carrooi-nette-menu)[misterion/pinba-phpdoc

@phpdoc extension php pinba for IDE autocomplete

1053.4k2](/packages/misterion-pinba-phpdoc)[zalanihir/country-state-city

Laravel package for country, state, city providers with the flags

276.0k](/packages/zalanihir-country-state-city)[netgen/richtext-datatype-bundle

Netgen RichText datatype bundle allows eZ Publish Legacy to work with rich text (ezrichtext) field type available in eZ Platform

1033.4k3](/packages/netgen-richtext-datatype-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
