Title: Jobbnorge Block
Author: Per Søderlind
Published: <strong>January 24, 2023</strong>
Last modified: March 18, 2026

---

Search plugins

![](https://ps.w.org/jobbnorge-block/assets/icon-256x256.png?rev=3001877)

# Jobbnorge Block

 By [Per Søderlind](https://profiles.wordpress.org/pers/)

[Download](https://downloads.wordpress.org/plugin/jobbnorge-block.2.3.0.zip)

 * [Details](https://test.wordpress.org/plugins/jobbnorge-block/#description)
 * [Reviews](https://test.wordpress.org/plugins/jobbnorge-block/#reviews)
 *  [Installation](https://test.wordpress.org/plugins/jobbnorge-block/#installation)
 * [Development](https://test.wordpress.org/plugins/jobbnorge-block/#developers)

 [Support](https://wordpress.org/support/plugin/jobbnorge-block/)

## Description

In 2.0 the new Jobbnorge API is used, and the following features are available (
~~strikethrough~~ means removed, since it’s not in the new API):

 * In pagination mode (default), set the number of jobs to display per page (10 
   is default), else set the number of jobs to display.
 * Sort jobs bye deadline, closest first.
 * Does not show jobs that are past the deadline.
 * Set the number of jobs to display.
 * ~~Set the number of words in the excerpt.~~
 * Set the no jobs message.
 * Show or hide the job excerpt.
 * Show or hide the job deadline.
 * Show or hide the job scope.
 * ~~Show or hide the job duration.~~
 * Display the jobs in a grid or list view.
 * Set the number of columns in the grid view.

**New features in 2.0**:
 – Add more than one employer. – If more than one employer
is added, order jobs by employer or deadline. – Define which employers are available
in the block, using the `jobbnorge_employers` filter.

#### Filters

**jobbnorge_employers**

The `jobbnorge_employers` filter can be used to define which employers are available
in the block:

    ```
    add_filter( 'jobbnorge_employers', function( $employers ) {
        $employers = [
            [
                'label'    => 'Select employer',
                'value'    => '',
                'disabled' => true, // Optional.
            ],
            [
                'label' => 'Employer 1',
                'value' => '1234',
            ],
            [
                'label' => 'Employer 2',
                'value' => '5678',
            ],
        ];
        return $employers;
    } );
    ```

**jobbnorge_cache_path**

The `jobbnorge_cache_path` filter can be used to define the cache path. Default 
is `WP_CONTENT_DIR . '/cache/jobbnorge'`.

**jobbnorge_cache_time**

The `jobbnorge_cache_time` filter can be used to define the cache time. Default 
is `30 * MINUTE_IN_SECONDS`.

**jobbnorge_autoscroll_threshold**

The `jobbnorge_autoscroll_threshold` filter adjusts when automatic scroll engages
after pagination. The value is a float representing the fraction of the viewport
height the block’s top must be within to skip scrolling (default `0.25`). Example:

    ```
    add_filter( 'jobbnorge_autoscroll_threshold', function( $threshold ) {
        return 0.15; // Scroll only if block starts below top 15% of viewport.
    } );
    ```

#### Block Settings

When pagination is enabled a setting **Disable auto scroll on pagination** becomes
available. Enabling it adds a `disableAutoScroll` attribute (and `data-no-autoscroll`
in markup) preventing the page from scrolling after changing pages.

#### GitHub

The plugin is also available on [GitHub](https://github.com/dss-web/jobbnorge-block)

## Screenshots

 * [[
 * Install the block from the Block Directory.
 * [[
 * Add employer ID.
 * [[
 * Listview with pagination.
 * [[
 * Gridview with pagination.
 * [[
 * Custom Select field for employer ID. Ctrl-click (Windows) or Cmd-click (Mac) 
   to select multiple employers. Shift-click to select a range of employers.

## Blocks

This plugin provides 1 block.

 *   Jobbnorge Retrieve and display job listings from Jobbnorge.no

## Installation

Either, add the block from the Block Directory:

 1. To add a block from the Block Directory, navigate to the post editor.
 2. Place your cursor where you would like a new block option.
 3. Select the “Add Block” button in the top-left area of the editor screen.
 4. Search for “Jobbnorge” and select the “Jobbnorge” block.

Or, add the block from the WordPress admin:

 1. In the WordPress admin, go to the “Plugins” screen, click “Add New” and search 
    for “Jobbnorge”.
 2. Click “Install Now” and then “Activate Plugin”.
 3. Use the Gutenberg editor to add the block to a page or post.

## FAQ

### Where to I find the employer ID?

You get it from your Jobbnorge contact.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Jobbnorge Block” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Per Sﾃｸderlind ](https://profiles.wordpress.org/pers/)
 *   [ DSS-WEB ](https://profiles.wordpress.org/dssweb/)

“Jobbnorge Block” has been translated into 1 locale. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/jobbnorge-block/contributors)
for their contributions.

[Translate “Jobbnorge Block” into your language.](https://translate.wordpress.org/projects/wp-plugins/jobbnorge-block)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/jobbnorge-block/), 
check out the [SVN repository](https://plugins.svn.wordpress.org/jobbnorge-block/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/jobbnorge-block/)
by [RSS](https://plugins.trac.wordpress.org/log/jobbnorge-block/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.3.0

 * Enhancement: Bump all @wordpress dependencies to latest major versions.
 * Enhancement: Updated @wordpress/scripts from 26.19.0 to 31.6.0.
 * Fix: Replace removed `edit` icon with `pencil` from @wordpress/icons.
 * Compatibility: Tested up to WordPress 7.0.

#### 2.2.7

 * Fix: Correct malformed API URL that was missing query string delimiter, causing“
   Request error retrieving jobs” (400 Bad Request).

#### 2.2.6

 * Fix: Wrap render function in try-catch to prevent API/network errors from breaking
   the page.
 * Fix: Add error handling in cache handler to gracefully handle file read/write
   failures.
 * Fix: Add bounds checking in `parse_date_fallback()` to handle malformed date 
   strings.
 * Fix: Validate cache directory path before file operations to prevent “Path cannot
   be empty” errors.
 * Fix: Add directory writability check in cache handler.
 * Enhancement: Improved JavaScript error display – shows warning instead of error,
   re-enables retry buttons.
 * Enhancement: Added `jobbnorge_block_render_error` action hook for debugging render
   failures.

#### 2.2.5

 * Cleanup: Removed temporary diagnostic probe (pre_render_block) and all debug 
   logging.
 * Cleanup: Eliminated debug HTML marker while retaining safe synthetic AJAX context
   and wrapper fallback.
 * Stability: Retained attribute/supports normalization safeguards to prevent core
   block supports warnings.
 * Internal: Version bump and asset rebuild prepping for release.

#### 2.2.4

 * Fix: Normalize block registration to standard pattern to avoid potential core
   notices when resolving block supports.
 * Fix: Add defensive guard ensuring `$attributes` is always an array in `render_block_dss_jobbnorge`.
 * Fix: Move serialized `data-attributes` JSON from wrapper `<div>` to `<ul>` so
   pagination JS reliably reads them.
 * Enhancement: Show stale cache notice inline above listings when serving fallback
   data.
 * Internal: Version bump synchronization across metadata and build.
 * Accessibility: Add dedicated polite `role="status"` live region announcing current
   results & page (per instance) and force re-announcement after pagination.
 * Enhancement: Introduce stable `instanceId` with `data-block-instance` for precise
   multi-instance pagination & scroll targeting.
 * Enhancement: Refined scroll offset (2em above block) and limited scroll to affected
   instance only.
 * Internal: Added initial Jest test harness and basic pagination replacement test.
 * Enhancement: Added optional per-block “Disable auto scroll on pagination” setting(
   attribute `disableAutoScroll`).
 * Enhancement: Added `jobbnorge_autoscroll_threshold` filter to customize auto 
   scroll visibility threshold (default 0.25 viewport height).
 * Test: Added multi-wrapper scroll isolation test ensuring only targeted instance
   triggers scroll & replacement.

#### 2.2.3

 * Version bump: synchronize plugin header, constant, readme Stable tag and package.
   json.
 * Enhancement: Add resilient API failure handling (HTTP status differentiation,
   stale cache fallback, logging hook `jobbnorge_api_request_failed`).
 * Enhancement: Display stale cache notice when serving cached results after API
   failure.

#### 2.2.2

 * Update block.json to include default value and role for employerID
    This change
   ensures that users can edit the content of the blocks when the template has been
   locked for content-only editing.

#### 2.2.1

 * FIX: Fix grid view not working in editor and frontend by properly configuring
   CSS file references
 * FIX: Add grid styles to editor.scss to ensure grid layout works in WordPress 
   block editor
 * ENHANCEMENT: Update webpack configuration to build editor and style CSS separately
 * ENHANCEMENT: Improve pagination scroll behavior to position 2em above block for
   better user experience

#### 2.2.0

 * NEW: Add frontend pagination support with AJAX loading
 * NEW: Add pagination controls (enable/disable, jobs per page setting)
 * ENHANCEMENT: Upgrade to Jobbnorge API v3 for better performance
 * ENHANCEMENT: Implement PHP-based pagination to work around API limitations with
   employer filtering
 * ENHANCEMENT: Add responsive grid layout that adapts to screen size
 * ENHANCEMENT: Improve cache key logic to include pagination and layout parameters
 * ENHANCEMENT: Add loading states and error handling for pagination
 * ENHANCEMENT: Separate frontend and admin CSS loading for better performance
 * FIX: Fix CSS class naming conflicts that prevented grid view from working on 
   frontend
 * FIX: Resolve frontend style loading issues
 * DEVELOPER: Add comprehensive webpack build configuration for multiple entry points
 * DEVELOPER: Add pagination JavaScript with proper AJAX handling and nonce security

#### 2.1.5

 * Add uninstall handler. Will remove the cache directory when the plugin is uninstalled.

#### 2.1.4

 * Update translation.

#### 2.1.3

 * Bump version.

#### 2.1.2

 * Update translation.

#### 2.1.1

 * Update translation.

#### 2.1.0

 * Use local cache. The local cache is a simple caching mechanism that stores data
   in PHP files. In theory, nothing is faster in PHP than loading and executing 
   another PHP file. If you have PHP OPcache enabled, then the PHP content will 
   be cached in memory, and the PHP file will not be parsed again.
 * Add filter for cache path and cache time.

#### 2.0.0

 * BREAKING CHANGE, using the Public Jobbnorge API and you need to add the employer
   ID.

#### 1.0.12

 * Tested with WordPress 6.3
 * Deadline format fix.

#### 1.0.11

 * Tested with WordPress 6.2

#### 1.0.10

 * Update translation.

#### 1.0.9

 * Rename functions to avoid conflicts.

#### 1.0.8

 * Rename plugin.

#### 1.0.7

 * Initial Release

## Meta

 *  Version **2.3.0**
 *  Last updated **2 months ago**
 *  Active installations **10+**
 *  WordPress version ** 6.5 or higher **
 *  Tested up to **7.0**
 *  PHP version ** 8.2 or higher **
 *  Languages
 * [English (US)](https://wordpress.org/plugins/jobbnorge-block/) and [Norwegian (Bokmål)](https://nb.wordpress.org/plugins/jobbnorge-block/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/jobbnorge-block)
 * Tag
 * [block](https://test.wordpress.org/plugins/tags/block/)
 *  [Advanced View](https://test.wordpress.org/plugins/jobbnorge-block/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/jobbnorge-block/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/jobbnorge-block/reviews/)

## Contributors

 *   [ Per Sﾃｸderlind ](https://profiles.wordpress.org/pers/)
 *   [ DSS-WEB ](https://profiles.wordpress.org/dssweb/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/jobbnorge-block/)